mirror of
https://github.com/Fluffy-Bean/dots.git
synced 2025-05-18 17:34:54 +00:00
first commit
This commit is contained in:
commit
e55d8c9640
15 changed files with 894 additions and 0 deletions
36
polybar/scripts/powermenu.sh
Normal file
36
polybar/scripts/powermenu.sh
Normal file
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## Author : Aditya Shakya
|
||||
## Mail : adi1090x@gmail.com
|
||||
## Github : @adi1090x
|
||||
## Twitter : @adi1090x
|
||||
|
||||
uptime=$(uptime -p | sed -e 's/up //g')
|
||||
rofi_command="rofi -theme ~/.config/rofi/power.rasi"
|
||||
|
||||
# Options
|
||||
shutdown="Shutdown"
|
||||
reboot="Restart"
|
||||
suspend="Sleep"
|
||||
settings="Settings"
|
||||
|
||||
# Variable passed to rofi
|
||||
options="$reboot\n$shutdown\n$settings"
|
||||
|
||||
chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)"
|
||||
case $chosen in
|
||||
$shutdown)
|
||||
systemctl poweroff
|
||||
;;
|
||||
$reboot)
|
||||
systemctl reboot
|
||||
;;
|
||||
$suspend)
|
||||
mpc -q pause
|
||||
amixer set Master mute
|
||||
systemctl suspend
|
||||
;;
|
||||
$settings)
|
||||
gnome-control-center
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue