From 6baf09b0683e6edfb4a87592930c0873c0c3d21b Mon Sep 17 00:00:00 2001 From: Konstantin Koslowski Date: Mon, 12 Jul 2021 23:39:19 +0200 Subject: [PATCH] sway: replace exit prompt with wofi menu --- bin/sway_exit | 4 ++++ config | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100755 bin/sway_exit diff --git a/bin/sway_exit b/bin/sway_exit new file mode 100755 index 0000000..04b5cfc --- /dev/null +++ b/bin/sway_exit @@ -0,0 +1,4 @@ +#!/bin/bash +export PATH=$PATH:$HOME/.config/sway/bin +bash -c "$(echo -e 'sway_lock lock\nsystemctl suspend\nswaymsg reload\nswaymsg exit' | \ + wofi --dmenu --prompt 'exit menu')" diff --git a/config b/config index 1720020..7321a12 100644 --- a/config +++ b/config @@ -28,6 +28,7 @@ set $font Cascadia Code PL Regular 10 # Your preferred application launcher set $menu wofi --show drun --prompt applications set $search_cmd $HOME/.config/sway/bin/sway_search +set $exit_cmd $HOME/.config/sway/bin/sway_exit # # Host Specific @@ -102,12 +103,9 @@ bindsym $mod+Shift+r exec $search_cmd # mouse button for dragging. floating_modifier $mod normal -# Reload the configuration file -bindsym $mod+Ctrl+r reload +# Show exit menu +bindsym $mod+Shift+e exec $exit_cmd -# Exit sway (logs you out of your Wayland session) -bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' -# # Moving around: # # Move your focus around