samedami 9d56d3e272
Add 'shelp' script
Also add simple description comment to all script.
2020-05-15 20:56:33 +02:00

26 lines
539 B
Bash
Executable File

#!/bin/sh
# Packages update.
action="$(printf " Update\n Show packages" | \
rofi -dmenu -i -p 'Updater' -l 2 -width 200)"
[ ! "$action" ] && exit
case "$action" in
" Update")
export PASS="$(printf | dmenu -P -p "Enter password: " -h 24)"
[ ! "$PASS" ] && exit
st -e sh -c "echo $PASS | sudo -S -v && clear; sudo pacman -Su --noconfirm"
;;
" Show packages")
packages() { pacman -Qu; }
if [ "$(packages)" -gt 0 ]; then
pacman -Qu | dmenu -l 50
else notify-send "Nothing to update!"
fi
;;
*) exit
esac