mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-25 13:42:23 +00:00
43 lines
962 B
Bash
Executable file
43 lines
962 B
Bash
Executable file
#!/bin/bash
|
|
|
|
## Author : Aditya Shakya (adi1090x)
|
|
## Mail : adi1090x@gmail.com
|
|
## Github : @adi1090x
|
|
## Reddit : @adi1090x
|
|
|
|
rofi_command="rofi -theme /home/leon/scripts/rofi-scripts/powermenu.rasi"
|
|
uptime=$(uptime -p | sed -e 's/up //g')
|
|
#mem=$( free -h | grep -i mem | awk -F ' ' '{print $3}')
|
|
cpu=$(sh ~/.config/rofi/bin/usedcpu)
|
|
memory=$(sh ~/.config/rofi/bin/usedram)
|
|
|
|
# Options
|
|
shutdown="襤"
|
|
reboot="ﰇ"
|
|
lock=""
|
|
suspend="鈴"
|
|
logout=""
|
|
|
|
# Variable passed to rofi
|
|
options="$shutdown\n$reboot\n$lock\n$suspend\n$logout"
|
|
|
|
chosen="$(echo -e "$options" | $rofi_command -p "祥 $uptime $cpu $memory " -dmenu -selected-row 2)"
|
|
case $chosen in
|
|
$shutdown)
|
|
systemctl poweroff
|
|
;;
|
|
$reboot)
|
|
systemctl reboot
|
|
;;
|
|
$lock)
|
|
i3lock
|
|
;;
|
|
$suspend)
|
|
mpc -q pause
|
|
amixer set Master mute
|
|
systemctl suspend
|
|
;;
|
|
$logout)
|
|
openbox --exit
|
|
;;
|
|
esac
|