Move polybar scripts into polybar package

This commit is contained in:
natemaia
2018-12-14 15:53:11 -08:00
parent a9c34d0956
commit ad0db3c96d
5 changed files with 19 additions and 232 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
NAME=$(basename "$0")
VER="0.4"
VER="0.5"
usage()
{
@ -15,18 +15,18 @@ usage()
-v,--version Display script version
-w,--window Switch between open windows
-r,--run Application launcher
-r,--run Program launcher & run dialog
-w,--window Switch between windows
-l,--logout System logout dialog
-b,--browser Browser search by keyword (requires surfraw)
-q,--qalculate Persistant calculator dialog (requires libqalculate)
-c,--clipboard Select previous clipboard entries (requires greenclip)
-b,--browser Browser search by keyword (requires surfraw)
-l,--logout Session logout dialog
Without any options the run dialog will be opened.
@ -74,21 +74,25 @@ for arg in "$@"; do
-padding 50 -line-padding 4)"
;;
-l|--logout)
ANS="$(rofi -sep "|" -dmenu -i -p 'System' -width 20 \
-hide-scrollbar -line-padding 4 -padding 20 \
-lines 4 <<< " Lock| Logout| Reboot| Shutdown")"
if grep -q 'exec startx'; then
ANS="$(rofi -sep "|" -dmenu -i -p 'System' -width 20 \
-hide-scrollbar -line-padding 4 -padding 20 \
-lines 4 <<< " Lock| Reboot| Shutdown")"
else
ANS="$(rofi -sep "|" -dmenu -i -p 'System' -width 20 \
-hide-scrollbar -line-padding 4 -padding 20 \
-lines 4 <<< " Lock| Logout| Reboot| Shutdown")"
fi
case "$ANS" in
*Lock) i3lock-fancy ;;
*Logout) session-logout || pkill -15 -t tty"$XDG_VTNR" Xorg ;;
*Reboot) systemctl reboot ;;
*Shutdown) systemctl -i poweroff
*Shutdown) systemctl -i poweroff ;;
*Logout) session-logout || pkill -15 -t tty"$XDG_VTNR" Xorg ;;
esac
;;
*)
echo
echo "Option does not exist: $arg"
echo
printf "\nOption does not exist: %s\n\n" "$arg"
exit 2
esac
done