From bcf7ed158d9781d8231798cffbbbb154cfd01151 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Mon, 8 Feb 2021 19:47:38 +0000 Subject: [PATCH] Changes rofi shutdown script --- bin/.bin/dmenu/rofi-shutdown | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/bin/.bin/dmenu/rofi-shutdown b/bin/.bin/dmenu/rofi-shutdown index 041b56d5..d51cbe59 100755 --- a/bin/.bin/dmenu/rofi-shutdown +++ b/bin/.bin/dmenu/rofi-shutdown @@ -1,13 +1,31 @@ #!/usr/bin/sh +if type -p rofi 2> /dev/null; then + selectcommand="rofi -dmenu -i -theme themes/five.rasi" + shutdown="" + reboot="" + lock="" + suspend="" + logout="" +else + selectcommand="dmenu -i -p 'Option'" + shutdown="Shutdown" + reboot="Reboot" + lock="Lock" + suspend="Suspend" + logout="Logout" +fi + + selection=$( \ - echo -e "Lock\nLogout\nSuspend\nHibernate\nReboot\nShutdown" |\ - rofi -dmenu -i -p 'Option'); + #echo -e "$shutdown\n$reboot\n$lock\n$suspend\n$logout" | $selectcommand + echo -e "$shutdown\n$reboot\n$lock\n$suspend" | $selectcommand + ); echo $selection; sleep .2 case $selection in - Lock) + ) i3exit lock ;; Logout)