diff options
author | awy <awy@awy.one> | 2025-10-02 18:35:12 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-10-02 18:35:12 +0300 |
commit | 0a1a0582e07910f59de1ea10d2bd984668cfb442 (patch) | |
tree | 5c81f07ac82adab1eccab834dfcd3cbabffa2fd0 /.local/bin/sb-pacpackages | |
parent | 871880e95058f65537f54cc669cbcf3100931f28 (diff) | |
download | hyprdots-0a1a0582e07910f59de1ea10d2bd984668cfb442.tar.gz |
upd
Diffstat (limited to '.local/bin/sb-pacpackages')
-rwxr-xr-x | .local/bin/sb-pacpackages | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/.local/bin/sb-pacpackages b/.local/bin/sb-pacpackages new file mode 100755 index 0000000..5ef09d3 --- /dev/null +++ b/.local/bin/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 >/dev/null 2>&1 ;; + 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" ;; + 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;; +esac + +pacman -Qu | rg -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g" |