workspace/arch-user/config/sway/config.tmpl
2025-03-29 16:07:54 +00:00

135 lines
5.8 KiB
Cheetah

# vim: filetype=swayconfig
set $mod Mod4
set $altmod Mod4+Mod5
set $altmod2 Mod4+Shift
set $fwd m
set $left n
set $up e
set $down i
set $right o
set $bwd apostrophe
################ styles ####################
default_border pixel 1
smart_borders on
title_align center
font pango:$THEME_FONT_REGULAR $THEME_SIZE_FONT_SMALL_PT
output * bg #$THEME_COLOR_BG solid_color
client.focused #$THEME_COLOR_BG_ACCENT_LIGHT #$THEME_COLOR_BG_ACCENT_LIGHT #$THEME_COLOR_FG #$THEME_COLOR_FG_ACCENT #$THEME_COLOR_BG_ACCENT_LIGHT
client.focused_tab_title #$THEME_COLOR_BG_ACCENT_LIGHT$THEME_OPACITY_MID_HEX #$THEME_COLOR_BG_ACCENT_LIGHT$THEME_OPACITY_MID_HEX #$THEME_COLOR_FG_DARK #$THEME_COLOR_FG_ACCENT #$THEME_COLOR_BG_ACCENT_LIGHT
client.focused_inactive #$THEME_COLOR_BG_ACCENT_LIGHT$THEME_OPACITY_MID_HEX #$THEME_COLOR_BG_ACCENT_DARK #$THEME_COLOR_FG_DARK #$THEME_COLOR_FG_ACCENT #$THEME_COLOR_BG_ACCENT_LIGHT$THEME_OPACITY_MID_HEX
client.unfocused #$THEME_COLOR_BG_ACCENT_LIGHT$THEME_OPACITY_MID_HEX #$THEME_COLOR_BG_ACCENT_DARK #$THEME_COLOR_FG_DARK #$THEME_COLOR_FG_ACCENT #$THEME_COLOR_BG_ACCENT_LIGHT$THEME_OPACITY_MID_HEX
bar {
position top
font pango:$THEME_FONT_REGULAR $THEME_SIZE_FONT_BASE_PT
status_command i3blocks
strip_workspace_numbers yes
separator_symbol |
workspace_min_width 28
colors {
statusline #$THEME_COLOR_FG
background #$THEME_COLOR_BG
separator #$THEME_COLOR_FG_DARK
focused_workspace #$THEME_COLOR_BG_ACCENT_LIGHT #$THEME_COLOR_BG_ACCENT_LIGHT #$THEME_COLOR_FG
inactive_workspace #$THEME_COLOR_BG_ACCENT_DARK #$THEME_COLOR_BG_ACCENT_DARK #$THEME_COLOR_FG
urgent_workspace #$THEME_COLOR_FG_ACCENT #$THEME_COLOR_FG_ACCENT #$THEME_COLOR_FG
binding_mode #$THEME_COLOR_FG_ACCENT #$THEME_COLOR_FG_ACCENT #$THEME_COLOR_FG
}
}
###########################################
################ inputs ####################
input "type:keyboard" {
xkb_layout us(yz),ru(yz)
repeat_rate 50
}
bindsym --to-code Super_L input "type:keyboard" xkb_switch_layout next; exec pkill -SIGRTMIN+1 i3blocks
input "type:touchpad" {
tap enabled
natural_scroll enabled
}
############################################
############### workspaces #################
bindsym --to-code $mod+a workspace 1:a
bindsym --to-code $mod+r workspace 2:r
bindsym --to-code $mod+s workspace 3:s
bindsym --to-code $mod+t workspace 4:t
bindsym --to-code $mod+g workspace 5:g
bindsym --to-code $altmod+a move container to workspace 1:a
bindsym --to-code $altmod+r move container to workspace 2:r
bindsym --to-code $altmod+s move container to workspace 3:s
bindsym --to-code $altmod+t move container to workspace 4:t
bindsym --to-code $altmod+g move container to workspace 5:g
bindgesture swipe:right workspace prev
bindgesture swipe:left workspace next
############################################
############### containers #################
# top row - layout modes, resize
bindsym --to-code $mod+q layout stacking
bindsym --to-code $mod+w layout tabbed
bindsym --to-code $mod+f fullscreen
bindsym --to-code $mod+p layout toggle split
bindsym --to-code $mod+l split v
bindsym --to-code $mod+u split h
bindsym --to-code $mod+y split none
# mid row - focus, movement
bindsym --to-code $mod+$fwd focus child
bindsym --to-code $mod+$left focus left
bindsym --to-code $mod+$up focus up
bindsym --to-code $mod+$down focus down
bindsym --to-code $mod+$right focus right
bindsym --to-code $mod+$bwd focus parent
bindsym --to-code $altmod+$left move left 40px
bindsym --to-code $altmod+$up move up 40px
bindsym --to-code $altmod+$down move down 40px
bindsym --to-code $altmod+$right move right 40px
bindsym --to-code $altmod2+$left resize shrink width 2ppt or 40px
bindsym --to-code $altmod2+$up resize shrink height 4ppt or 40px
bindsym --to-code $altmod2+$down resize grow height 4ppt or 40px
bindsym --to-code $altmod2+$right resize grow width 2ppt or 40px
# bottom row - modeless, extra focus
floating_modifier $mod normal
bindsym --to-code $altmod+x move scratchpad
bindsym --to-code $mod+x scratchpad show
bindsym --to-code $altmod+z floating toggle
bindsym --to-code $mod+z focus mode_toggle
bindsym --to-code $mod+k focus prev sibling
bindsym --to-code $mod+h sticky toggle
bindsym --to-code $mod+Comma opacity minus 0.1
bindsym --to-code $mod+Period opacity plus 0.1
bindsym --to-code $mod+slash focus next sibling
############################################
################## actions ####################
# copy paste
bindsym --to-code $mod+d exec wtype -P XF86Cut
bindsym --to-code $mod+c exec wtype -P XF86Copy
bindsym --to-code $mod+v exec wtype -P XF86Paste
# media
bindsym --to-code XF86MonBrightnessDown exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%- && pkill -SIGRTMIN+2 i3blocks
bindsym --to-code XF86MonBrightnessUp exec ~/.local/bin/sway/brightness-set-and-notify.sh 5%+ && pkill -SIGRTMIN+2 i3blocks
bindsym --to-code XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle && pkill -SIGRTMIN+2 i3blocks
bindsym --to-code XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5% && pkill -SIGRTMIN+2 i3blocks
bindsym --to-code XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5% && pkill -SIGRTMIN+2 i3blocks
bindsym --to-code XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle && pkill -SIGRTMIN+2 i3blocks
# basic scripts
bindsym --to-code $mod+Escape kill
bindsym --to-code $mod+Return exec footclient
bindsym --to-code $mod+Space exec run.sh
##############################################
################# daemons ####################
exec swayidle -w \
timeout 280 'notify-send "Suspend in 20s" "Produce some acivity or run inhibit to cancel" -a "swayidle" -t 20000' \
timeout 300 'systemctl suspend'
exec foot -s
exec mako
##############################################
############## app-specific ##################
for_window [app_id="_float"] floating enable, resize set 960 540
##############################################