diff options
-rw-r--r-- | i3/.i3/config | 12 | ||||
-rwxr-xr-x | i3/bin/suspend-menu | 27 |
2 files changed, 30 insertions, 9 deletions
diff --git a/i3/.i3/config b/i3/.i3/config index 07a12b3..20da59f 100644 --- a/i3/.i3/config +++ b/i3/.i3/config @@ -14,8 +14,9 @@ assign [class="thunderbird"] 2 assign [class="Zotero"] 3 # Menus -bindsym $mod+d exec dmenu_run -i -bindsym $mod+p exec passmenu -i -l 20 +bindsym $mod+d exec dmenu_run -i -fn 'DejaVu Sans' +bindsym $mod+p exec passmenu -i -l 20 -fn 'DejaVu Sans' +bindsym $mod+Shift+S exec suspend-menu # kill focused window bindsym $mod+Shift+Q kill @@ -103,13 +104,6 @@ bindsym $mod+Shift+8 move container to workspace 8 bindsym $mod+Shift+9 move container to workspace 9 bindsym $mod+Shift+0 move container to workspace 10 -# reload; restart in-place; exit and shutdown -bindsym $mod+Shift+C reload -bindsym $mod+Shift+R exec "i3-nagbar -f 'pango:DejaVu Sans' -t warning -m 'You pressed the restart shortcut (Mod-Shift-R). Do you really want to restart i3?' -B 'Yes, restart i3' 'i3-msg restart'" -bindsym $mod+Shift+E exec "i3-nagbar -f 'pango:DejaVu Sans' -t warning -m 'You pressed the exit shortcut (Mod-Shift-E). Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" -bindsym $mod+Shift+S exec "i3-nagbar -f 'pango:DejaVu Sans' -m 'You pressed the shutdown shortcut (Mod-Shift-S). Do you really want to shutdown?' -B 'Yes, shutdown' 'shutdown now'" -bindsym $mod+Shift+H exec "i3-nagbar -f 'pango:DejaVu Sans' -m 'You pressed the suspend-then-hibernate shortcut (Mod-Shift-H). Do you really want to suspend?' -B 'Yes, suspend' 'systemctl suspend-then-hibernate'" - bindsym $mod+r mode "resize" mode "resize" { bindsym j resize shrink width 1 px or 1 ppt diff --git a/i3/bin/suspend-menu b/i3/bin/suspend-menu new file mode 100755 index 0000000..7b8c802 --- /dev/null +++ b/i3/bin/suspend-menu @@ -0,0 +1,27 @@ +#!/bin/bash + +print_options () { + cat <<EOF +suspend +reboot +shutdown +reload i3 configuration in-place +restart i3 +exit i3 +EOF +} + +# Colors from i3-nagbar: https://github.com/i3/i3/blob/a5da4d54f315e830e2a901b8e75ae7e478401c6e/i3-nagbar/main.c#L492-L496 +CHOICE="$(print_options | dmenu -i -fn 'DejaVu Sans' -nb '#900000' -nf white -sb '#680a0a' -sf white)" + +case "$CHOICE" in + suspend) systemctl suspend ;; + reboot) systemctl reboot ;; + shutdown) shutdown now ;; + "reload i3 configuration in-place") i3-msg reload ;; + "restart i3") i3-msg restart ;; + "exit i3") i3-msg exit ;; + *) + exit 1 + ;; +esac |