#!/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 | wc -l ;} if [ "$(packages)" -gt 0 ]; then pacman -Qu | rofi -dmenu -l 50 else notify-send "Nothing to update!" fi ;; *) exit esac