sisyphus/config/sway

372 lines
11 KiB
Text
Raw Normal View History

2022-04-22 15:27:36 +02:00
#
# .config/sway/config
#
# Personal config for sway
# Requires noto-fonts-cjk
2022-04-22 15:27:36 +02:00
# =========
# Autostart
# =========
2022-05-05 09:53:08 +02:00
input type:keyboard {
2022-04-22 15:27:36 +02:00
xkb_layout "be"
}
input 2:7:SynPS/2_Synaptics_TouchPad {
natural_scroll enabled
scroll_factor 0.6
middle_emulation enabled
tap enabled
2022-04-22 15:27:36 +02:00
}
# Set background to whatever file is named bg at the moment
2022-05-05 09:53:08 +02:00
output * {
2022-05-25 10:46:34 +02:00
bg "~/Pictures/wallpapers/bg.*" fill
2022-05-05 09:53:08 +02:00
}
2022-06-02 15:50:03 +02:00
output 'Dell Inc. DELL P2214H 29C2937M4YTL' {
# Vertical monitor
transform 270
}
2022-05-05 09:53:08 +02:00
# Hide the cursor when typing
seat seat0 {
hide_cursor when-typing enable
}
2022-04-22 15:27:36 +02:00
2022-06-02 11:47:06 +02:00
exec_always "~/.scripts/idle.sh"
2022-04-22 15:27:36 +02:00
# Notification manager
exec wired
2022-04-22 15:27:36 +02:00
# Set warm colours at night
2022-06-02 11:47:06 +02:00
exec "~/.scripts/wlsunset.sh"
2022-04-22 15:27:36 +02:00
# exec blueman-applet
# xwayland disable
# I will keep using xwayland because it allows far better backwards compatibilty for a ton of apps
# that I use on a daily basis. Also, it only seemed to take 50MB of RAM on 'idle', which I am willing
# to offer.
2022-04-22 15:27:36 +02:00
focus_follows_mouse no
# =========
# Variables
# =========
set $alt Mod1
set $winkey Mod4
set $term alacritty
2022-05-05 09:53:08 +02:00
2022-06-02 11:47:06 +02:00
set $notify exec "~/.scripts/notify.sh"
2022-04-22 15:27:36 +02:00
# ================
# Window shortcuts
# ================
# Change focus
bindsym $winkey+Left focus left
bindsym $winkey+Down focus down
bindsym $winkey+Up focus up
bindsym $winkey+Right focus right
# Alternative keys
2022-05-02 11:57:04 +02:00
bindsym $winkey+h focus left
bindsym $winkey+j focus down
bindsym $winkey+k focus up
bindsym $winkey+l focus right
2022-04-22 15:27:36 +02:00
# Move focused window
bindsym $winkey+Shift+Left move left
bindsym $winkey+Shift+Down move down
bindsym $winkey+Shift+Up move up
bindsym $winkey+Shift+Right move right
# Alternative keys
2022-05-02 11:57:04 +02:00
bindsym $winkey+Shift+h move left
bindsym $winkey+Shift+j move down
bindsym $winkey+Shift+k move up
bindsym $winkey+Shift+l move right
2022-04-22 15:27:36 +02:00
# Layouts
bindsym $winkey+w layout toggle split
bindsym $winkey+x layout tabbed
2022-05-02 11:57:04 +02:00
bindsym $winkey+c split h
2022-04-22 15:27:36 +02:00
bindsym $winkey+v split v
bindsym $winkey+a focus parent
bindsym $winkey+b focus mode_toggle
bindsym $winkey+f floating enable, border normal 2
bindsym $winkey+Shift+f floating disable, border pixel 2
bindsym $winkey+p sticky toggle
2022-05-02 11:34:20 +02:00
2022-04-22 15:27:36 +02:00
bindsym $winkey+Next move scratchpad
bindsym $winkey+Prior scratchpad show
# Resize window menu
mode "resize" {
2022-04-28 13:43:42 +02:00
bindsym l resize grow width 10 px or 10 ppt
2022-05-02 11:57:04 +02:00
bindsym k resize grow height 10 px or 10 ppt
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize shrink height 10 px or 10 ppt
2022-04-22 15:27:36 +02:00
bindsym Shift+l resize grow width 50 px or 50 ppt
2022-05-02 11:57:04 +02:00
bindsym Shift+k resize grow height 50 px or 50 ppt
bindsym Shift+h resize shrink width 50 px or 50 ppt
bindsym Shift+j resize shrink height 50 px or 50 ppt
2022-04-22 15:27:36 +02:00
2022-04-28 13:43:42 +02:00
# Alternative keys
bindsym Up resize grow height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize shrink height 10 px or 10 ppt
2022-04-22 15:27:36 +02:00
bindsym Shift+Up resize grow height 50 px or 50 ppt
bindsym Shift+Right resize grow width 50 px or 50 ppt
bindsym Shift+Left resize shrink width 50 px or 50 ppt
bindsym Shift+Down resize shrink height 50 px or 50 ppt
# Window movement
2022-05-02 11:57:04 +02:00
bindsym $winkey+h move left
bindsym $winkey+j move down
2022-04-22 15:27:36 +02:00
bindsym $winkey+l move right
2022-05-02 11:57:04 +02:00
bindsym $winkey+k move up
2022-04-22 15:27:36 +02:00
# Alternative keys
bindsym $winkey+Left move left
bindsym $winkey+Down move down
bindsym $winkey+Right move right
bindsym $winkey+Up move up
2022-04-28 13:43:42 +02:00
# Go back
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $winkey+r mode "default"
2022-04-22 15:27:36 +02:00
}
bindsym $winkey+r mode "resize"
# ==========
# Workspaces
# ==========
# TODO Switch workspace to output
# TODO Switch window to workspace
# TODO Rename workspace
set $ws0 0:¯\_(ツ)_/¯
# Move to this workspace on startup
workspace $ws0
2022-04-22 15:27:36 +02:00
# Define names for default workspaces for which we configure key bindings later on.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
set $ws10 "10"
# switch to workspace
bindsym $winkey+ampersand workspace number $ws1
bindsym $winkey+eacute workspace number $ws2
bindsym $winkey+quotedbl workspace number $ws3
bindsym $winkey+apostrophe workspace number $ws4
bindsym $winkey+parenleft workspace number $ws5
bindsym $winkey+section workspace number $ws6
bindsym $winkey+egrave workspace number $ws7
bindsym $winkey+exclam workspace number $ws8
bindsym $winkey+ccedilla workspace number $ws9
bindsym $winkey+agrave workspace number $ws10
bindsym $winkey+parenright workspace $ws0
2022-04-22 15:27:36 +02:00
bindsym $winkey+Control+Right workspace next_on_output
bindsym $winkey+Control+Left workspace prev_on_output
bindsym $winkey+Control+Up focus output 'HDMI-A-1'
bindsym $winkey+Control+Down focus output 'eDP-1'
2022-04-22 15:27:36 +02:00
2022-05-05 09:53:08 +02:00
# Alternative keys
bindsym $winkey+Control+j workspace next_on_output
bindsym $winkey+Control+k workspace prev_on_output
bindsym $winkey+Control+l focus output 'HDMI-A-1'
bindsym $winkey+Control+h focus output 'eDP-1'
2022-05-05 09:53:08 +02:00
2022-04-22 15:27:36 +02:00
# move focused container to workspace
bindsym $winkey+Shift+ampersand move container to workspace number $ws1; \
workspace number $ws1
2022-04-22 15:27:36 +02:00
bindsym $winkey+Shift+eacute move container to workspace number $ws2; \
workspace number $ws2
2022-04-22 15:27:36 +02:00
bindsym $winkey+Shift+quotedbl move container to workspace number $ws3; \
workspace number $ws3
2022-04-22 15:27:36 +02:00
bindsym $winkey+Shift+apostrophe move container to workspace number $ws4; \
workspace number $ws4
2022-04-22 15:27:36 +02:00
bindsym $winkey+Shift+5 move container to workspace number $ws5; \
workspace number $ws5
2022-04-22 15:27:36 +02:00
bindsym $winkey+Shift+section move container to workspace number $ws6; \
workspace number $ws6
2022-04-22 15:27:36 +02:00
bindsym $winkey+Shift+egrave move container to workspace number $ws7; \
workspace number $ws7
2022-04-22 15:27:36 +02:00
bindsym $winkey+Shift+exclam move container to workspace number $ws8; \
workspace number $ws8
2022-04-22 15:27:36 +02:00
bindsym $winkey+Shift+ccedilla move container to workspace number $ws9; \
workspace number $ws9
2022-04-22 15:27:36 +02:00
bindsym $winkey+Shift+agrave move container to workspace number $ws10; \
workspace number $ws10
bindsym $winkey+Shift+parenright move container to workspace $ws0; \
workspace $ws0
2022-04-22 15:27:36 +02:00
bindsym $winkey+Control+Shift+Right move container to workspace next; workspace next
bindsym $winkey+Control+Shift+Left move container to workspace prev; workspace prev
bindsym $winkey+Control+Shift+Up move container to output 'HDMI-A-1'; focus output 'HDMI-A-1'
bindsym $winkey+Control+Shift+Down move container to output 'eDP-1'; focus output 'eDP-1'
2022-04-22 15:27:36 +02:00
2022-05-05 09:53:08 +02:00
# Alternative keys
bindsym $winkey+Control+Shift+j move container to workspace next_on_output; \
workspace next_on_output
bindsym $winkey+Control+Shift+k move container to workspace prev_on_output; \
workspace prev_on_output
bindsym $winkey+Control+Shift+l move container to output 'HDMI-A-1'; \
focus output 'HDMI-A-1'
bindsym $winkey+Control+Shift+h move container to output 'eDP-1'; \
focus output 'eDP-1'
2022-05-05 09:53:08 +02:00
2022-04-22 15:27:36 +02:00
# ==============
# System Control
# ==============
bindsym $alt+Shift+r reload
bindsym $alt+Shift+e exec swaynag -t warning -m 'Do you really want to exit sway?' -B 'Yes, exit sway' 'swaymsg exit'
# Kill focused window
2022-06-01 19:18:54 +02:00
bindsym $winkey+q kill
2022-04-22 15:27:36 +02:00
# Start a terminal
bindsym $winkey+Return exec alacritty
# Start application launcher
bindsym $alt+space exec alacritty --title 'FZF-Jump' -e ~/.scripts/fzf-jump/fzf-jump-launch.sh
2022-04-22 15:27:36 +02:00
# Brightness
bindsym --locked XF86MonBrightnessDown exec brightnessctl -e s 5%- && $notify -b
bindsym --locked XF86MonBrightnessUp exec brightnessctl -e s +5% && $notify -b
# Media control
bindsym F7 exec --no-startup-id playerctl play-pause
bindsym Shift+XF86AudioLowerVolume exec --no-startup-id playerctl previous
bindsym Shift+XF86AudioRaiseVolume exec --no-startup-id playerctl next
# Volume control
2022-06-02 11:47:06 +02:00
bindsym XF86AudioRaiseVolume exec --no-startup-id pulsemixer --change-volume +2 --max-volume 100 && $notify -v
bindsym XF86AudioLowerVolume exec --no-startup-id pulsemixer --change-volume -2 && $notify -v
bindsym XF86AudioMute exec --no-startup-id pulsemixer --toggle-mute && $notify -v
2022-04-28 13:43:42 +02:00
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
2022-04-22 15:27:36 +02:00
# Lockscreen
2022-05-31 23:14:59 +02:00
bindsym $winkey+Delete exec --no-startup-id swaylock
2022-04-22 15:27:36 +02:00
2022-06-02 11:47:06 +02:00
# =====
# Modes
# =====
# System actions
set $mode_system System (l)ock, (s)leep, (h)ibernate, (r)eboot, (Shift+s)hutdown
2022-04-22 15:27:36 +02:00
mode "$mode_system" {
bindsym l exec --no-startup-id swaylock; mode "default"
bindsym s exec --no-startup-id systemctl suspend; mode "default"
bindsym h exec --no-startup-id systemctl hibernate; mode "default"
bindsym r exec --no-startup-id systemctl reboot; mode "default"
bindsym Shift+s exec --no-startup-id systemctl poweroff -i; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
2022-04-22 15:27:36 +02:00
}
bindsym Control+$alt+Delete mode "$mode_system"
2022-05-25 10:46:34 +02:00
# Screenshots
set $mode_screenshot Screenshot of (a)rea, current (w)indow, (s)creen - Shift to save
set $save_format Pictures/Screenshots/$(date +%F)-$(date +%T).png
mode "$mode_screenshot" {
bindsym a exec grimshot copy area; mode "default"
bindsym w exec grimshot --notify copy active; mode "default"
bindsym s exec grimshot --notify copy screen; mode "default"
bindsym Shift+a exec grimshot --notify save area $save_format; mode "default"
bindsym Shift+w exec grimshot --notify save active $save_format; mode "default"
bindsym Shift+s exec grimshot --notify save screen $save_format; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
2022-05-25 10:46:34 +02:00
}
bindsym Print mode "$mode_screenshot"
2022-06-02 11:47:06 +02:00
# Some preferences
set $mode_preferences Toggle (s)unset, (n)otifications, (f)ocus
mode "$mode_preferences" {
bindsym s exec "~/.scripts/wlsunset.sh"; mode "default"
bindsym n exec "~/.scripts/dnd.sh"; mode "default"
bindsym f exec "~/.scripts/focus.sh"; mode "default"
bindsym Return mode "default"
bindsym Escape mode "default"
2022-06-02 11:47:06 +02:00
}
bindsym $alt+end mode "$mode_preferences"
2022-04-22 15:27:36 +02:00
# =======
# Styling
# =======
2022-05-31 23:14:59 +02:00
font pango:monospace 2
2022-04-22 15:27:36 +02:00
bar {
swaybar_command /usr/bin/waybar
mode hide
2022-04-22 15:27:36 +02:00
}
default_border pixel 2
2022-05-31 23:14:59 +02:00
default_floating_border normal 2
2022-04-22 15:27:36 +02:00
hide_edge_borders both
smart_borders on
2022-04-22 15:27:36 +02:00
# Toggle Show title
bindsym $alt+Next border pixel 2
bindsym $alt+Prior border normal 2
2022-05-31 23:14:59 +02:00
# Mimic no titles
# Classi border backgr text indic. child_border
client.focused #000000 #00897b #00897b #00897b #000000
client.focused_inactive #000000 #222222 #484e50 #484e50 #000000
client.unfocused #000000 #222222 #292d2e #292d2e #000000
2022-04-22 15:27:36 +02:00
exec gsettings set org.gnome.desktop.interface icon-theme 'Win11-black'
2022-04-25 22:56:06 +02:00
exec gsettings set org.gnome.desktop.interface gtk-theme 'Nordic'
2022-04-22 15:27:36 +02:00
# =====================
# Window configurations
# =====================
for_window [window_role="pop-up"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [class="Qalculate-gtk"] floating enable
for_window [class="Caprine"] floating enable; border normal 2
2022-04-22 15:27:36 +02:00
# Homewritten software testing in IntelliJ
for_window [class="be.ugent"] floating enable
2022-06-07 12:04:52 +02:00
for_window [title="^FZF-Jump$"] floating enable; border pixel 0; resize set 600 350
2022-04-22 15:27:36 +02:00
2022-04-24 23:14:58 +02:00
# =====
2022-04-22 15:27:36 +02:00
# FIXES
2022-04-24 23:14:58 +02:00
# =====
2022-04-22 15:27:36 +02:00
# [Slow launch for some GTK apps](https://github.com/swaywm/sway/issues/5732)
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
# Fix JetBrain IDE's showing properly
exec wmname LG3D