diff options
Diffstat (limited to '.scripts/statusbar')
| -rwxr-xr-x | .scripts/statusbar/clock | 5 | ||||
| -rwxr-xr-x | .scripts/statusbar/mpdupdate | 9 | ||||
| -rwxr-xr-x | .scripts/statusbar/pacpackages | 5 | ||||
| -rwxr-xr-x | .scripts/statusbar/weather | 9 |
4 files changed, 16 insertions, 12 deletions
diff --git a/.scripts/statusbar/clock b/.scripts/statusbar/clock index caed51a..587e3c9 100755 --- a/.scripts/statusbar/clock +++ b/.scripts/statusbar/clock @@ -3,10 +3,9 @@ date '+%Y %b %d (%a) %I:%M%p' case $BLOCK_BUTTON in - 1) pgrep -x dunst >/dev/null && notify-send "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" ;; + 1) pgrep -x dunst >/dev/null && notify-send "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/span><\/b>/")" && notify-send "$(calcurse -d3)" ;; 2) "$TERMINAL" -e calcurse ;; 3) pgrep -x dunst >/dev/null && notify-send "<b>📅 Time/date module:</b> -- Left click to show month via \`cal\` +- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; esac - diff --git a/.scripts/statusbar/mpdupdate b/.scripts/statusbar/mpdupdate new file mode 100755 index 0000000..84c7ab1 --- /dev/null +++ b/.scripts/statusbar/mpdupdate @@ -0,0 +1,9 @@ +#!/bin/sh + +[ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit + +while : ; do + pgrep -x mpd || exit + mpc idle > /dev/null + pkill -RTMIN+11 i3blocks ; +done diff --git a/.scripts/statusbar/pacpackages b/.scripts/statusbar/pacpackages index 1207e2c..9e1ef22 100755 --- a/.scripts/statusbar/pacpackages +++ b/.scripts/statusbar/pacpackages @@ -8,8 +8,11 @@ case $BLOCK_BUTTON in 1) $TERMINAL -e popupgrade ;; + 2) notify-send "$(/usr/bin/pacman -Qu)" ;; 3) pgrep -x dunst >/dev/null && notify-send "<b>Upgrade module:</b> -📦: number of upgradable packages" ;; +📦: number of upgradable packages +- Left click to upgrade packages +- Middle click to show upgradable packages" ;; esac diff --git a/.scripts/statusbar/weather b/.scripts/statusbar/weather index 4b7bbb6..00abda2 100755 --- a/.scripts/statusbar/weather +++ b/.scripts/statusbar/weather @@ -1,6 +1,5 @@ #!/bin/sh -### This is only if your location isn't automatically detected, otherwise you can leave it blank. -location="" +[ "$(stat -c %y .weatherreport | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] && getforecast case $BLOCK_BUTTON in 1) $TERMINAL -e less -Srf ~/.weatherreport ;; @@ -11,12 +10,6 @@ case $BLOCK_BUTTON in 🌞: Daily high" ;; esac -[ "$location" != "" ] && location="$location+" - -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 - 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 "°"}' |
