1
0
Fork 0

update `sway` config

urosm 2023-10-08 21:21:41 +02:00
parent 108dde0ed4
commit 9e42e15c4c
3 changed files with 105 additions and 142 deletions

View File

@ -1,81 +1,39 @@
# variables ####################################################################
# logo key # logo key
set $mod Mod4 set $mod Mod4
# home row direction keys # home row direction keys
set $left h set $left h
set $down j set $down j
set $up k set $up k
set $right l set $right l
# apps # key bindings #################################################################
set $term footclient
set $term_float footclient --app-id=foot_float
set $browser firefox
set $email thunderbird
# menus
set $drun fuzzel
set $mountmenu fuzzel_mount.sh
set $findmenu fuzzel_find_and_open.sh
set $wifimenu $term_float nmtui
# colors
set $bg #292526
set $dimmed #6185ff
set $accent #ff3e8b
set $error #ff404f
# TODO: figure out how this is viable
# set $xkb_layout_mode "keyboard layout: (g)b (s)i"
# bindsym alt+shift mode $xkb_layout_mode
#
# mode $xkb_layout_mode {
# bindsym g input "type:keyboard" xkb_layout gb, mode default
# bindsym s input "type:keyboard" xkb_layout si, mode default
# }
seat * hide_cursor 5000
# output
output * bg $bg solid_color
# key bindings
# start terminal # start terminal
bindsym $mod+return exec $term bindsym $mod+return exec footclient
bindsym $mod+shift+return exec $term_float bindsym $mod+shift+return exec foot
bindsym $mod+t exec foot
# start browser # start browser
bindsym $mod+w exec $browser bindsym $mod+w exec firefox
bindsym $mod+shift+w exec $email bindsym $mod+shift+w exec thunderbird
# start menu
# start menus bindsym $mod+space exec fuzzel
bindsym $mod+space exec $drun bindsym $mod+home exec footclient nmtui
bindsym $mod+home exec $wifimenu bindsym $mod+o exec fuzzel_do.sh
bindsym $mod+insert exec $mountmenu
bindsym $mod+e exec $findmenu
# notifications # notifications
bindsym $mod+slash exec notify-send -e -h string:x-canonical-private-synchronous:status "$(date)" "Battery: $(cat /sys/class/power_supply/BAT0/capacity)%"
bindsym $mod+x exec makoctl dismiss bindsym $mod+x exec makoctl dismiss
bindsym $mod+shift+x exec makoctl dismiss -a bindsym $mod+shift+x exec makoctl dismiss -a
bindsym $mod+z exec makoctl restore bindsym $mod+z exec makoctl restore
# kill window # kill window
bindsym $mod+q kill bindsym $mod+q kill
# move focus # move focus
bindsym $mod+$up focus up bindsym $mod+$up focus up
bindsym $mod+$down focus down bindsym $mod+$down focus down
bindsym $mod+$left focus left bindsym $mod+$left focus left
bindsym $mod+$right focus right bindsym $mod+$right focus right
# move focused window # move focused window
bindsym $mod+shift+$up move up bindsym $mod+shift+$up move up
bindsym $mod+shift+$down move down bindsym $mod+shift+$down move down
bindsym $mod+shift+$left move left bindsym $mod+shift+$left move left
bindsym $mod+shift+$right move right bindsym $mod+shift+$right move right
# switch to workspace # switch to workspace
bindsym $mod+1 workspace number 1 bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2 bindsym $mod+2 workspace number 2
@ -89,7 +47,6 @@ bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10 bindsym $mod+0 workspace number 10
bindsym $mod+next workspace next bindsym $mod+next workspace next
bindsym $mod+prior workspace prev bindsym $mod+prior workspace prev
# move focused to workspace # move focused to workspace
bindsym $mod+shift+1 move container to workspace number 1, workspace number 1 bindsym $mod+shift+1 move container to workspace number 1, workspace number 1
bindsym $mod+shift+2 move container to workspace number 2, workspace number 2 bindsym $mod+shift+2 move container to workspace number 2, workspace number 2
@ -103,52 +60,25 @@ bindsym $mod+shift+9 move container to workspace number 9, workspace number 9
bindsym $mod+shift+0 move container to workspace number 10, workspace number 10 bindsym $mod+shift+0 move container to workspace number 10, workspace number 10
bindsym $mod+shift+next move container to workspace next, workspace next bindsym $mod+shift+next move container to workspace next, workspace next
bindsym $mod+shift+prior move container to workspace prev, workspace prev bindsym $mod+shift+prior move container to workspace prev, workspace prev
# resize # resize
set $resize_mode "resize" bindsym $mod+control+$left resize shrink width
bindsym $mod+r mode $resize_mode bindsym $mod+control+$down resize grow height
bindsym $mod+control+$up resize shrink height
mode $resize_mode { bindsym $mod+control+$right resize grow width
bindsym $left resize shrink width
bindsym $down resize grow height
bindsym $up resize shrink height
bindsym $right resize grow width
bindsym $mod+$left resize shrink width 25 px
bindsym $mod+$down resize grow height 25 px
bindsym $mod+$up resize shrink height 25 px
bindsym $mod+$right resize grow width 25 px
bindsym escape mode default
bindsym $mod+escape mode default
bindsym $mod+r mode default
}
# layout # layout
bindsym $mod+a focus parent
bindsym $mod+shift+a focus child
bindsym $mod+s layout toggle split
bindsym $mod+shift+s split toggle
bindsym $mod+d layout toggle tabbed split bindsym $mod+d layout toggle tabbed split
bindsym $mod+f fullscreen toggle bindsym $mod+f fullscreen toggle
bindsym $mod+shift+f floating toggle bindsym $mod+shift+f floating toggle
bindsym $mod+g focus mode_toggle bindsym $mod+g focus mode_toggle
bindsym $mod+shift+g sticky toggle bindsym $mod+shift+g sticky toggle
bindsym $mod+period move scratchpad
# scratchpad
bindsym $mod+period move to scratchpad
bindsym $mod+shift+period scratchpad show bindsym $mod+shift+period scratchpad show
# mouse
# floating floating_modifier $mod normal
for_window [window_type="dialog"] floating enable
for_window [window_type="utility"] floating enable
for_window [window_type="toolbar"] floating enable
for_window [window_type="splash"] floating enable
for_window [window_type="menu"] floating enable
for_window [window_type="dropdown_menu"] floating enable
for_window [window_type="popup_menu"] floating enable
for_window [window_type="tooltip"] floating enable
for_window [window_type="notification"] floating enable
# rules
for_window [title="About Mozilla Firefox"] floating enable
for_window [app_id="foot_float"] floating enable
for_window [app_id="foot"] inhibit_idle focus
# laptop # laptop
bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+;\ 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 1000 -h string:x-canonical-private-synchronous:audio_sink "$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
@ -166,14 +96,36 @@ 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 1000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
bindsym shift+XF86MonBrightnessDown exec brightnessctl set "10%-";\ 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 1000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
# screenshots # screenshots
bindsym print exec grimshot save screen bindsym print exec grim - | wl-copy
# session # mark mode ####################################################################
set $mark_mode "mark"
mode $mark_mode {
bindsym a mark --toggle a, mode default
bindsym b mark --toggle b, mode default
bindsym c mark --toggle c, mode default
bindsym backspace unmark, mode default
# return
bindsym escape mode "default"
bindsym $mod+escape mode "default"
}
bindsym $mod+m mode $mark_mode
# tab mode #####################################################################
set $tab_mode "tab"
mode $tab_mode {
bindsym a [con_mark="a"] focus, mode default
bindsym b [con_mark="b"] focus, mode default
bindsym c [con_mark="c"] focus, mode default
# return
bindsym escape mode "default"
bindsym $mod+escape mode "default"
}
bindsym $mod+tab mode $tab_mode
# session mode #################################################################
set $session_mode "session: (r)eload (l)ock (q)uit (s)uspend re(b)oot (p)oweroff" set $session_mode "session: (r)eload (l)ock (q)uit (s)uspend re(b)oot (p)oweroff"
bindsym $mod+escape mode $session_mode
mode $session_mode { mode $session_mode {
bindsym r reload, mode default bindsym r reload, mode default
bindsym l exec swaylock, mode default bindsym l exec swaylock, mode default
@ -181,34 +133,45 @@ mode $session_mode {
bindsym s exec systemctl suspend, mode default bindsym s exec systemctl suspend, mode default
bindsym b exec systemctl reboot, mode default bindsym b exec systemctl reboot, mode default
bindsym p exec systemctl poweroff, mode default bindsym p exec systemctl poweroff, mode default
# return
bindsym escape mode default bindsym escape mode default
bindsym $mod+escape mode default bindsym $mod+escape mode default
} }
bindsym $mod+escape mode $session_mode
# visuals ######################################################################
set $bg #292526
set $dimmed #6185ff
set $accent #ff3e8b
set $error #ff404f
# output
output * {
background $bg solid_color
adaptive_sync on
}
# border # border
default_border none default_border normal 1
default_floating_border normal 1 default_floating_border normal 1
set $border_mode "border: (n)one (t)itle (p)ixel"
bindsym $mod+b mode $border_mode
mode $border_mode {
bindsym n border none, mode default
bindsym t border normal 1, mode default
bindsym p border pixel 1, mode default
bindsym escape mode default
bindsym $mod+escape mode default
bindsym $mod+b mode default
}
# class border background text indicator child_border # class border background text indicator child_border
client.focused $accent $accent $bg $error $accent client.focused $accent $accent $bg $error $bg
client.focused_inactive $dimmed $dimmed $bg $bg $dimmed client.focused_inactive $dimmed $dimmed $bg $bg $bg
client.unfocused $dimmed $dimmed $bg $bg $dimmed client.unfocused $dimmed $dimmed $bg $bg $bg
client.urgent $error $error $bg $error $error client.urgent $error $error $bg $error $bg
# statusbar # behaviour ####################################################################
bar colors { workspace_layout tabbed
focus_follows_mouse yes
focus_wrapping yes
# statusbar ####################################################################
bar {
# status_command ~/src/swaystatus/build/swaystatus
status_command statusline.sh
separator_symbol " | "
colors {
background $bg background $bg
statusline $dimmed statusline $dimmed
separator $dimmed separator $dimmed
@ -220,27 +183,14 @@ bar colors {
} }
} }
set $bar_mode "bar: (d)ock (h)ide (i)nvisible (o)verlay" # xwayland #####################################################################
bindsym $mod+shift+b mode $bar_mode, bar mode dock xwayland disable
mode $bar_mode { # autostart ####################################################################
bindsym d bar mode dock, mode default
bindsym h bar mode hide, mode default
bindsym i bar mode invisible, mode default
bindsym o bar mode overlay, mode default
bindsym escape mode default
bindsym $mod+escape mode default
bindsym $mod+shift+b mode default
}
# autostart
exec swayidle exec swayidle
exec wlsunset -l 45 -L 15 exec wlsunset -l 45 -L 15
exec mako exec mako
exec foot --server exec foot --server
# xwayland # include ######################################################################
xwayland disable
# include
include ~/.config/sway/`hostname` include ~/.config/sway/`hostname`

View File

@ -2,9 +2,13 @@
input "type:keyboard" { input "type:keyboard" {
xkb_layout gb,si xkb_layout gb,si
xkb_options caps:escape,grp:alt_shift_toggle xkb_options caps:escape,grp:alt_shift_toggle
repeat_delay 200
repeat_rate 30
} }
input "type:touchpad" { input "type:touchpad" {
tap enabled tap enabled
} }
# seat
seat * hide_cursor 5000

View File

@ -8,4 +8,13 @@ input "type:keyboard" {
xkb_layout us,si xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle xkb_options caps:escape,grp:alt_shift_toggle
xkb_numlock enabled xkb_numlock enabled
repeat_delay 300
repeat_rate 30
} }
input "type:touchpad" {
tap enabled
}
# seat
seat * hide_cursor 5000