1
0
Fork 0

sway: formatting

main
urosm 2024-09-13 20:35:39 +02:00
parent a0b6f992d1
commit c2a73d46ec
1 changed files with 167 additions and 140 deletions

View File

@ -1,23 +1,23 @@
# set ########################################################################## # set ##########################################################################
# keys # keys
set $mod mod4 set $mod mod4
set $left h set $left h
set $down j set $down j
set $up k set $up k
set $right l set $right l
# colors # colors
set $black #000000 set $black #000000
set $white #e2e2e2 set $white #e2e2e2
set $blue #856cff set $blue #856cff
set $magenta #ff1170 set $magenta #ff1170
set $red #fa3500 set $red #fa3500
set $orange #d06600 set $orange #d06600
set $green #009843 set $green #009843
# workspaces # workspaces
set $wsq 0:q:cmd set $wsq 0:q:bot
set $wsw 1:w:www set $wsw 1:w:www
set $wse 2:e:txt set $wse 2:e:txt
set $wsr 3:r:doc set $wsr 3:r:doc
@ -26,48 +26,44 @@ set $wsy 5:y:cmd
set $wsu 6:u:cmd set $wsu 6:u:cmd
set $wsi 7:i:cmd set $wsi 7:i:cmd
set $wso 8:o:cmd set $wso 8:o:cmd
set $wsp 9:p:rdp set $wsp 9:p:top
# modes # modes
set $session_mode "session: (r)eload (l)ock (q)uit (s)uspend (h)ibernate re(b)oot (p)oweroff" 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 \) set $find_exclude_expr \( -path "$HOME/.cache" -o -path "$HOME/.mozilla" -o -path "$HOME/.thunderbird" -o -name .git \)
# commands # commands
set $swaylock swaylock -f \ set $swaylock swaylock -f \
--color=$black \ --color=$black \
--indicator-radius 1200 \ --indicator-radius 1200 \
--inside-color=$blue \ --inside-color=$blue \
--inside-clear-color=$green \ --inside-clear-color=$green \
--inside-caps-lock-color=$orange \ --inside-caps-lock-color=$orange \
--inside-ver-color=$magenta \ --inside-ver-color=$magenta \
--inside-wrong-color=$red \ --inside-wrong-color=$red \
--text-color=#00000000 \ --text-color=#00000000 \
--text-clear-color=#00000000 \ --text-clear-color=#00000000 \
--text-ver-color=#00000000 \ --text-ver-color=#00000000 \
--text-wrong-color=#00000000 --text-wrong-color=#00000000
# strings
set $mounted "Mounted %f at %d"
set $unmounted "Unmounted %s"
# bar ########################################################################## # bar ##########################################################################
bar { bar {
separator_symbol " | " separator_symbol " | "
status_command status.sh status_command status.sh
strip_workspace_numbers yes strip_workspace_numbers yes
wrap_scroll yes wrap_scroll yes
colors { colors {
background $black background $black
statusline $blue statusline $blue
separator $blue separator $blue
# border background text # border background text
focused_workspace $black $black $magenta focused_workspace $black $black $magenta
active_workspace $black $black $white active_workspace $black $black $white
inactive_workspace $black $black $blue inactive_workspace $black $black $blue
urgent_workspace $black $black $red urgent_workspace $black $black $red
} }
} }
# workspace_layout ############################################################# # workspace_layout #############################################################
@ -82,44 +78,77 @@ bindsym $mod+shift+f floating toggle
# focus # focus
bindsym { bindsym {
$mod+$up focus up $mod+$up focus up
$mod+$down focus down $mod+$down focus down
$mod+$left focus left $mod+$left focus left
$mod+$right focus right $mod+$right focus right
$mod+a focus parent $mod+a focus parent
$mod+s focus child $mod+s focus child
$mod+g focus mode_toggle $mod+g focus mode_toggle
} }
# fullscreen # fullscreen
bindsym $mod+f fullscreen toggle 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 # mode
bindsym { bindsym {
$mod+d mode $layout_mode, fullscreen disable $mod+d mode $layout_mode, fullscreen disable
$mod+escape mode $session_mode, fullscreen disable $mod+escape mode $session_mode, fullscreen disable
} }
# move # move
bindsym --to-code { bindsym --to-code {
$mod+shift+$up move up $mod+shift+$up move up
$mod+shift+$down move down $mod+shift+$down move down
$mod+shift+$left move left $mod+shift+$left move left
$mod+shift+$right move right $mod+shift+$right move right
$mod+shift+tab move workspace back_and_forth, workspace back_and_forth $mod+shift+tab move workspace back_and_forth, workspace back_and_forth
$mod+shift+q move workspace $wsq, workspace $wsq $mod+shift+q move workspace $wsq, workspace $wsq
$mod+shift+w move workspace $wsw, workspace $wsw $mod+shift+w move workspace $wsw, workspace $wsw
$mod+shift+e move workspace $wse, workspace $wse $mod+shift+e move workspace $wse, workspace $wse
$mod+shift+r move workspace $wsr, workspace $wsr $mod+shift+r move workspace $wsr, workspace $wsr
$mod+shift+t move workspace $wst, workspace $wst $mod+shift+t move workspace $wst, workspace $wst
$mod+shift+y move workspace $wsy, workspace $wsy $mod+shift+y move workspace $wsy, workspace $wsy
$mod+shift+u move workspace $wsu, workspace $wsu $mod+shift+u move workspace $wsu, workspace $wsu
$mod+shift+i move workspace $wsi, workspace $wsi $mod+shift+i move workspace $wsi, workspace $wsi
$mod+shift+o move workspace $wso, workspace $wso $mod+shift+o move workspace $wso, workspace $wso
$mod+shift+p move workspace $wsp, workspace $wsp $mod+shift+p move workspace $wsp, workspace $wsp
$mod+shift+bracketleft move workspace prev, workspace prev $mod+shift+bracketleft move workspace prev, workspace prev
$mod+shift+bracketright move workspace next, workspace next $mod+shift+bracketright move workspace next, workspace next
$mod+colon move scratchpad $mod+colon move scratchpad
} }
# scratchpad # scratchpad
@ -130,54 +159,54 @@ bindsym $mod+shift+g sticky toggle
# exec # exec
bindsym --to-code { bindsym --to-code {
$mod+return exec footclient $mod+return exec "$TERMINAL"
$mod+space exec fuzzel $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+slash exec find "$HOME" $find_exclude_expr -prune -o -print | fuzzel -dp'open > ' | xargs -r xdg-open $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+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+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) # exec (laptop)
bindsym { 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@)" 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@)" 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@)" 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@)" 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)" 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)" 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+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)" shift+XF86MonBrightnessDown exec brightnessctl -n set 10%-, exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
} }
# resize # resize
bindsym { bindsym {
$mod+control+$left resize shrink width $mod+control+$left resize shrink width
$mod+control+$down resize grow height $mod+control+$down resize grow height
$mod+control+$up resize shrink height $mod+control+$up resize shrink height
$mod+control+$right resize grow width $mod+control+$right resize grow width
} }
# workspace # workspace
bindsym --to-code { bindsym --to-code {
$mod+tab workspace back_and_forth $mod+tab workspace back_and_forth
$mod+q workspace $wsq $mod+q workspace $wsq
$mod+w workspace $wsw $mod+w workspace $wsw
$mod+e workspace $wse $mod+e workspace $wse
$mod+r workspace $wsr $mod+r workspace $wsr
$mod+t workspace $wst $mod+t workspace $wst
$mod+y workspace $wsy $mod+y workspace $wsy
$mod+u workspace $wsu $mod+u workspace $wsu
$mod+i workspace $wsi $mod+i workspace $wsi
$mod+o workspace $wso $mod+o workspace $wso
$mod+p workspace $wsp $mod+p workspace $wsp
$mod+bracketleft workspace prev $mod+bracketleft workspace prev
$mod+bracketright workspace next $mod+bracketright workspace next
} }
# client.* ##################################################################### # client.* #####################################################################
@ -195,23 +224,23 @@ default_floating_border normal 0
# exec ######################################################################### # exec #########################################################################
exec { exec {
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
hash dbus-update-activation-environment 2>/dev/null && \ hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway
swayidle -w \ swayidle -w \
timeout 300 'brightnessctl -s set 1%' resume 'brightnessctl -r' \ timeout 300 'brightnessctl -s set 1%' resume 'brightnessctl -r' \
timeout 600 '$swaylock' \ timeout 600 '$swaylock' \
timeout 900 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \ timeout 900 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
timeout 1800 'systemctl suspend-then-hibernate' \ timeout 1800 'systemctl suspend-then-hibernate' \
before-sleep '$swaylock' before-sleep '$swaylock'
wlsunset -l 45 -L 15 wlsunset -l 45 -L 15
mako --max-visible=0 mako --max-visible=0
devmon \ devmon --exec-on-drive 'notify-send "Mounted %f at %d"' --exec-on-unmount 'notify-send "Unmounted %f"'
--exec-on-drive 'notify-send "Mounted %f at %d"' \ foot -s
--exec-on-unmount 'notify-send "Unmounted %f"' wayneko --layer overlay --type inu --background-colour 0xe2e2e2 --outline-colour 0x856cff
foot -s
} }
# focus_wrapping ############################################################### # focus_wrapping ###############################################################
focus_wrapping yes focus_wrapping yes
@ -222,42 +251,40 @@ font monospace 13
# keyboard # keyboard
input "type:keyboard" { input "type:keyboard" {
xkb_layout us,si xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle,compose:ralt xkb_options caps:escape,grp:alt_shift_toggle,compose:ralt
repeat_delay 200 repeat_delay 200
repeat_rate 30 repeat_rate 30
} }
# touchpad # touchpad
input "type:touchpad" { input "type:touchpad" tap enabled
tap enabled
}
# mode ######################################################################### # mode #########################################################################
# session # session
mode $session_mode { mode $session_mode {
bindsym { bindsym {
r reload, mode default r reload, mode default
l exec $swaylock, mode default l exec $swaylock, mode default
q exit, mode default q exit, mode default
s exec systemctl suspend, mode default s exec systemctl suspend, mode default
h exec systemctl hibernate, mode default h exec systemctl hibernate, mode default
b exec systemctl reboot, mode default b exec systemctl reboot, mode default
p exec systemctl poweroff, mode default p exec systemctl poweroff, mode default
escape mode default escape mode default
} }
} }
# layout # layout
mode $layout_mode { mode $layout_mode {
bindsym { bindsym {
h layout splith, mode default h layout splith, mode default
v layout splitv, mode default v layout splitv, mode default
s layout stacking, mode default s layout stacking, mode default
t layout tabbed, mode default t layout tabbed, mode default
escape mode default escape mode default
} }
} }
# seat ######################################################################### # seat #########################################################################