diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2021-06-04 15:41:15 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2021-06-04 15:41:15 -0700 |
| commit | 028e0a4009347d4a4f4aa55b6e525c151a307b5d (patch) | |
| tree | 833a199fff5fe2fbce569cf66225cc802ed35bf3 /statusbar/sb-pacpackages | |
| parent | da1b9c3f656d85517a36a4031b290b94c948dac8 (diff) | |
added scripts for dwmblocks
Diffstat (limited to 'statusbar/sb-pacpackages')
| -rwxr-xr-x | statusbar/sb-pacpackages | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/statusbar/sb-pacpackages b/statusbar/sb-pacpackages new file mode 100755 index 0000000..37ebed3 --- /dev/null +++ b/statusbar/sb-pacpackages @@ -0,0 +1,29 @@ +#!/bin/sh + +# Displays number of upgradeable packages. +# 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. +# When clicked, it will run an upgrade via pacman. +# +# Add the following text as a file in /usr/share/libalpm/hooks/statusbar.hook: +# +# [Trigger] +# Operation = Upgrade +# Type = Package +# Target = * +# +# [Action] +# Description = Updating statusbar... +# When = PostTransaction +# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Or i3blocks if using i3. + +case $BLOCK_BUTTON in + 1) setsid -f "$TERMINAL" -e sb-popupgrade ;; + 2) notify-send "$(/usr/bin/pacman -Qu)" ;; + 3) notify-send "🎁 Upgrade module" "📦: number of upgradable packages +- Left click to upgrade packages +- Middle click to show upgradable packages" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/📦/;s/^📦0$//g" |
