1
0
Fork 0
dotfiles/sway/config
coderkun 8d215d604d sway: Map some keys using “bindcode”
Map some keys using “bindcode” instead of “bindsym” to be independent
from the current keyboard layout.
2020-07-04 12:41:45 +02:00

160 lines
5.6 KiB
Text

### Variables
set $mod Mod4
set $left 44
set $down 45
set $up 46
set $right 47
set $term termite
set $menu j4-dmenu-desktop --dmenu="bemenu -i -l 10 --fn \"Dejavu Sans Mono\" 10" --no-generic --term=termite --usage-log="$HOME/.cache/j4-dmenu-desktop.log"
set $locker swaylock -f -s center -i "~/.config/sway/lockscreen.png"
### Font
font pango:DejaVu Sans Mono 9
### Key bindings
# Basics
bindsym $mod+Return exec $term
bindcode $mod+Shift+24 kill
bindcode $mod+40 exec $menu
bindcode $mod+Shift+27 reload
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
floating_modifier $mod normal
# Moving around
bindcode $mod+$left focus left
bindcode $mod+$down focus down
bindcode $mod+$up focus up
bindcode $mod+$right focus right
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
bindcode $mod+Shift+$left move left
bindcode $mod+Shift+$down move down
bindcode $mod+Shift+$up move up
bindcode $mod+Shift+$right move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindcode $mod+mod3+58 workspace 1
bindcode $mod+mod3+59 workspace 2
bindcode $mod+mod3+60 workspace 3
bindcode $mod+mod3+44 workspace 4
bindcode $mod+mod3+45 workspace 5
bindcode $mod+mod3+46 workspace 6
bindcode $mod+mod3+30 workspace 7
bindcode $mod+mod3+31 workspace 8
bindcode $mod+mod3+32 workspace 9
bindcode $mod+mod3+65 workspace 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
bindcode $mod+Shift+mod3+58 move container to workspace 1
bindcode $mod+Shift+mod3+59 move container to workspace 2
bindcode $mod+Shift+mod3+60 move container to workspace 3
bindcode $mod+Shift+mod3+44 move container to workspace 4
bindcode $mod+Shift+mod3+45 move container to workspace 5
bindcode $mod+Shift+mod3+46 move container to workspace 6
bindcode $mod+Shift+mod3+30 move container to workspace 7
bindcode $mod+Shift+mod3+31 move container to workspace 8
bindcode $mod+Shift+mod3+32 move container to workspace 9
bindcode $mod+Shift+mod3+65 move container to workspace 10
# Multiple monitors
bindcode $mod+Shift+30 move workspace to output left
bindcode $mod+Shift+31 move container to output left
bindcode $mod+Shift+32 move container to output right
bindcode $mod+Shift+33 move workspace to output right
# Layout stuff
bindcode $mod+43 splith
bindcode $mod+42 splitv
bindcode $mod+39 layout stacking
bindcode $mod+25 layout tabbed
bindcode $mod+26 layout toggle split
# Make the current focus fullscreen
bindcode $mod+41 fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# move focus to the parent container
bindcode $mod+38 focus parent
# Scratchpad
bindsym $mod+Shift+minus move scratchpad
bindsym $mod+minus scratchpad show
# Mako keybindings
bindsym Ctrl+space exec makoctl dismiss
bindsym Ctrl+Shift+space exec makoctl dismiss --all
# Resizing containers
mode "resize" {
bindcode $left resize shrink width 80px
bindcode Shift+$left resize shrink width 20px
bindcode $down resize grow height 80px
bindcode Shift+$down resize grow height 20px
bindcode $up resize shrink height 80px
bindcode Shift+$up resize shrink height 20px
bindcode $right resize grow width 80px
bindcode Shift+$right resize grow width 20px
bindsym Left resize shrink width 80px
bindsym Down resize grow height 80px
bindsym Up resize shrink height 80px
bindsym Right resize grow width 80px
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindcode $mod+27 mode "resize"
# Status Bar
bar {
position top
height 25
font pango:DejaVu Sans Mono 10
status_command i3blocks
}
# Shutdown, reboot, lock srceen
set $mode_system System (b) blank, (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym b exec 'sleep 1 && killall -s SIGUSR1 swayidle', mode "default"
bindsym l exec '$locker', mode "default"
bindsym e exec swaymsg exit, mode "default"
bindsym s exec '$locker && systemctl suspend', mode "default"
bindsym h exec '$locker && systemctl hibernate', mode "default"
bindsym r exec systemctl reboot, mode "default"
bindsym Shift+s exec systemctl poweroff -i, mode "default"
bindsym Return mode "default"
bindsym mod3+Return mode "default"
bindsym Escape mode "default"
bindsym mod3+Escape mode "default"
}
bindcode $mod+Shift+55 mode "$mode_system"
# Systemd environment
exec systemctl --user import-environment
exec systemctl --user start sway-session.target
# Device specific configuration
include device
# Global configuration
include /etc/sway/config.d/*