neodotfiles/.config/scripts/dmenu-power.sh

40 lines
1.2 KiB
Bash
Raw Normal View History

2022-01-26 20:40:22 +00:00
#!/bin/sh
# _____ ___ ___
# / /::\ / /\ /__/|
# / /:/\:\ / /::\ | |:| ***This script was made by Clay Gomera (Drake)***
# / /:/ \:\ / /:/\:\ | |:| - Description: A simple power menu dmenu script
# /__/:/ \__\:| / /:/~/:/ __| |:| - Dependencies: dmenu (Everything else can be changed)
# \ \:\ / /:/ /__/:/ /:/___ /__/\_|:|____
# \ \:\ /:/ \ \:\/:::::/ \ \:\/:::::/
# \ \:\/:/ \ \::/~~~~ \ \::/~~~~
# \ \::/ \ \:\ \ \:\
# \__\/ \ \:\ \ \:\
# \__\/ \__\/
option1=" Logout"
option2=" Reboot"
option3=" Power off"
option4="💤 Suspend"
option5="🔒lock"
option6="❌Cancel"
session=loginctl list | awk '$1 ~ "c" { print $1 }'
options="$option1\n$option2\n$option3\n$option4\n$option5\n$option6"
action=$(echo "$options" | dmenu -b -i -p " ")
case "$action" in
$option1)
loginctl kill-session "$session";;
$option2)
loginctl reboot;;
$option3)
loginctl poweroff;;
$option4)
2022-02-08 18:26:09 +00:00
loginctl suspend && betterlockscreen -l;;
2022-01-26 20:40:22 +00:00
$option5)
betterlockscreen -l;;
$option6)
2022-02-08 18:26:09 +00:00
exit 0
2022-01-26 20:40:22 +00:00
esac