# vim: ft=sway tw=99 set { $mod Mod4 $left h $down j $up k $right l $lock exec swaylock -f $lockt exec ~/utils/bin/sway-locker -t $chromium_flags --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-gpu-rasterization --enable-zero-copy --js-flags=--jitless $keyring "/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh" $term KITTY_ENABLE_WAYLAND=1 kitty -1 # qterminal alacritty $menu wofi --show drun --allow-markup swaymsg exec -- $nutermmenu kitty --class 'launcher' bash -c 'compgen -c | sort -u | fzf | xargs -r kitty' $bemenu bemenu-run --fork -l 5 -n -p "▶" --fn 'FiraCode Retina 17' | xargs swaymsg exec $dashpls nwggrid # $bg "~/Pictures/apod/2019-January-2-The-Orion-Nebula-in-Infrared-from-WISE.jpg fit #000000" # $bg "~/Pictures/apod/2020-April-29-The-Ion-Tail-of-New-Comet-SWAN.jpg fit #000000" $bg "~/Pictures/apod/2020-August-11-Churning-Clouds-on-Jupiter.jpg" $bg2 "~/Pictures/apod/2019-October-20-Pluto-at-Night.jpg" $gtk_theme "Dracula" $gtk_font_name "CascadiaCodePL ExtraLight" $gtk_font_size "10.4" $icon_theme "Flat-Remix-Blue-Dark" $theme "Dracula" $gtk_cursor_theme "Adwaita" $laptop_screen "eDP-1" $ext_screen "Dell Inc. DELL U2412M Y1H5T27N1EVL" $ext_screen2 "Dell Inc. DELL U2412M YPPY077L1JXS" $pri $laptop_screen $sec $ext_screen $ter $ext_screen2 } default_border pixel 0 default_floating_border normal # hide_edge_borders --i3 both # smart_borders on # works also for non-floating windows # normal - drag floating windows by holding down $mod and left mouse button. # resize them with right mouse button + $mod. # inverse for $mod+left click to resize, $mod+right click to drag floating_modifier $mod normal #smart_gaps on smart_gaps inverse_outer gaps outer 8 gaps inner 5 font pango:FiraCode Retina 14px exec_always --no-startup-id { swaymsg output $pri bg $bg fill #000000 swaymsg output $sec bg $bg2 fill #000000 swaymsg output $ter bg $bg fill #000000 gsettings set org.gnome.desktop.interface gtk-theme '$gtk_theme' gsettings set org.gnome.desktop.interface icon-theme '$icon_theme' gsettings set org.gnome.desktop.interface cursor-theme '$gtk_cursor_theme' gsettings set org.gnome.desktop.interface font-name '$gtk_font_name $gtk_font_size' gsettings set org.gnome.desktop.wm.preferences button-layout 'icon:close' gsettings set org.gnome.desktop.wm.preferences theme '$theme' gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true pgrep -u $(id -u) kanshi && pkill kanshi pgrep -u $(id -u) ibus-daemon && pkill ibus-daemon ibus-daemon -dxrt auto ### Needed for xdg-desktop-portal-kde dbus-update-activation-environment --systemd --all /usr/lib/xdg-desktop-portal --replace pgrep -u $(id -u) kdeconnect-indi && pkill kdeconnect-indi pgrep -u $(id -u) mako && pkill mako pgrep -u $(id -u) fusuma && pkill fusuma pgrep -u $(id -u) swayrd && pkill swayrd pgrep -u $(id -u) autotiling && pkill autotiling pgrep -u $(id -u) batsignal && pkill batsignal pgrep -u $(id -u) swayidle && pkill swayidle kdeconnect-indicator mako XDG_SESSION_TYPE=x11 XDG_CURRENT_DESKTOP=gnome fusuma -d -c ~/.config/fusuma/config-wl.yml env RUST_BACKTRACE=1 ~/.cargo/bin/swayrd > /tmp/swayrd.log 2>&1 kanshi autotiling batsignal '-d -w 25 -c 15 -d 10' swayidle -w \ timeout 545 'pgrep -u $(id -u) swaylock || notify-send -t 15000 -u critical -i "Idle timeout" "Screen is locking soon"' \ timeout 600 "$lock" \ timeout 610 'swaymsg "output * dpms off"' \ timeout 15 'pgrep -u $(id -u) swaylock && swaymsg "output * dpms off"' \ resume 'swaymsg "output * dpms on"' \ before-sleep "pgrep -u $(id -u) swaylock || $lockt" } exec --no-startup-id { # TODO(me): # https://github.com/slgobinath/SafeEyes nm-applet --indicator lxpolkit dbus-update-activation-environment DISPLAY XAUTHORITY ibus-daemon -dxrt auto $keyring ### Needed for xdg-desktop-portal-kde dbus-update-activation-environment --systemd --all /usr/lib/xdg-desktop-portal --replace pgrep -u $(id -u) kdeconnect-indi || kdeconnect-indicator pgrep -u $(id -u) mako || mako # XDG_SESSION_TYPE=x11 XDG_CURRENT_DESKTOP=gnome fusuma -d -c ~/.config/fusuma/config-wl.yml pgrep -u $(id -u) fusuma || fusuma -d -c ~/.config/fusuma/config-wl.yml env RUST_BACKTRACE=1 ~/.cargo/bin/swayrd > /tmp/swayrd.log 2>&1 pgrep -u $(id -u) kansi || kanshi pgrep -u $(id -u) autotiling || autotiling pgrep -u $(id -u) batsignal || batsignal '-d -w 25 -c 15 -d 10' pgrep -u $(id -u) swayidle || swayidle -w \ timeout 545 'pgrep -u $(id -u) swaylock || notify-send -t 15000 -u critical -i "Idle timeout" "Screen is locking soon"' \ timeout 600 "$lock" \ timeout 610 'swaymsg "output * dpms off"' \ timeout 15 'pgrep -u $(id -u) swaylock && swaymsg "output * dpms off"' \ resume 'swaymsg "output * dpms on"' \ before-sleep "pgrep -u $(id -u) swaylock || $lockt" } bindsym ctrl+alt+l exec --no-startup-id $lock bindsym $mod+grave exec $lock bindswitch --reload --locked lid:on exec --no-startup-id $(swaymsg output $laptop_screen disable && /usr/local/bin/kanshictl reload) bindswitch --reload --locked lid:off exec --no-startup-id $(swaymsg output $laptop_screen enable && /usr/local/bin/kanshictl reload) exec --no-startup-id swaymsg focus output $pri output "*" bg $bg fill #000000 #--- Window Decorations set { $nofocus #202020 $focus #202020 $titletxt #FFFFE8 $titlepad 10 center #000000 $gaps_change 20 } #--- Notifications set { $n_anchor top-center $n_layer overlay $n_dim 600 $n_margin 20 $n_padding 10 $n_border 3 $n_bg #202020 $n_fg #FFFFE8 } bindsym { $mod+Return exec $term $mod+t exec $term $mod+ctrl+Shift+t exec qterminal $mod+Shift+q kill alt+F1 exec $menu alt+Shift+F1 exec $dashpls alt+F2 exec $bemenu alt+F3 exec ulauncher-toggle alt+Shift+F2 exec $nutermmenu $mod+ctrl+k exec QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_QPA_PLATFORMTHEME=wayland keepassxc $mod+ctrl+t exec QT_QPA_PLATFORMTHEME=wayland telegram-desktop $mod+ctrl+v exec QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_QPA_PLATFORMTHEME=wayland VirtualBox $mod+shift+m exec swaymsg output $(swaymsg -p -t get_outputs | grep Output | head -n2 | tail -n1 | sed -e 's/Output //g' -e 's/ ''.*$//g') toggle } for_window [app_id="^launcher$"] floating enable, border none, resize set width 25 ppt height 100 ppt, move position 0 px 0 px input 1:1:AT_Translated_Set_2_keyboard { # laptop kbd xkb_layout gb,sk xkb_options grp:win_space_toggle,compose:ralt xkb_variant ",qwerty" repeat_delay 280 repeat_rate 55 } input 1133:16522:Logitech_MX_Keys { xkb_layout gb,sk xkb_options grp:win_space_toggle,compose:ralt xkb_variant ",qwerty" repeat_delay 280 repeat_rate 55 } input 1102:4619:DLL07A7:01_044E:120B { # touchpad accel_profile adaptive tap enabled # disable-while-typing dwt enabled natural_scroll enabled scroll_method two_finger # lrm treats 1 finger as left click, 2 fingers as right click, and 3 # fingers as middle click. tap_button_map lrm } input 1149:8264:Primax_Kensington_Eagle_Trackball { # scroll_factor 1.5 scroll_factor 0.5 natural_scroll enabled accel_profile adaptive dwt enabled } focus_follows_mouse yes focus_wrapping false popup_during_fullscreen smart #--- Floating Windows ------------------------------------------------------ for_window [window_role="pop-up"] floating enable for_window [window_role="bubble"] floating enable for_window [window_role="task_dialog"] floating enable for_window [window_role="Preferences"] floating enable for_window [window_type="dialog"] floating enable for_window [window_type="menu"] floating enable for_window [window_role="About"] floating enable for_window [instance="Farge"] floating enable for_window [class="pop-up"] floating enable; border normal $border for_window [window_role="pop-up"] floating enable; border normal $border for_window [window_role="task_dialog"] floating enable; border normal $border for_window [class="MEGAsync"] floating enable; border pixel 0 for_window [title=".*JetBrains.*"] floating enable; border pixel 1 for_window [class="matplotlib"] floating enable; border normal $border for_window [class="dosbox"] floating enable; border normal $border for_window [app_id="nm-connection-editor"] { floating enable resize set width 882px resize set height 600px } for_window [app_id="pavucontrol"] { floating enable resize set width 882px resize set height 600px } for_window [app_id="ulauncher"] border none #--- Applications with CSD ------------------------------------------------- for_window [app_id="glade"] border pixel 2 for_window [app_id="baobab"] border pixel 2 for_window [title=".*eston.*"] border pixel 0 for_window [app_id="wdisplays"] border pixel 0 for_window [app_id="gnome-.*"] border pixel 1 for_window [app_id="qterminal"] border pixel 2 for_window [app_id="xterm"] border pixel 2 for_window [title=".*Brave.*"] border pixel 1 inhibit_idle fullscreen for_window [title=".*Firefox.*"] border pixel 2 inhibit_idle fullscreen for_window [app_id="firefox"] border pixel 2 inhibit_idle fullscreen for_window [class="Firefox"] border pixel 2 inhibit_idle fullscreen for_window [class="vlc"] border pixel 2 inhibit_idle visible fullscreen for_window [app_id="vlc"] border pixel 2 inhibit_idle visible fullscreen for_window [title=".*VLC*."] border pixel 2 inhibit_idle visible fullscreen for_window [app_id="org.gnome.Nautilus"] border pixel 1 for_window [app_id="dolphin"] border pixel 1 for_window [app_id="kitty"] border pixel 2 # as per https://github.com/japhir/ArchConfigs/blob/master/swayconfig # add the webcam screen for video recording bindsym $mod+ctrl+Shift+a exec mpv --no-osc --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0 || notify-send "failed to start webcam" # for_window [title="^video0 - mpv$"] floating enable, sticky enable, resize set height 260 px, move absolute position 0 px 820 px, border none for_window [title="^video0 - mpv$"] floating enable, sticky enable, resize set height 130 px, border none for_window [title="Firefox — Sharing Indicator$"] floating enable, resize set height 16 px, border none for_window [title="Picture-in-Picture"] floating enable #--- Xtk Applications ------------------------------------------------------ for_window [title="xclock"] floating enable for_window [title="Calculator"] floating enable assign [app_id="telegram"] C assign [class="Signal"] C assign [title="Ferdi"] C assign [title="Discord"] C assign [class="Discord"] C assign [class="vlc"] M bindsym { # screenshot of all outputs print exec grim $(xdg-user-dir PICTURES)/screenshots/grim-$(date +'%Y-%m-%dT%H-%M-%S').png # screenshot of an area Shift+print exec grim -g "$(slurp)" - | wl-copy # screenshot of a window Control+print exec winprint.sh # colour picker Control+Shift+print exec grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt: | wl-copy $mod+c exec gnome-calculator # -w: Always open a new window for browsing specified URIs. $mod+n exec nautilus -w $mod+Shift+n exec nemo $mod+m exec QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_QPA_PLATFORMTHEME=wayland vlc $mod+Shift+b exec brave-browser-beta --incognito $chromium_flags $mod+Shift+w exec MOZ_USE_XINPUT2=1 MOZ_ENABLE_WAYLAND=1 ~/Downloads/firefox-dev/firefox --private-window $mod+Ctrl+Shift+w exec MOZ_USE_XINPUT2=1 MOZ_ENABLE_WAYLAND=1 systemctl --user start ff_nn $mod+Shift+g exec MOZ_USE_XINPUT2=1 MOZ_ENABLE_WAYLAND=1 firefox --private-window $mod+Shift+v exec ferdi --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-gpu-rasterization --enable-zero-copy $mod+Shift+a exec chromium-freeworld --incognito $chromium_flags --locked $mod+Escape exec systemctl suspend -i $mod+Shift+o exec kitty bash -c 'powerprofilesctl set power-saver; powerprofilesctl|grep "*"; sleep 1' $mod+Shift+p exec kitty bash -c 'powerprofilesctl set performance; powerprofilesctl|grep "*"; sleep 1' --locked $mod+ctrl+Shift+s exec kitty bash -c 'sudo dell-bios-fan-control 0;sudo i8kfan 0 0' --locked $mod+ctrl+Shift+d exec kitty bash -c 'sudo dell-bios-fan-control 0;sudo i8kfan 0 1' --locked $mod+ctrl+Shift+f exec kitty bash -c 'sudo dell-bios-fan-control 0;sudo i8kfan 0 2' --locked $mod+ctrl+Shift+b exec kitty bash -c 'sudo dell-bios-fan-control 1; powerprofilesctl set balanced; powerprofilesctl|grep "*"' $mod+Ctrl+r exec alacritty --class ranger -e ranger # colour picker / eyedropper $mod+Shift+Alt+f exec farge --notify $mod+tab exec swayr switch-workspace-or-window } # # Borders # bindsym --to-code { $mod+ctrl+semicolon border toggle } # # Gaps # bindsym --to-code { # $mod+ctrl+minus gaps inner 2px # $mod+ctrl+equal gaps inner 2px $mod+z gaps outer current plus 5 $mod+Shift+z gaps outer current minus 5 $mod+x gaps inner current plus 5 $mod+Shift+x gaps inner current minus 5 } # Notifications bindsym Control+Space exec makoctl dismiss bindsym Control+Shift+Space exec makoctl dismiss --all bindsym Control+Alt+Space exec makoctl set-mode do-not-disturb bindsym Control+Alt+Shift+Space exec makoctl set-mode default # # Moving around: # bindsym { # Move your focus around $mod+$left focus left $mod+$down focus down $mod+$up focus up $mod+$right focus right # Or use $mod+[up|down|left|right] $mod+Left focus left $mod+Down focus down $mod+Up focus up $mod+Right focus 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 $mod+Shift+c move position center } # # Workspaces: # # Switch to workspace bindsym --to-code { $mod+Shift+comma workspace prev_on_output $mod+Shift+period workspace next_on_output $mod+Shift+tab workspace back_and_forth $mod+comma focus output left $mod+period focus output right $mod+0 exec ~/.local/bin/swws.py 0 $mod+1 exec ~/.local/bin/swws.py 1 $mod+2 exec ~/.local/bin/swws.py 2 $mod+3 exec ~/.local/bin/swws.py 3 $mod+4 exec ~/.local/bin/swws.py 4 $mod+5 exec ~/.local/bin/swws.py 5 $mod+6 exec ~/.local/bin/swws.py 6 $mod+7 exec ~/.local/bin/swws.py 7 $mod+8 exec ~/.local/bin/swws.py 8 $mod+9 exec ~/.local/bin/swws.py 9 $mod+F2 workspace C $mod+F3 workspace M } # Switch directly to workspace of another monitor bindsym --to-code { $mod+ctrl+0 exec "~/.local/bin/swws.py 0 -c" $mod+ctrl+1 exec "~/.local/bin/swws.py 1 -c" $mod+ctrl+2 exec "~/.local/bin/swws.py 2 -c" $mod+ctrl+3 exec "~/.local/bin/swws.py 3 -c" $mod+ctrl+4 exec "~/.local/bin/swws.py 4 -c" $mod+ctrl+5 exec "~/.local/bin/swws.py 5 -c" $mod+ctrl+6 exec "~/.local/bin/swws.py 6 -c" $mod+ctrl+7 exec "~/.local/bin/swws.py 7 -c" $mod+ctrl+8 exec "~/.local/bin/swws.py 8 -c" $mod+ctrl+9 exec "~/.local/bin/swws.py 9 -c" } # Move focused container to workspace bindsym --to-code { $mod+Shift+0 exec "~/.local/bin/swws.py 0 -s" $mod+Shift+1 exec "~/.local/bin/swws.py 1 -s" $mod+Shift+2 exec "~/.local/bin/swws.py 2 -s" $mod+Shift+3 exec "~/.local/bin/swws.py 3 -s" $mod+Shift+4 exec "~/.local/bin/swws.py 4 -s" $mod+Shift+5 exec "~/.local/bin/swws.py 5 -s" $mod+Shift+6 exec "~/.local/bin/swws.py 6 -s" $mod+Shift+7 exec "~/.local/bin/swws.py 7 -s" $mod+Shift+8 exec "~/.local/bin/swws.py 8 -s" $mod+Shift+9 exec "~/.local/bin/swws.py 9 -s" $mod+Shift+F2 move container to workspace C $mod+Shift+F3 move container to workspace M } # Move focused container to workspace of another monitor bindsym --to-code { ctrl+$mod+Shift+0 exec "~/.local/bin/swws.py 0 -t" ctrl+$mod+Shift+1 exec "~/.local/bin/swws.py 1 -t" ctrl+$mod+Shift+2 exec "~/.local/bin/swws.py 2 -t" ctrl+$mod+Shift+3 exec "~/.local/bin/swws.py 3 -t" ctrl+$mod+Shift+4 exec "~/.local/bin/swws.py 4 -t" ctrl+$mod+Shift+5 exec "~/.local/bin/swws.py 5 -t" ctrl+$mod+Shift+6 exec "~/.local/bin/swws.py 6 -t" ctrl+$mod+Shift+7 exec "~/.local/bin/swws.py 7 -t" ctrl+$mod+Shift+8 exec "~/.local/bin/swws.py 8 -t" ctrl+$mod+Shift+9 exec "~/.local/bin/swws.py 9 -t" } # # Workspace-monitor assignments # workspace 0 output $pri workspace 1 output $pri workspace 2 output $pri workspace 3 output $pri workspace 4 output $pri workspace 5 output $pri workspace 6 output $pri workspace 7 output $pri workspace 8 output $pri workspace 9 output $pri workspace C output $pri workspace M output $pri workspace 10 output $sec workspace 11 output $sec workspace 12 output $sec workspace 13 output $sec workspace 14 output $sec workspace 15 output $sec workspace 16 output $sec workspace 17 output $sec workspace 18 output $sec workspace 19 output $sec workspace 20 output $ter workspace 21 output $ter workspace 22 output $ter workspace 23 output $ter workspace 24 output $ter workspace 25 output $ter workspace 26 output $ter workspace 27 output $ter workspace 28 output $ter workspace 29 output $ter # # Layout stuff: # bindsym { # 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 # for in-container fullscreen chromium # ref: https://www.reddit.com/r/i3wm/comments/egvj3k/chrome_tabs_not_visible_in_full_screen_mode/fdeps34/ $mod+Shift+f split v; focus parent; fullscreen toggle; focus child # Toggle the current focus between tiling and floating mode #bindsym $mod+Shift+space floating toggle $mod+Shift+d floating toggle # Swap focus between the tiling area and the floating area #bindsym $mod+space focus mode_toggle $mod+d 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. bindsym --to-code { # 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 } # # Resizing containers: # mode "resize" { # left will shrink the containers width # right will grow the containers width # up will shrink the containers height # down will grow the containers height bindsym { $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" $mod+r mode "default" } } bindsym $mod+r mode "resize" bindsym $mod+Shift+r reload # kudos to github.com/rbnis for the following menu-like section inspiration # https://github.com/rbnis/dotfiles/blob/dfd6f956f6d00a1012a3a167d947773095dac7fd/.config/sway/config#L228-L235 set $mode_sys System: (l) lock, (e) logout, (s) suspend, (r) reboot, (S) shutdown mode "$mode_sys" { bindsym { l exec $lock, mode "default" e exit s exec --no-startup-id systemctl suspend -i, mode "default" r exec --no-startup-id systemctl reboot, mode "default" Shift+s exec --no-startup-id systemctl poweroff -i, mode "default" # return to default mode Return mode "default" Escape mode "default" $mod+Shift+e mode "default" } } bindsym $mod+Shift+e mode "$mode_sys" bindsym XF86Sleep exec "systemctl suspend -i" # # media keys # bindsym { --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle;exec notify-send -t3600 'audio muted' --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle;exec notify-send -t 3600 'mic mute toggle' --locked XF86MonBrightnessUp exec light -A 5 --locked XF86MonBrightnessDown exec light -U 5 --locked $mod+Ctrl+p exec playerctl play-pause --locked $mod+Ctrl+n exec playerctl next --locked $mod+Ctrl+Shift+n exec playerctl previous --locked XF86AudioPlay exec playerctl play-pause --locked XF86AudioNext exec playerctl next --locked XF86AudioPrev exec playerctl previous } include /etc/sway/config.d/* include ~/.config/sway/config.d/* # Export environment to systemd and start services. exec "systemctl --user import-environment; systemctl --user start sway-session.target"