Add community scripts for i3blocks
This commit is contained in:
34
.local/bin/i3scripts/contrib/pacman
Executable file
34
.local/bin/i3scripts/contrib/pacman
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
################################
|
||||
# Shows pacman packages that need updated.
|
||||
#
|
||||
# dependencies:
|
||||
# - checkupdates
|
||||
# - [notify-send]
|
||||
#
|
||||
# @return {Number}: Outdated packages
|
||||
################################
|
||||
|
||||
dir=$(dirname "$0")
|
||||
source $dir/util.sh
|
||||
|
||||
full=""
|
||||
short=""
|
||||
status=0
|
||||
|
||||
packages=$(checkupdates)
|
||||
numPackages=$(numLines "$packages")
|
||||
|
||||
full=$numPackages
|
||||
short=$full
|
||||
|
||||
echo "$full"
|
||||
echo "$short"
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
# right click: show packages
|
||||
3) notify-send "Pacman packages" "$packages" ;;
|
||||
esac
|
||||
|
||||
exit $status
|
||||
Reference in New Issue
Block a user