right click on modules shows module info
This commit is contained in:
parent
9fd0e65754
commit
debbe40d2c
6 changed files with 46 additions and 12 deletions
|
@ -20,3 +20,13 @@ fi
|
||||||
[ "$status" = "Charging" ] && color="#FFF"
|
[ "$status" = "Charging" ] && color="#FFF"
|
||||||
|
|
||||||
printf "<span color='%s'>%s %s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$(echo "$capacity" | sed -e 's/$/%/')"
|
printf "<span color='%s'>%s %s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$(echo "$capacity" | sed -e 's/$/%/')"
|
||||||
|
|
||||||
|
case $BLOCK_BUTTON in
|
||||||
|
3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b>
|
||||||
|
🔋: discharging
|
||||||
|
♻: stagnant charge
|
||||||
|
🔌: charging
|
||||||
|
⚡: charged
|
||||||
|
- Text color reflects charge left" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,12 @@
|
||||||
# When clicked, brings up `neomutt`.
|
# When clicked, brings up `neomutt`.
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) $TERMINAL -e neomutt ;;
|
1) "$TERMINAL" -e neomutt ;;
|
||||||
|
3) pgrep -x dunst >/dev/null && notify-send "<b>📬 Mail module:</b>
|
||||||
|
- Shows unread mail
|
||||||
|
- Left click opens neomutt" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "$(du -a ~/.mail/*/INBOX/new/* | sed -n '$=')" $(cat ~/.config/mutt/.dl)
|
|
||||||
|
|
||||||
|
echo "$(du -a ~/.mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat ~/.config/mutt/.dl 2>/dev/null)"
|
||||||
|
|
|
@ -5,8 +5,14 @@ filter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) mpc status | filter && $TERMINAL -e ncmpcpp & disown ;; # right click, pause/unpause
|
1) mpc status | filter && setsid "$TERMINAL" -e ncmpcpp & ;; # right click, pause/unpause
|
||||||
3) mpc toggle | filter ;; # right click, pause/unpause
|
2) mpc toggle | filter ;; # right click, pause/unpause
|
||||||
|
3) mpc status | filter && pgrep -x dunst >/dev/null && notify-send "<b>🎵 Music module:</b>
|
||||||
|
- Shows mpd song playing.
|
||||||
|
- Italic when paused.
|
||||||
|
- Left click opens ncmpcpp.
|
||||||
|
- Middle click pauses.
|
||||||
|
- Scroll changes track.";; # right click, pause/unpause
|
||||||
4) mpc prev | filter ;; # scroll up, previous
|
4) mpc prev | filter ;; # scroll up, previous
|
||||||
5) mpc next | filter ;; # scroll down, next
|
5) mpc next | filter ;; # scroll down, next
|
||||||
*) mpc status | filter ;;
|
*) mpc status | filter ;;
|
||||||
|
|
|
@ -4,10 +4,13 @@
|
||||||
# Displays number of upgradeable packages.
|
# Displays number of upgradeable packages.
|
||||||
# For this to work, have a `pacman -Sy` command run in the background as a
|
# For this to work, have a `pacman -Sy` command run in the background as a
|
||||||
# cronjob every so often as root. This script will then read those packages.
|
# cronjob every so often as root. This script will then read those packages.
|
||||||
# When clicked, it will run an upgrade via `yay`. (`yay` required, duh.)
|
# When clicked, it will run an upgrade via pacman.
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) $TERMINAL -e "popupgrade" ;;
|
1) $TERMINAL -e popupgrade ;;
|
||||||
|
3) pgrep -x dunst >/dev/null && notify-send "<b>Upgrade module:</b>
|
||||||
|
📦: number of upgradable packages" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
yay -Qu | sed -e '/^Get/d' | wc -l | sed -e "s/^0$//g"
|
|
||||||
|
pacman -Qu | wc -l | sed -e "s/^0$//g"
|
||||||
|
|
|
@ -2,9 +2,13 @@
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) setsid "$TERMINAL" -e pulsemixer & ;;
|
1) setsid "$TERMINAL" -e pulsemixer & ;;
|
||||||
3) pulsemixer --toggle-mute ;;
|
2) pulsemixer --toggle-mute ;;
|
||||||
4) pulsemixer --change-volume +5 ;;
|
4) pulsemixer --change-volume +5 ;;
|
||||||
5) pulsemixer --change-volume -5 ;;
|
5) pulsemixer --change-volume -5 ;;
|
||||||
|
3) pgrep -x dunst >/dev/null && notify-send "<b>Volume module:</b>
|
||||||
|
- Shows volume 🔊, 🔇 if muted.
|
||||||
|
- Middle click to mute.
|
||||||
|
- Scroll to change."
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ "$(pulsemixer --get-mute)" = "1" ] && printf "🔇\\n" && exit
|
[ "$(pulsemixer --get-mute)" = "1" ] && printf "🔇\\n" && exit
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
### This is only if your location isn't automatically detected, otherwise you can leave it blank.
|
### This is only if your location isn't automatically detected, otherwise you can leave it blank.
|
||||||
location=""
|
location="Statesboro"
|
||||||
|
|
||||||
|
case $BLOCK_BUTTON in
|
||||||
|
1) $TERMINAL -e popweather ;;
|
||||||
|
3) pgrep -x dunst >/dev/null && notify-send "<b>🌈 Weather module:</b>
|
||||||
|
☔: Chance of rain/snow
|
||||||
|
❄: Daily low
|
||||||
|
🌞: Daily high" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
[ "$location" != "" ] && location="$location+"
|
[ "$location" != "" ] && location="$location+"
|
||||||
|
|
||||||
[ "$BLOCK_BUTTON" = "1" ] && $TERMINAL -e popweather
|
|
||||||
|
|
||||||
ping -q -w 1 -c 1 "$(ip r | grep default | tail -1 | cut -d ' ' -f 3)" >/dev/null || exit
|
ping -q -w 1 -c 1 "$(ip r | grep default | tail -1 | cut -d ' ' -f 3)" >/dev/null || exit
|
||||||
|
|
||||||
curl -s wttr.in/$location > ~/.weatherreport
|
curl -s wttr.in/$location > ~/.weatherreport
|
||||||
|
|
||||||
printf "%s" "$(sed '16q;d' ~/.weatherreport | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')"
|
printf "%s" "$(sed '16q;d' ~/.weatherreport | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')"
|
||||||
|
|
||||||
sed '13q;d' ~/.weatherreport | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","☀️",$2 "°"}'
|
sed '13q;d' ~/.weatherreport | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}'
|
||||||
|
|
Loading…
Reference in a new issue