2020-05-24 13:27:09 +02:00
# Config for sway
#
### Variables
#
set {
$mod Mod4
$left h
$down j
$up k
$right l
$term kitty
2020-09-28 22:18:04 +02:00
$browser firefox
2020-05-26 18:30:02 +02:00
#$menu rofi -show drun -icon-theme "Papirus-Dark" -show-icons | xargs swaymsg exec --
$menu wofi --show drun | xargs swaymsg exec --
$runmenu wofi --show run | xargs swaymsg exec --
2020-05-24 13:27:09 +02:00
$gnome-schema org.gnome.desktop.interface
2020-09-07 17:55:24 +02:00
$gtk_theme "Matcha-dark-azul"
2020-05-24 13:27:09 +02:00
$icon_theme "Papirus-Dark"
2020-05-26 18:30:02 +02:00
$bg ~/Pictures/drain.jpg
2020-09-28 22:18:04 +02:00
$lockscreen '~/.local/bin/lockscreen'
2020-09-07 17:55:24 +02:00
#$lockscreen 'swaylock --screenshots --clock --indicator --indicator-radius 100 --indicator-thickness 10 --effect-blur 7x5 --effect-vignette 0.4:0.4 --ring-color bb00cc --key-hl-color 880033 --line-color 00000000 --inside-color 00000088 --separator-color 00000000 --grace 2 --fade-in 0.2'
2020-09-08 18:27:52 +02:00
2020-05-25 11:33:07 +02:00
# Heads
2020-05-26 18:30:02 +02:00
$primary eDP-1
2020-05-24 13:27:09 +02:00
}
#
### Autoruns
#
exec_always --no-startup-id {
2020-05-26 18:30:02 +02:00
pkill flashfocus
2020-09-07 17:55:24 +02:00
pkill autotiling
pkill play-with-mpv
eval $(/usr/bin/gnome-keyring-daemon --start --components=ssh)
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
2020-05-24 13:27:09 +02:00
gsettings set $gnome-schema gtk-theme $gtk_theme
gsettings set $gnome-schema icon-theme $icon_theme
2020-05-26 18:30:02 +02:00
gsettings set $gnome-schema font-name 'Cantarell 10'
gsettings set $gnome-schema monospace-font-name 'Anka/Coder 11'
mako --anchor top-right > /tmp/mako.log 2>&1
flashfocus
2020-09-07 17:55:24 +02:00
autotiling
play-with-mpv
2020-05-26 18:30:02 +02:00
evolution
2020-09-07 17:55:24 +02:00
Telegram
2020-05-25 11:33:07 +02:00
swaymsg focus output $primary
2020-05-26 18:30:02 +02:00
swaymsg input 2:7:SynPS/2_Synaptics_TouchPad events disabled
2020-09-07 17:55:24 +02:00
}
exec_always {
2020-09-28 22:18:04 +02:00
swayidle -w timeout 1200 $lockscreen\
before-sleep $lockscreen
2020-05-24 13:27:09 +02:00
}
#
### Output configuration
#
2020-05-25 11:33:07 +02:00
# For desktop
2020-05-26 18:30:02 +02:00
#output $primary pos 1050 200 res 1920x1200
#output $portrait pos 0 0 res 1680x1050
#output $portrait transform 270
2020-05-25 11:33:07 +02:00
# For dankpad
#output $primary pos 0 0 res 1600x900
# For thonkpad
2020-05-26 18:30:02 +02:00
output $primary pos 0 0 res 1920x1080
2020-05-25 11:33:07 +02:00
# Set desktop background for all heads
2020-05-24 13:27:09 +02:00
output * bg $bg fill
2020-09-08 18:27:52 +02:00
#
# Modes:
#
# 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"
}
}
2020-05-24 13:27:09 +02:00
#
### Key bindings
2020-09-08 18:27:52 +02:00
bindsym {
2020-05-24 13:27:09 +02:00
#
# Basics:
#
2020-09-08 18:27:52 +02:00
# Start a terminal
$mod+Return exec $term
2020-09-28 22:18:04 +02:00
# Open a browser window
$mod+w exec $browser
2020-09-08 18:27:52 +02:00
# Kill focused window
$mod+Shift+q kill
# Launcher
$mod+d exec $menu
$mod+shift+d exec $runmenu
# Reload the configuration file
$mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
$mod+Shift+e exec wlogout #swaynag -t warning -m 'Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
#Lock the session
2020-09-28 22:18:04 +02:00
Control+Alt+l exec $lockscreen
2020-09-08 18:27:52 +02:00
#
# Program shortcuts:
2020-05-24 13:27:09 +02:00
#
$mod+c exec gnome-calculator
#
# Moving around:
#
2020-09-08 18:27:52 +02:00
# 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
$mod+comma workspace prev_on_output
$mod+period workspace next_on_output
$mod+tab workspace back_and_forth
# 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
2020-05-24 13:27:09 +02:00
#
# Workspaces:
#
2020-09-08 18:27:52 +02:00
# Switch to workspace
$mod+1 workspace 1
$mod+2 workspace 2
$mod+3 workspace 3
$mod+4 workspace 4
$mod+5 workspace 5
$mod+6 workspace 6
$mod+7 workspace 7
$mod+8 workspace 8
$mod+9 workspace 9
$mod+0 workspace 10
$mod+t workspace 11
$mod+m workspace 12
# Move focused container to workspace
$mod+Shift+1 move container to workspace 1
$mod+Shift+2 move container to workspace 2
$mod+Shift+3 move container to workspace 3
$mod+Shift+4 move container to workspace 4
$mod+Shift+5 move container to workspace 5
$mod+Shift+6 move container to workspace 6
$mod+Shift+7 move container to workspace 7
$mod+Shift+8 move container to workspace 8
$mod+Shift+9 move container to workspace 9
$mod+Shift+0 move container to workspace 10
2020-05-24 13:27:09 +02:00
#
# Layout stuff:
#
2020-09-08 18:27:52 +02:00
# 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
2020-09-28 22:18:04 +02:00
$mod+Shift+w layout tabbed
2020-09-08 18:27:52 +02:00
$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
$mod+Shift+a focus child
# Switch to resize mode
$mod+r mode "resize"
2020-05-24 13:27:09 +02:00
#
# Media keys and screenshots
#
2020-09-08 18:27:52 +02:00
XF86PowerOff exec systemctl suspend
XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
XF86MonBrightnessDown exec brightnessctl set 5%-
XF86MonBrightnessUp exec brightnessctl set +5%
print exec grim ~/Pictures/Screenshots/grim-$(date +'%Y-%m-%d_%H-%M-%S').png
Shift+print exec grim -g "$(slurp)" ~/Pictures/Screenshots/grim-$(date +'%Y-%m-%d_%H-%M-%S').png
XF86LaunchA exec toggle_touchpad.py
2020-05-24 13:27:09 +02:00
#
# 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
2020-09-08 18:27:52 +02:00
$mod+Shift+minus move scratchpad
2020-05-24 13:27:09 +02:00
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
2020-09-08 18:27:52 +02:00
$mod+minus scratchpad show
}
2020-05-24 13:27:09 +02:00
2020-09-08 18:27:52 +02:00
# 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
2020-05-24 13:27:09 +02:00
2020-09-08 18:27:52 +02:00
# Workspace-monitor assignments
workspace 1 output $primary
workspace 2 output $primary
workspace 3 output $primary
workspace 4 output $primary
workspace 5 output $primary
workspace 6 output $primary
workspace 7 output $primary
workspace 8 output $primary
workspace 9 output $primary
workspace 10 output $primary
workspace 11 output $primary
workspace 12 output $primary
# Assign programs to workspaces
assign [app_id="evolution"] 11
assign [app_id="telegramdesktop"] 11
assign [instance="Telegram"] 11
assign [app_id="mpv"] 12
2020-09-28 22:18:04 +02:00
#assign [title="mpv"] 12
2020-05-24 13:27:09 +02:00
#
### Input
#
2020-05-26 18:30:02 +02:00
input 1:1:AT_Translated_Set_2_keyboard {
xkb_options caps:escape
}
input 2:7:SynPS/2_Synaptics_TouchPad {
tap enabled
natural_scroll enabled
scroll_method two_finger
}
2020-05-24 13:27:09 +02:00
focus_follows_mouse yes
2020-05-26 18:30:02 +02:00
focus_wrapping yes
2020-05-24 13:27:09 +02:00
popup_during_fullscreen leave_fullscreen
2020-05-25 11:33:07 +02:00
focus_on_window_activation focus
2020-05-24 13:27:09 +02:00
#
### Look and feel
#
# Gaps
#
gaps inner 2
gaps outer 4
#
# Title Bar
#
titlebar_padding 1
2020-05-26 18:30:02 +02:00
font "Cantarell 10"
2020-05-24 13:27:09 +02:00
#
# Font
#
2020-05-25 11:33:07 +02:00
font pango: Cantarell 12px
2020-05-24 13:27:09 +02:00
#
# Borders
#
default_border pixel 2
default_floating_border pixel 2
#
# Status Bar:
#
bar {
swaybar_command waybar
}
#
2020-05-26 18:30:02 +02:00
# Window settings
#
for_window [class="Brave-browser"] inhibit_idle focus; layout tabbed
2020-09-07 17:55:24 +02:00
for_window [app_id="firefox"] inhibit_idle focus; layout tabbed
2020-05-26 18:30:02 +02:00
#
2020-05-24 13:27:09 +02:00
# Floating windows
#
2020-09-28 22:18:04 +02:00
for_window [title="\ -\ Sharing\ Indicator$"] floating enable, sticky enable
2020-05-24 13:27:09 +02:00
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="matplotlib"] floating enable; border normal $border
for_window [title="ImageMagick.*"] {
floating enable;
border normal $border
title_format " %title"
}
2020-09-07 17:55:24 +02:00
for_window [title="nmtui"] {
border normal $border
resize set width 882
resize set height 600
floating enable
}
for_window [app_id="telegramdesktop"] {
2020-05-26 18:30:02 +02:00
resize set width 600px
}
2020-05-24 13:27:09 +02:00
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
}
2020-09-07 17:55:24 +02:00
for_window [title="Calculator"] floating enable; border pixel 2
2020-05-24 13:27:09 +02:00
2020-09-08 18:27:52 +02:00
for_window [class="Bitwarden"] {
border normal $border
floating enable
resize set width 1200px
resize set height 675px
}
2020-05-24 13:27:09 +02:00
include /etc/sway/config.d/*