From daad6ac8f1238a3111a05d8b2d70f31e1a70da03 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 22 Nov 2020 00:26:40 +0100 Subject: new i3 exit prompt --- i3/config | 14 ++++++-------- scripts/rofi-exit-menu.sh | 29 +++++++++++++++++++++++++++++ xinitrc.d/10-screensaver.sh | 3 +++ 3 files changed, 38 insertions(+), 8 deletions(-) create mode 100755 scripts/rofi-exit-menu.sh diff --git a/i3/config b/i3/config index 066eb2d..fdbed8d 100644 --- a/i3/config +++ b/i3/config @@ -14,7 +14,7 @@ bindsym $mod+Shift+Return exec "termite -t termite_floating" bindsym $mod+o exec "termite -e ranger" #start browser -bindsym $mod+b exec "brave" +bindsym $mod+b exec "firefox" # kill focused window bindsym $mod+Shift+q kill @@ -36,6 +36,11 @@ bindsym $mod+minus [class="KeePassXC"] scratchpad show # notifications bindsym $mod+n exec "kill -s USR1 $(pidof deadd-notification-center)" +bindsym $mod+Shift+c reload +bindsym $mod+Shift+r restart + +bindsym $mod+Shift+e exec "rofi -show fb -modi fb:rofi-exit-menu.sh" + # Applications for_window [class="KeePassXC" title="^.*KeePassXC$"] move scratchpad @@ -133,13 +138,6 @@ bindsym $mod+Shift+8 move container to workspace $ws8 bindsym $mod+Shift+9 move container to workspace $ws9 bindsym $mod+Shift+0 move container to workspace $ws10 -# reload the configuration file -bindsym $mod+Shift+c reload -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart -# exit i3 (logs you out of your X session) -#bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" -bindsym $mod+Shift+e exec $(printf "shutdown now\nreboot\ni3-msg exit\nkillall compton" | rofi -dmenu -mesg "Exit?") # resize window (you can also use the mouse for that) mode "resize" { diff --git a/scripts/rofi-exit-menu.sh b/scripts/rofi-exit-menu.sh new file mode 100755 index 0000000..57ce492 --- /dev/null +++ b/scripts/rofi-exit-menu.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +function options() { + cat << EOF +supspend +shutdown +reboot +Xit +EOF +} + +if [ $# -gt 0 ]; then + case "$@" in + suspend) + systemctl suspend;; + shutdown) + systemctl shutdown;; + reboot) + systemctl reboot;; + "exit i3") + i3-msg exit;; + *) + options;; + + esac +else + options +fi + diff --git a/xinitrc.d/10-screensaver.sh b/xinitrc.d/10-screensaver.sh index 91c853e..28e6cd2 100755 --- a/xinitrc.d/10-screensaver.sh +++ b/xinitrc.d/10-screensaver.sh @@ -6,3 +6,6 @@ setterm -blank 0 -powerdown 0 # turn off black Screensaver xset s off + +export XSECURELOCK_PASSWORD_PROMPT=kaomoji +xss-lock -- xsecurelock & -- cgit v1.2.3