From 1701752b32681f557b4fbc95f4a89f37c6375026 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Mon, 17 Jun 2019 21:07:14 -0400 Subject: [PATCH] Added Power Menu. --- rofi/desktop/Power.desktop | 2 +- rofi/scripts/power_menu | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 rofi/scripts/power_menu diff --git a/rofi/desktop/Power.desktop b/rofi/desktop/Power.desktop index e4cab04..a6d41da 100755 --- a/rofi/desktop/Power.desktop +++ b/rofi/desktop/Power.desktop @@ -3,5 +3,5 @@ Type=Application Version=1.0 Name=Power -Exec=sh ~/.config/rofi/scripts/media_controls +Exec=sh ~/.config/rofi/scripts/power_menu Terminal=false diff --git a/rofi/scripts/power_menu b/rofi/scripts/power_menu new file mode 100755 index 0000000..c1c673d --- /dev/null +++ b/rofi/scripts/power_menu @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +OPTIONS=" Lock +鈴 Sleep + Logout + Poweroff +淚 Restart" + +SELECTED="$( +rofi -dmenu \ + -theme applet \ + -p "System" \ + -i \ + -line-padding 4 <<< $OPTIONS +)" + +echo $SELECTED + +case $SELECTED in + *Lock) + swaylock-fancy ;; + *Sleep) + systemctl hibernate ;; + *Logout) + swaymsg exit ;; + *Poweroff) + systemctl poweroff ;; + *Restart) + systemctl reboot ;; + *) + echo $SELCTED ;; +esac +