diff --git a/.config/sway/bin/status.sh b/.config/sway/bin/status.sh new file mode 100755 index 0000000..31785ad --- /dev/null +++ b/.config/sway/bin/status.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +printf "{\"version\":1}\n" +printf "[\n" +while true +do + printf [ + printf "{\"full_text\":\"%s\"},"\ + "$(swaymsg -t get_inputs | jq -Mcj ' + [.[] + | select(.type == "keyboard")][0] + | .xkb_active_layout_name')"\ + "$(cat /sys/class/power_supply/BAT0/capacity)"\ + "$(date +%c)" + printf ], + timeout 1 swaymsg -t subscribe '["input"]' >/dev/null +done + diff --git a/.config/sway/config b/.config/sway/config index 986710a..ba57225 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -16,12 +16,29 @@ bindsym $mod+w exec firefox bindsym $mod+shift+w exec thunderbird # start menu bindsym $mod+space exec fuzzel -bindsym $mod+home exec footclient nmtui -bindsym $mod+o exec fuzzel_do.sh +bindsym $mod+home exec nmcli -g "type,name,active" connection show \ + | awk -P 'BEGIN{FS=":"}{printf($3=="yes")?"* %s\\n":" %s\\n",$2}' \ + | fuzzel -d \ + | awk -P '{printf($1=="*")?"nmcli connection down \\"%s\\"":"nmcli connection up \\"%s\\"",substr($0,3)}' \ + | sh \ + | xargs -tI{} notify-send "{}" +bindsym $mod+shift+home exec footclient nmtui +bindsym $mod+o exec find -not -path "*/.*" \ + | fuzzel -d \ + | xargs -I{} xdg-open "{}" +bindsym $mod+shift+o exec find -L -type d \ + | fuzzel -d \ + | xargs -I{} footclient -D "{}" +bindsym $mod+insert exec lsblk -nrpo"name,type,mountpoint" \ + | awk -P '$2=="part"{printf"%-12s %s\\n",$1,$3}' \ + | fuzzel -d \ + | awk -P '{printf($2=="")?"udisksctl mount -b %s":"udisksctl unmount -b %s",$1}' \ + | sh \ + | xargs -I{} notify-send "{}" # notifications bindsym $mod+x exec makoctl dismiss bindsym $mod+shift+x exec makoctl dismiss -a -bindsym $mod+z exec makoctl restore +bindsym --to-code $mod+z exec makoctl restore # kill window bindsym $mod+q kill # move focus @@ -75,32 +92,32 @@ bindsym $mod+f fullscreen toggle bindsym $mod+shift+f floating toggle bindsym $mod+g focus mode_toggle bindsym $mod+shift+g sticky toggle -bindsym $mod+period move scratchpad -bindsym $mod+shift+period scratchpad show +bindsym $mod+period scratchpad show +bindsym $mod+shift+period move scratchpad # mouse floating_modifier $mod normal # laptop bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+;\ - exec notify-send -e -t 1000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" + exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-;\ - exec notify-send -e -t 1000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" + exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle;\ - exec notify-send -e -t 1000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" + exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" bindsym XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle;\ - exec notify-send -e -t 1000 -h string:x-canonical-private-synchronous:audio_source "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)" + exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_source "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)" bindsym XF86MonBrightnessUp exec brightnessctl set "+1%";\ - exec notify-send -e -t 1000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" + exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" bindsym XF86MonBrightnessDown exec brightnessctl set "1%-";\ - exec notify-send -e -t 1000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" + exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" bindsym shift+XF86MonBrightnessUp exec brightnessctl set "+10%";\ - exec notify-send -e -t 1000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" + exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" bindsym shift+XF86MonBrightnessDown exec brightnessctl set "10%-";\ - exec notify-send -e -t 1000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" + exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" # screenshots bindsym print exec grim - | wl-copy # mark mode #################################################################### -set $mark_mode "mark" +set $mark_mode "mark [abc]" mode $mark_mode { bindsym a mark --toggle a, mode default bindsym b mark --toggle b, mode default @@ -113,7 +130,7 @@ mode $mark_mode { bindsym $mod+m mode $mark_mode # tab mode ##################################################################### -set $tab_mode "tab" +set $tab_mode "tab [abc]" mode $tab_mode { bindsym a [con_mark="a"] focus, mode default bindsym b [con_mark="b"] focus, mode default @@ -151,6 +168,9 @@ output * { adaptive_sync on } +# font +font monospace 13 + # border default_border normal 1 default_floating_border normal 1 @@ -168,8 +188,7 @@ focus_wrapping yes # statusbar #################################################################### bar { - # status_command ~/src/swaystatus/build/swaystatus - status_command statusline.sh + status_command ~/.config/sway/bin/status.sh separator_symbol " | " colors { background $bg