feat: add Escape bind to close opened eww widgets

This commit is contained in:
matt1432 2023-05-29 22:21:01 -04:00
parent 99464bed6e
commit 7f4bf28974
4 changed files with 24 additions and 4 deletions

View file

@ -28,7 +28,7 @@
.cal-box {
font-family: Product Sans;
background-color: $bg;
border-radius: 4px;
border-radius: 15px;
padding: 0 1rem .2rem;
color: $fg;
background-color: $contrastbg;

13
eww/scripts/esc.sh Normal file
View file

@ -0,0 +1,13 @@
### this is a WIP
while :
do
if [[ $(eww state) ]]; then
read -s -n1 key
case $key in
$'\e') break;
esac
fi
done
eww close-all

View file

@ -143,6 +143,9 @@ dim_inactive_colors.urgent #900000FF
# Logout on closed lid
bindswitch --reload --locked lid:on exec swaylock
# Kill all eww widgets
bindsym Escape exec $scripts/esc.sh
# Kill focused window
bindsym $mod+c kill
@ -161,7 +164,7 @@ dim_inactive_colors.urgent #900000FF
# 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'
bindsym $mod+Shift+e exec "eww open powermenu && eww open powermenu-closer"
bindsym $mod+Shift+e exec "eww open powermenu && eww open closer"
#
# Moving around:
#
@ -208,8 +211,8 @@ dim_inactive_colors.urgent #900000FF
# Workspaces:
#
# Allow switching between workspaces with left and right swipes
bindgesture swipe:right exec $HOME/.config/sway/scripts/gestures.sh prev #workspace prev
bindgesture swipe:left exec $HOME/.config/sway/scripts/gestures.sh next #workspace next
bindgesture swipe:right exec $scripts/gestures.sh prev
bindgesture swipe:left exec $scripts/gestures.sh next
# Switch to workspace
bindsym --no-repeat $mod+z exec "echo 1 > $SOVSOCK"

4
sway/scripts/esc.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
if [[ $(eww state) ]]; then
eww close-all
fi