1
0
Fork 0

update `sway` config

urosm 2024-02-28 17:05:49 +01:00
parent 62e396ceff
commit 1cb9f82d14
3 changed files with 205 additions and 189 deletions

View File

@ -1,52 +1,20 @@
# variables ####################################################################
set $mod Mod4
set $left h
set $down j
set $up k
# set ##########################################################################
# keys
set $mod mod4
set $left h
set $down j
set $up k
set $right l
# colors
set $bg #000000
set $dimmed #856cff
set $accent #ff1170
set $error #fa3500
set $black #000000
set $white #e2e2e2
set $blue #856cff
set $magenta #ff1170
set $red #fa3500
# key bindings #################################################################
bindsym $mod+return exec footclient
bindsym $mod+shift+return exec foot
# fuzzel
bindsym $mod+space exec fuzzel
bindsym $mod+shift+space exec fuzzel_open.sh \
-e $HOME/.cache \
-e $HOME/.mozilla \
-e $HOME/.thunderbird \
-e *.git*
bindsym $mod+home exec fuzzel_nmcli.sh
bindsym $mod+end exec fuzzel_udisksctl.sh
# makoctl
bindsym $mod+x exec makoctl dismiss
bindsym $mod+shift+x exec makoctl restore
# screenshot
bindsym print exec grim - | wl-copy
# window management ############################################################
workspace_layout tabbed
focus_follows_mouse yes
focus_wrapping yes
floating_modifier $mod normal
# kill
bindsym $mod+q kill
# move focus
bindsym $mod+$up focus up
bindsym $mod+$down focus down
bindsym $mod+$left focus left
bindsym $mod+$right focus right
# move container
bindsym $mod+shift+$up move up
bindsym $mod+shift+$down move down
bindsym $mod+shift+$left move left
bindsym $mod+shift+$right move right
# workspaces
#set $wsq 0:q:cmd
set $wsw 1:w:www
set $wse 2:e:txt
set $wsr 3:r:doc
@ -56,130 +24,209 @@ set $wsu 6:u:cmd
set $wsi 7:i:cmd
set $wso 8:o:cmd
set $wsp 9:p:rdp
# move focus workspace
bindsym --to-code $mod+tab workspace back_and_forth
#bindsym --to-code $mod+q workspace $wsq
bindsym --to-code $mod+w workspace $wsw
bindsym --to-code $mod+e workspace $wse
bindsym --to-code $mod+r workspace $wsr
bindsym --to-code $mod+t workspace $wst
bindsym --to-code $mod+y workspace $wsy
bindsym --to-code $mod+u workspace $wsu
bindsym --to-code $mod+i workspace $wsi
bindsym --to-code $mod+o workspace $wso
bindsym --to-code $mod+p workspace $wsp
bindsym --to-code $mod+bracketleft workspace prev
bindsym --to-code $mod+bracketright workspace next
# move container workspace
bindsym --to-code $mod+shift+tab move container to workspace back_and_forth, workspace back_and_forth
#bindsym --to-code $mod+shift+q move container to workspace $wsq, workspace $wsq
bindsym --to-code $mod+shift+w move container to workspace $wsw, workspace $wsw
bindsym --to-code $mod+shift+e move container to workspace $wse, workspace $wse
bindsym --to-code $mod+shift+r move container to workspace $wsr, workspace $wsr
bindsym --to-code $mod+shift+t move container to workspace $wst, workspace $wst
bindsym --to-code $mod+shift+y move container to workspace $wsy, workspace $wsy
bindsym --to-code $mod+shift+u move container to workspace $wsu, workspace $wsu
bindsym --to-code $mod+shift+i move container to workspace $wsi, workspace $wsi
bindsym --to-code $mod+shift+o move container to workspace $wso, workspace $wso
bindsym --to-code $mod+shift+p move container to workspace $wsp, workspace $wsp
bindsym --to-code $mod+shift+bracketleft move container to workspace prev, workspace prev
bindsym --to-code $mod+shift+bracketright move container to workspace next, workspace next
# resize
bindsym $mod+control+$left resize shrink width
bindsym $mod+control+$down resize grow height
bindsym $mod+control+$up resize shrink height
bindsym $mod+control+$right resize grow width
# 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+f fullscreen toggle
bindsym $mod+shift+f floating toggle
bindsym $mod+g focus mode_toggle
bindsym $mod+shift+g sticky toggle
bindsym $mod+period scratchpad show
bindsym $mod+shift+period move scratchpad
# laptop #######################################################################
bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+;\
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 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 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 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 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
bindsym XF86MonBrightnessDown exec brightnessctl set "1%-";\
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 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
bindsym shift+XF86MonBrightnessDown exec brightnessctl set "10%-";\
exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
# modes
set $session_mode " session: (r)eload (l)ock (q)uit (s)uspend re(b)oot (p)oweroff "
set $layout_mode " layout: split(h) split(v) (s)tacking (t)abbed "
# session ######################################################################
set $session_mode "session: (r)eload (l)ock (q)uit (s)uspend re(b)oot (p)oweroff"
mode $session_mode {
bindsym r reload, mode default
bindsym l exec swaylock -fu -c$bg, mode default
bindsym q exit, mode default
bindsym s exec systemctl suspend, mode default
bindsym b exec systemctl reboot, mode default
bindsym p exec systemctl poweroff, mode default
# return
bindsym escape mode default
bindsym $mod+escape mode default
}
bindsym $mod+escape mode $session_mode, fullscreen disable
# theme ########################################################################
output * background $bg solid_color
seat * hide_cursor 5000
font monospace 12
default_border normal 1
default_floating_border normal 1
# class border background text indicator child_border
client.focused $accent $accent $bg $error $bg
client.focused_inactive $dimmed $dimmed $bg $bg $bg
client.unfocused $dimmed $dimmed $bg $bg $bg
client.urgent $error $error $bg $error $bg
# statusbar ####################################################################
# bar ##########################################################################
bar {
status_command status.sh
separator_symbol " | "
separator_symbol ""
status_command status.sh
status_edge_padding 0
status_padding 0
strip_workspace_numbers yes
wrap_scroll yes
colors {
background $bg
statusline $dimmed
separator $dimmed
# border background text
focused_workspace $bg $bg $accent
active_workspace $dimmed $bg $dimmed
inactive_workspace $bg $bg $dimmed
urgent_workspace $bg $bg $error
background $blue
statusline $black
separator $black
# border background text
focused_workspace $magenta $magenta $black
active_workspace $magenta $magenta $white
inactive_workspace $blue $blue $black
urgent_workspace $red $red $black
}
}
# workspace_layout #############################################################
workspace_layout tabbed
# xwayland #####################################################################
xwayland disable
# autostart ####################################################################
exec mako
exec wlsunset -l 45 -L 15
exec swayidle -w \
timeout 300 'swaylock -fu -c$bg' \
timeout 1800 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -fu -c$bg'
# bindsym ######################################################################
bindsym {
# floating
$mod+shift+f floating toggle
workspace $wsw, exec thunderbird, exec firefox
workspace $wse, exec foot --server
# focus
$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
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
# fullscreen
$mod+f fullscreen toggle
# include ######################################################################
include $XDG_CONFIG_HOME/sway/`hostname`
# mode
$mod+d mode $layout_mode, fullscreen disable
$mod+escape mode $session_mode, fullscreen disable
# move
$mod+shift+$up move up
$mod+shift+$down move down
$mod+shift+$left move left
$mod+shift+$right move right
--to-code $mod+shift+tab move workspace back_and_forth, workspace back_and_forth
--to-code $mod+shift+w move workspace $wsw, workspace $wsw
--to-code $mod+shift+e move workspace $wse, workspace $wse
--to-code $mod+shift+r move workspace $wsr, workspace $wsr
--to-code $mod+shift+t move workspace $wst, workspace $wst
--to-code $mod+shift+y move workspace $wsy, workspace $wsy
--to-code $mod+shift+u move workspace $wsu, workspace $wsu
--to-code $mod+shift+i move workspace $wsi, workspace $wsi
--to-code $mod+shift+o move workspace $wso, workspace $wso
--to-code $mod+shift+p move workspace $wsp, workspace $wsp
--to-code $mod+shift+bracketleft move workspace prev, workspace prev
--to-code $mod+shift+bracketright move workspace next, workspace next
$mod+colon move scratchpad
# scratchpad
$mod+semicolon scratchpad show
# sticky
$mod+shift+g sticky toggle
# exec
$mod+return exec footclient
$mod+shift+return exec foot
$mod+space exec fuzzel
$mod+shift+space exec fuzzel_open.sh -e $HOME/.cache -e $HOME/.mozilla -e $HOME/.thunderbird -e *.git*
$mod+home exec fuzzel_nmcli.sh
$mod+end exec fuzzel_udisksctl.sh
$mod+x exec makoctl dismiss
$mod+shift+x exec makoctl restore
print exec grim - | wl-copy
# exec (laptop)
XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:audio_sink "$(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_sink "$(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_sink "$(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_source "$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)"
XF86MonBrightnessUp exec brightnessctl set "+1%"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
XF86MonBrightnessDown exec brightnessctl set "1%-"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessUp exec brightnessctl set "+10%"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
shift+XF86MonBrightnessDown exec brightnessctl set "10%-"; exec notify-send -e -t 2000 -h string:x-canonical-private-synchronous:brightness "Brightness: $(brightnessctl get)"
# kill
$mod+q kill
# resize
$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
--to-code $mod+tab workspace back_and_forth
--to-code $mod+w workspace $wsw
--to-code $mod+e workspace $wse
--to-code $mod+r workspace $wsr
--to-code $mod+t workspace $wst
--to-code $mod+y workspace $wsy
--to-code $mod+u workspace $wsu
--to-code $mod+i workspace $wsi
--to-code $mod+o workspace $wso
--to-code $mod+p workspace $wsp
--to-code $mod+bracketleft workspace prev
--to-code $mod+bracketright workspace next
}
# client.* #####################################################################
# class border background text indicator child_border
client.focused $magenta $magenta $black $red $black
client.focused_inactive $blue $blue $black $black $black
client.unfocused $blue $blue $black $black $black
client.urgent $red $red $black $red $black
# default_border ###############################################################
default_border normal 0
# default_floating_border ######################################################
default_floating_border normal 0
# exec #########################################################################
exec {
systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
swayidle -w \
timeout 300 'swaylock -fu -c$blue' \
timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
before-sleep 'swaylock -fu -c$blue'
wlsunset -l 45 -L 15
mako
foot --server
firefox
thunderbird
}
# focus_wrapping ###############################################################
focus_wrapping yes
# font #########################################################################
font monospace 13
# input ########################################################################
# keyboard
input "type:keyboard" {
xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle
repeat_delay 200
repeat_rate 30
}
# touchpad
input "type:touchpad" {
tap enabled
}
# mode #########################################################################
# session
mode $session_mode {
bindsym {
r reload, mode default
l exec swaylock -fu -c$blue, mode default
q exit, mode default
s exec systemctl suspend, 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
}
}
# seat #########################################################################
seat * hide_cursor 1000
# output #######################################################################
output * background $blue solid_color
# workspace ####################################################################
workspace $wse

View File

@ -1,15 +0,0 @@
# output
output * {
adaptive_sync on
}
# input
input "type:keyboard" {
xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle
repeat_delay 200
repeat_rate 30
}
input "type:touchpad" {
tap enabled
}

View File

@ -1,16 +0,0 @@
# clamshell
set $laptop LVDS-1
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
# input
input "type:keyboard" {
xkb_layout us,si
xkb_options caps:escape,grp:alt_shift_toggle
xkb_numlock enabled
repeat_delay 300
repeat_rate 30
}
input "type:touchpad" {
tap enabled
}