# Default config for sway # # Copy this to ~/.config/sway/config and edit it to your liking. # # Read `man 5 sway` for a complete reference. ### Variables # # Logo key. Use Mod1 for Alt. set $mod Mod4 # Home row direction keys, like vim set $left h set $down j set $up k set $right l # Your preferred terminal emulator set $term footclient set $lock swaylock # Your preferred application launcher # Note: pass the final command to swaymsg so that the resulting window can be opened # on the original workspace that the command was run on. set $menu dmenu_path | dmenu | xargs swaymsg exec -- set $trans 0.7 set $alphamark "α" for_window [con_mark=$alphamark] opacity set $trans include /etc/sway/config-vars.d/* ### Things to run at start of session exec { # set a random background swaybg-random ~/bg # use footclient/footserver as our terminal foot -s } ### Idle configuration exec swayidle -w \ timeout 180 $lock \ timeout 240 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ before-sleep $lock for_window [app_id="dspdfviewer"] inhibit_idle focus ### Input configuration # # This is only used to make bindsym --to-code map all of the default bindings to # the same physical keys as the default us layout. # The layouts are actually set by $XDG_CONFIG_HOME/sway/config.d/20_keyboards input * { xkb_layout us } bindsym --locked { XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- XF86AudioRaiseVolume exec wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+ XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle XF86MonBrightnessUp exec --no-startup-id light -A 10 XF86MonBrightnessDown exec --no-startup-id light -U 10 } # # Basics: # bindsym --to-code { # Start a terminal $mod+Return exec $term # Kill focused window $mod+Shift+q kill # Start your launcher $mod+d exec $menu # Reload the configuration file $mod+Shift+c reload # Exit sway (logs you out of your Wayland session) $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' # Lock screen $mod+F5 exec swaymsg 'output * dpms toggle' $mod+F7 exec $lock # List all windows $mod+u exec wofi-window-switcher # Make focused window transparent $mod+Shift+t mark --toggle "$alphamark" ; [con_id=__focused__] opacity set 1 ; [con_mark=$alphamark con_id=__focused__] opacity set $trans # Hide/show waybar $mod+x exec pkill -SIGUSR1 waybar # # Moving around: # # Move your focus around $mod+$left focus left $mod+$down focus down $mod+$up focus up $mod+$right focus right $mod+Alt+$left focus output left $mod+Alt+$down focus output down $mod+Alt+$up focus output up $mod+Alt+$right focus output right # Move the focused window with the same, but add Shift $mod+Shift+$left move left $mod+Shift+$down move down $mod+Shift+$up move up $mod+Shift+$right move right # Ditto, with arrow keys $mod+Shift+Left move left $mod+Shift+Down move down $mod+Shift+Up move up $mod+Shift+Right move right # # Layout stuff: # # You can "split" the current object of your focus with # $mod+b or $mod+v, for horizontal and vertical splits # respectively. $mod+b splith $mod+v splitv # Switch the current container between different layout styles $mod+s layout stacking $mod+w layout tabbed $mod+e layout toggle split # Make the current focus fullscreen $mod+f fullscreen # Toggle the current focus between tiling and floating mode $mod+Shift+space floating toggle # Swap focus between the tiling area and the floating area $mod+space focus mode_toggle # Move focus to the parent container $mod+a focus parent # # Scratchpad: # # Sway has a "scratchpad", which is a bag of holding for windows. # You can send windows there and get them back later. # Move the currently focused window to the scratchpad $mod+Shift+minus move scratchpad # Show the next scratchpad window or hide the focused scratchpad window. # If there are multiple scratchpad windows, this command cycles through them. $mod+minus scratchpad show # # Marking: # # $mod+m exec } bindgesture swipe:right workspace prev bindgesture swipe:left workspace next # Drag floating windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. # Despite the name, also works for non-floating windows. # Change normal to inverse to use left mouse button for resizing and right # mouse button for dragging. floating_modifier $mod normal # # Resizing containers: # mode "resize" bindsym --to-code { # left will shrink the containers width # right will grow the containers width # up will shrink the containers height # down will grow the containers height $left resize shrink width 10px $down resize grow height 10px $up resize shrink height 10px $right resize grow width 10px # Ditto, with arrow keys Left resize shrink width 10px Down resize grow height 10px Up resize shrink height 10px Right resize grow width 10px # Return to default mode Return mode "default" Escape mode "default" } bindsym --to-code $mod+r mode "resize" bar swaybar_command waybar exec_always pkill kanshi; exec kanshi font pango:Iosevka Regular 8 include /etc/sway/config.d/* include ~/.config/sway/config.d/*