mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
a better way to turn the PC off
Possibly better and easier to read for people new to Linux/GNU using dmenu.
This commit is contained in:
parent
d81df93aa0
commit
2253d69340
21
.scripts/i3cmds/turnoff
Normal file
21
.scripts/i3cmds/turnoff
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
powerlevel=$(echo "Power off\nReboot" | dmenu -i -p "Power off or reboot?")
|
||||
|
||||
if [ "$powerlevel" = "" ]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ $(echo "No\nYes" | dmenu -i -p "Are you sure?") = "Yes" ]
|
||||
then
|
||||
if [ "$powerlevel" = "Power off" ]
|
||||
then
|
||||
exec sudo -A shutdown -hP now
|
||||
fi
|
||||
|
||||
if [ "$powerlevel" = "Reboot" ]
|
||||
then
|
||||
exec sudo -A reboot
|
||||
fi
|
||||
fi
|
||||
Loading…
x
Reference in New Issue
Block a user