From c2a73d46ec99842d5f97266f5d65963b0db17d0b Mon Sep 17 00:00:00 2001 From: urosm Date: Fri, 13 Sep 2024 20:35:39 +0200 Subject: [PATCH] sway: formatting --- .config/sway/config | 307 ++++++++++++++++++++++++-------------------- 1 file changed, 167 insertions(+), 140 deletions(-) diff --git a/.config/sway/config b/.config/sway/config index 7e0373f..6737fb4 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -1,23 +1,23 @@ # set ########################################################################## # keys -set $mod mod4 -set $left h -set $down j -set $up k +set $mod mod4 +set $left h +set $down j +set $up k set $right l # colors -set $black #000000 -set $white #e2e2e2 -set $blue #856cff +set $black #000000 +set $white #e2e2e2 +set $blue #856cff set $magenta #ff1170 -set $red #fa3500 -set $orange #d06600 -set $green #009843 +set $red #fa3500 +set $orange #d06600 +set $green #009843 # workspaces -set $wsq 0:q:cmd +set $wsq 0:q:bot set $wsw 1:w:www set $wse 2:e:txt set $wsr 3:r:doc @@ -26,48 +26,44 @@ set $wsy 5:y:cmd set $wsu 6:u:cmd set $wsi 7:i:cmd set $wso 8:o:cmd -set $wsp 9:p:rdp +set $wsp 9:p:top # modes set $session_mode "session: (r)eload (l)ock (q)uit (s)uspend (h)ibernate re(b)oot (p)oweroff" -set $layout_mode "layout: split(h) split(v) (s)tacking (t)abbed" +set $layout_mode "layout: split(h) split(v) (s)tacking (t)abbed" set $find_exclude_expr \( -path "$HOME/.cache" -o -path "$HOME/.mozilla" -o -path "$HOME/.thunderbird" -o -name .git \) # commands set $swaylock swaylock -f \ - --color=$black \ - --indicator-radius 1200 \ - --inside-color=$blue \ - --inside-clear-color=$green \ - --inside-caps-lock-color=$orange \ - --inside-ver-color=$magenta \ - --inside-wrong-color=$red \ - --text-color=#00000000 \ - --text-clear-color=#00000000 \ - --text-ver-color=#00000000 \ - --text-wrong-color=#00000000 - -# strings -set $mounted "Mounted %f at %d" -set $unmounted "Unmounted %s" + --color=$black \ + --indicator-radius 1200 \ + --inside-color=$blue \ + --inside-clear-color=$green \ + --inside-caps-lock-color=$orange \ + --inside-ver-color=$magenta \ + --inside-wrong-color=$red \ + --text-color=#00000000 \ + --text-clear-color=#00000000 \ + --text-ver-color=#00000000 \ + --text-wrong-color=#00000000 # bar ########################################################################## bar { - separator_symbol " | " - status_command status.sh - strip_workspace_numbers yes - wrap_scroll yes - colors { - background $black - statusline $blue - separator $blue - # border background text - focused_workspace $black $black $magenta - active_workspace $black $black $white - inactive_workspace $black $black $blue - urgent_workspace $black $black $red - } + separator_symbol " | " + status_command status.sh + strip_workspace_numbers yes + wrap_scroll yes + colors { + background $black + statusline $blue + separator $blue + # border background text + focused_workspace $black $black $magenta + active_workspace $black $black $white + inactive_workspace $black $black $blue + urgent_workspace $black $black $red + } } # workspace_layout ############################################################# @@ -82,44 +78,77 @@ bindsym $mod+shift+f floating toggle # focus bindsym { - $mod+$up focus up - $mod+$down focus down - $mod+$left focus left - $mod+$right focus right - $mod+a focus parent - $mod+s focus child - $mod+g focus mode_toggle + $mod+$up focus up + $mod+$down focus down + $mod+$left focus left + $mod+$right focus right + $mod+a focus parent + $mod+s focus child + $mod+g focus mode_toggle } # fullscreen bindsym $mod+f fullscreen toggle +# mark +bindsym { + $mod+shift+grave mark --toggle '`' + $mod+shift+1 mark --toggle '1' + $mod+shift+2 mark --toggle '2' + $mod+shift+3 mark --toggle '3' + $mod+shift+4 mark --toggle '4' + $mod+shift+5 mark --toggle '5' + $mod+shift+6 mark --toggle '6' + $mod+shift+7 mark --toggle '7' + $mod+shift+8 mark --toggle '8' + $mod+shift+9 mark --toggle '9' + $mod+shift+0 mark --toggle '0' + $mod+shift+minus mark --toggle '-' + $mod+shift+equal mark --toggle '=' +} + +bindsym { + $mod++grave [con_mark="`"] focus + $mod++1 [con_mark="1"] focus + $mod++2 [con_mark="2"] focus + $mod++3 [con_mark="3"] focus + $mod++4 [con_mark="4"] focus + $mod++5 [con_mark="5"] focus + $mod++6 [con_mark="6"] focus + $mod++7 [con_mark="7"] focus + $mod++8 [con_mark="8"] focus + $mod++9 [con_mark="9"] focus + $mod++0 [con_mark="0"] focus + $mod++minus [con_mark="-"] focus + $mod++equal [con_mark="="] focus +} + # mode bindsym { - $mod+d mode $layout_mode, fullscreen disable - $mod+escape mode $session_mode, fullscreen disable + $mod+d mode $layout_mode, fullscreen disable + $mod+escape mode $session_mode, fullscreen disable } # move bindsym --to-code { - $mod+shift+$up move up - $mod+shift+$down move down - $mod+shift+$left move left - $mod+shift+$right move right - $mod+shift+tab move workspace back_and_forth, workspace back_and_forth - $mod+shift+q move workspace $wsq, workspace $wsq - $mod+shift+w move workspace $wsw, workspace $wsw - $mod+shift+e move workspace $wse, workspace $wse - $mod+shift+r move workspace $wsr, workspace $wsr - $mod+shift+t move workspace $wst, workspace $wst - $mod+shift+y move workspace $wsy, workspace $wsy - $mod+shift+u move workspace $wsu, workspace $wsu - $mod+shift+i move workspace $wsi, workspace $wsi - $mod+shift+o move workspace $wso, workspace $wso - $mod+shift+p move workspace $wsp, workspace $wsp - $mod+shift+bracketleft move workspace prev, workspace prev + $mod+shift+$up move up + $mod+shift+$down move down + $mod+shift+$left move left + $mod+shift+$right move right + $mod+shift+tab move workspace back_and_forth, workspace back_and_forth + $mod+shift+q move workspace $wsq, workspace $wsq + $mod+shift+w move workspace $wsw, workspace $wsw + $mod+shift+e move workspace $wse, workspace $wse + $mod+shift+r move workspace $wsr, workspace $wsr + $mod+shift+t move workspace $wst, workspace $wst + $mod+shift+y move workspace $wsy, workspace $wsy + $mod+shift+u move workspace $wsu, workspace $wsu + $mod+shift+i move workspace $wsi, workspace $wsi + $mod+shift+o move workspace $wso, workspace $wso + $mod+shift+p move workspace $wsp, workspace $wsp + $mod+shift+bracketleft move workspace prev, workspace prev $mod+shift+bracketright move workspace next, workspace next - $mod+colon move scratchpad + $mod+colon move scratchpad } # scratchpad @@ -130,54 +159,54 @@ bindsym $mod+shift+g sticky toggle # exec bindsym --to-code { - $mod+return exec footclient - $mod+space exec fuzzel - $mod+home exec footclient nmtui connect - $mod+shift+home exec footclient nmtui - $mod+end exec devmon -c - $mod+n exec makoctl dismiss - $mod+shift+n exec makoctl restore - print exec grim - | wl-copy + $mod+return exec "$TERMINAL" + $mod+space exec fuzzel $mod+slash exec find "$HOME" $find_exclude_expr -prune -o -print | fuzzel -dp'open > ' | xargs -r xdg-open $mod+question exec find "$HOME" $find_exclude_expr -prune -o -type f -print0 | xargs -0r grep -in "$(wl-paste)" 2>/dev/null | awk -F: '{ printf("%8s %-62s\t%-80s\\n","+"$2,"\\""$1"\\"",$3) }' | fuzzel -dw160 -p"open > " | cut -f1 | xargs -r "$TERMINAL" "$EDITOR" $mod+apostrophe exec swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.nodes==[] and .type=="con" and .focused==false) | (.id|tostring) + "\t" + .name' | fuzzel -dp'focus > ' | cut -f1 | xargs -rI{} swaymsg [con_id={}] focus + $mod+home exec "$TERMINAL" nmtui connect + $mod+shift+home exec "$TERMINAL" nmtui + $mod+end exec devmon -c + $mod+n exec makoctl dismiss + $mod+shift+n exec makoctl restore + print exec grim - | wl-copy } # exec (laptop) bindsym { - XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" - XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" - XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" - XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)" - XF86MonBrightnessUp exec brightnessctl -n set +1%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" - XF86MonBrightnessDown exec brightnessctl -n set 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" - shift+XF86MonBrightnessUp exec brightnessctl -n set +10%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" - shift+XF86MonBrightnessDown exec brightnessctl -n set 10%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" + XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" + XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" + XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" + XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)" + XF86MonBrightnessUp exec brightnessctl -n set +1%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" + XF86MonBrightnessDown exec brightnessctl -n set 1%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" + shift+XF86MonBrightnessUp exec brightnessctl -n set +10%, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" + shift+XF86MonBrightnessDown exec brightnessctl -n set 10%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)" } # resize bindsym { - $mod+control+$left resize shrink width - $mod+control+$down resize grow height - $mod+control+$up resize shrink height - $mod+control+$right resize grow width + $mod+control+$left resize shrink width + $mod+control+$down resize grow height + $mod+control+$up resize shrink height + $mod+control+$right resize grow width } # workspace bindsym --to-code { - $mod+tab workspace back_and_forth - $mod+q workspace $wsq - $mod+w workspace $wsw - $mod+e workspace $wse - $mod+r workspace $wsr - $mod+t workspace $wst - $mod+y workspace $wsy - $mod+u workspace $wsu - $mod+i workspace $wsi - $mod+o workspace $wso - $mod+p workspace $wsp - $mod+bracketleft workspace prev - $mod+bracketright workspace next + $mod+tab workspace back_and_forth + $mod+q workspace $wsq + $mod+w workspace $wsw + $mod+e workspace $wse + $mod+r workspace $wsr + $mod+t workspace $wst + $mod+y workspace $wsy + $mod+u workspace $wsu + $mod+i workspace $wsi + $mod+o workspace $wso + $mod+p workspace $wsp + $mod+bracketleft workspace prev + $mod+bracketright workspace next } # client.* ##################################################################### @@ -195,23 +224,23 @@ default_floating_border normal 0 # exec ######################################################################### exec { - systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK - hash dbus-update-activation-environment 2>/dev/null && \ - dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK - swayidle -w \ - timeout 300 'brightnessctl -s set 1%' resume 'brightnessctl -r' \ - timeout 600 '$swaylock' \ - timeout 900 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ - timeout 1800 'systemctl suspend-then-hibernate' \ - before-sleep '$swaylock' - wlsunset -l 45 -L 15 - mako --max-visible=0 - devmon \ - --exec-on-drive 'notify-send "Mounted %f at %d"' \ - --exec-on-unmount 'notify-send "Unmounted %f"' - foot -s + systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP + hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway + swayidle -w \ + timeout 300 'brightnessctl -s set 1%' resume 'brightnessctl -r' \ + timeout 600 '$swaylock' \ + timeout 900 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ + timeout 1800 'systemctl suspend-then-hibernate' \ + before-sleep '$swaylock' + wlsunset -l 45 -L 15 + mako --max-visible=0 + devmon --exec-on-drive 'notify-send "Mounted %f at %d"' --exec-on-unmount 'notify-send "Unmounted %f"' + foot -s + wayneko --layer overlay --type inu --background-colour 0xe2e2e2 --outline-colour 0x856cff } + # focus_wrapping ############################################################### focus_wrapping yes @@ -222,42 +251,40 @@ font monospace 13 # keyboard input "type:keyboard" { - xkb_layout us,si - xkb_options caps:escape,grp:alt_shift_toggle,compose:ralt - repeat_delay 200 - repeat_rate 30 + xkb_layout us,si + xkb_options caps:escape,grp:alt_shift_toggle,compose:ralt + repeat_delay 200 + repeat_rate 30 } # touchpad -input "type:touchpad" { - tap enabled -} +input "type:touchpad" tap enabled # mode ######################################################################### # session mode $session_mode { - bindsym { - r reload, mode default - l exec $swaylock, mode default - q exit, mode default - s exec systemctl suspend, mode default - h exec systemctl hibernate, mode default - b exec systemctl reboot, mode default - p exec systemctl poweroff, mode default - escape mode default - } + bindsym { + r reload, mode default + l exec $swaylock, mode default + q exit, mode default + s exec systemctl suspend, mode default + h exec systemctl hibernate, mode default + b exec systemctl reboot, mode default + p exec systemctl poweroff, mode default + escape mode default + } } # layout mode $layout_mode { - bindsym { - h layout splith, mode default - v layout splitv, mode default - s layout stacking, mode default - t layout tabbed, mode default - escape mode default - } + bindsym { + h layout splith, mode default + v layout splitv, mode default + s layout stacking, mode default + t layout tabbed, mode default + escape mode default + } } # seat #########################################################################