Switch from dwm to dwl in scripts
- Add more keybindings to swhkd - Move session and control-center scripts from dwm to dwl - Remove restart option from session script - Remove compositor and startup rofi menus from control-center - Update dwl submodule
This commit is contained in:
74
dwl/.scripts/session.sh
Executable file
74
dwl/.scripts/session.sh
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
help_menu() {
|
||||
echo "Script to interact with desktop session. Use only one argument at a time."
|
||||
# echo " - Play / Pause: playerctl.sh --play-pause"
|
||||
# echo " - Next: playerctl.sh --next"
|
||||
# echo " - Previous: playerctl.sh --prev"
|
||||
# echo " - Change Player: playerctl.sh --change"
|
||||
# echo " - Rofi Menu: playerctl.sh --rofi"
|
||||
# echo " - Help: playerctl.sh --help OR playerctl.sh -h"
|
||||
}
|
||||
|
||||
rofi_menu() {
|
||||
declare -a options=(
|
||||
" Logout - logout"
|
||||
" Lock - lock"
|
||||
"⏾ Sleep - sleep"
|
||||
" Reboot - reboot"
|
||||
" Shutdown - shutdown"
|
||||
" Hibernate - hibernate"
|
||||
" Back - back"
|
||||
" Quit - quit"
|
||||
)
|
||||
|
||||
choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -i)
|
||||
option=$(printf '%s\n' "${choice}" | awk '{print $NF}')
|
||||
|
||||
if [[ "$option" == "quit" ]]; then
|
||||
pkill rofi
|
||||
elif [[ "$option" != "back" ]]; then
|
||||
main "--$option" && pkill rofi
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ $# -eq 0 ]; then
|
||||
# No arguments
|
||||
help_menu
|
||||
else
|
||||
case $1 in
|
||||
--help | -h)
|
||||
help_menu
|
||||
;;
|
||||
--logout)
|
||||
notify-send "Session Control" "Logging Out of dwl"
|
||||
wtype -M win -M shift -P q
|
||||
;;
|
||||
--lock)
|
||||
notify-send "Session Control" "Locking Session"
|
||||
loginctl lock-session
|
||||
;;
|
||||
--sleep)
|
||||
notify-send "Session Control" "Going to Sleep"
|
||||
systemctl suspend
|
||||
;;
|
||||
--reboot)
|
||||
notify-send "Session Control" "Rebooting System"
|
||||
systemctl reboot
|
||||
;;
|
||||
--shutdown)
|
||||
notify-send "Session Control" "Shutting Down System"
|
||||
systemctl poweroff
|
||||
;;
|
||||
--hibernate)
|
||||
notify-send "Session Control" "Hibernating System"
|
||||
systemctl hibernate
|
||||
;;
|
||||
--rofi)
|
||||
rofi_menu
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
main $@
|
Reference in New Issue
Block a user