diff options
author | Yigit Sever | 2019-04-05 13:29:23 +0300 |
---|---|---|
committer | Yigit Sever | 2019-04-05 13:29:23 +0300 |
commit | d13c3a6e87f8fc23e6fb6e92d5d773f1cf9ad7be (patch) | |
tree | 67a21438d320277f0192b0e64b61fdc291100481 | |
parent | 6256a7a016f86c73894c49053cbd19a09759b594 (diff) | |
download | dotfiles-d13c3a6e87f8fc23e6fb6e92d5d773f1cf9ad7be.tar.gz dotfiles-d13c3a6e87f8fc23e6fb6e92d5d773f1cf9ad7be.tar.bz2 dotfiles-d13c3a6e87f8fc23e6fb6e92d5d773f1cf9ad7be.zip |
Alternate shutdown method using rofi -dmenu
-rw-r--r-- | .config/i3/config##desktop.Linux.Lowe | 1 | ||||
-rwxr-xr-x | bin/power.sh | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/.config/i3/config##desktop.Linux.Lowe b/.config/i3/config##desktop.Linux.Lowe index 77f917c..fd1d432 100644 --- a/.config/i3/config##desktop.Linux.Lowe +++ b/.config/i3/config##desktop.Linux.Lowe | |||
@@ -172,6 +172,7 @@ mode " (L)ock (S)ignout (R)eboot (P)oweroff" { | |||
172 | bindcode 66 mode "default" | 172 | bindcode 66 mode "default" |
173 | } | 173 | } |
174 | bindsym $mod+Shift+e mode " (L)ock (S)ignout (R)eboot (P)oweroff" | 174 | bindsym $mod+Shift+e mode " (L)ock (S)ignout (R)eboot (P)oweroff" |
175 | bindsym $mod+Shift+Escape exec --no-startup-id ~/bin/power.sh | ||
175 | 176 | ||
176 | bindsym $mod+r mode "resize" | 177 | bindsym $mod+r mode "resize" |
177 | 178 | ||
diff --git a/bin/power.sh b/bin/power.sh new file mode 100755 index 0000000..02051f1 --- /dev/null +++ b/bin/power.sh | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # Simple script to handle a DIY shutdown menu. When run you should see a bunch of options (shutdown, reboot etc.) | ||
4 | # | ||
5 | # Requirements: | ||
6 | # - rofi | ||
7 | # - systemd, but you can replace the commands for OpenRC or anything else | ||
8 | # | ||
9 | # Instructions: | ||
10 | # - Save this file as power.sh or anything | ||
11 | # - Give it exec priviledge, or chmod +x /path/to/power.sh | ||
12 | # - Run it | ||
13 | |||
14 | chosen=$(echo -e "lock\nshutdown\nrestart" | rofi -dmenu -i) | ||
15 | # Info about some states are available here: | ||
16 | # https://www.freedesktop.org/software/systemd/man/systemd-sleep.conf.html#Description | ||
17 | |||
18 | if [[ $chosen = "lock" ]]; then | ||
19 | betterlockscreen -l dimblur -t "Welcome back" | ||
20 | elif [[ $chosen = "shutdown" ]]; then | ||
21 | systemctl poweroff | ||
22 | elif [[ $chosen = "restart" ]]; then | ||
23 | systemctl reboot | ||
24 | fi | ||