dotfiles/.config/sway/config

430 lines
16 KiB
Plaintext
Raw Normal View History

2021-12-06 13:16:02 +02:00
#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 kitty
# 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 --
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# Example configuration:
#
# output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs
### Idle configuration
#
# Example configuration:
#
2022-09-10 16:13:56 +03:00
#exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
# before-sleep 'swaylock -f -c 000000'
2021-12-06 13:16:02 +02:00
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+Shift+q kill
# Start your launcher
bindsym $mod+d exec $menu
# 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
# Reload the configuration file
bindsym $mod+Shift+c reload
# Exit sway (logs you out of your Wayland session)
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'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
#
# Workspaces:
#
# # Switch to workspace
# bindsym $mod+1 workspace number 1
# bindsym $mod+2 workspace number 2
# bindsym $mod+3 workspace number 3
# bindsym $mod+4 workspace number 4
# bindsym $mod+5 workspace number 5
# bindsym $mod+6 workspace number 6
# bindsym $mod+7 workspace number 7
# bindsym $mod+8 workspace number 8
# bindsym $mod+9 workspace number 9
# bindsym $mod+0 workspace number 10
# # Move focused container to workspace
# bindsym $mod+Shift+1 move container to workspace number 1
# bindsym $mod+Shift+2 move container to workspace number 2
# bindsym $mod+Shift+3 move container to workspace number 3
# bindsym $mod+Shift+4 move container to workspace number 4
# bindsym $mod+Shift+5 move container to workspace number 5
# bindsym $mod+Shift+6 move container to workspace number 6
# bindsym $mod+Shift+7 move container to workspace number 7
# bindsym $mod+Shift+8 move container to workspace number 8
# bindsym $mod+Shift+9 move container to workspace number 9
# bindsym $mod+Shift+0 move container to workspace number 10
# # Note: workspaces can have any name you want, not just numbers.
# # We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b splith
bindsym $mod+v splitv
# Switch the current container between different layout styles
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# Make the current focus fullscreen
bindsym $mod+f 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
bindsym $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
bindsym $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.
bindsym $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
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#######################################################################
# lanxu's modifications
#######################################################################
# Linear accel force
input type:pointer {
accel_profile "flat"
pointer_accel 0
}
set $menu wofi --lines=10 --show=drun --allow-images --insensitive
set $ws1 "1:term"
set $ws2 "2:irc"
set $ws3 "3:net"
set $ws4 "4:gfx"
set $ws5 "5:steam"
set $ws6 "6:lutris"
set $ws7 "7:x"
set $ws8 "8:x"
set $ws9 "9:pw"
set $ws10 "10:tray"
# switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# Assignments
assign [app_id="^firefox$"] → $ws3
2022-09-10 16:13:56 +03:00
assign [app_id="^librewolf$"] → $ws3
2021-12-06 13:16:02 +02:00
assign [app_id="^cantata$"] → $ws10
assign [app_id="^org.keepassxc.KeePassXC$" title="^Avaa tietokanta"] → $ws3
assign [app_id="^org.keepassxc.KeePassXC$" title="(?!Avaa tietokanta)"] → $ws9
assign [app_id="^pavucontrol$"] → $ws10
2022-09-10 16:13:56 +03:00
assign [app_id="^blueman-manager$"] → $ws10
2021-12-06 13:16:02 +02:00
assign [app_id="^lutris$"] → $ws6
2022-09-10 16:13:56 +03:00
assign [app_id="com.nextcloud.desktopclient.nextcloud"] → $ws10
assign [app_id="^Element$"] → $ws2
2021-12-06 13:16:02 +02:00
assign [class="^krita$"] → $ws4
assign [class="^Blender$"] → $ws4
assign [class="^Gimp$"] → $ws4
assign [class="^Nextcloud$"] → $ws10
assign [class="^Element$"] → $ws2
# Modifiers
for_window [app_id="telegramdesktop" title="(.*)Telegram(.*)"] floating enable, move scratchpad
# for_window [app_id="telegramdesktop" title=".*(?<!Media viewer)$"] floating enable, move scratchpad
for_window [app_id="mpv"] floating enable, move position center
for_window [app_id="net.sourceforge.mumble.mumble"] floating enable, move position center
for_window [app_id="imv"] floating enable
for_window [app_id="com.nextcloud.desktopclient.nextcloud"] floating enable, move position mouse, move down 25px
2022-09-10 16:13:56 +03:00
for_window [app_id="opensnitch_ui"] floating enable, move position center
2021-12-06 13:16:02 +02:00
for_window [class="itch"] floating enable
# for_window [class="Wine"] floating enable
for_window [class="vlc"] floating enable
# services
#for_window [class="Nextcloud"] floating enable, move position center, move scratchpad
for_window [class="cantata"] floating disable
for_window [class="boincmgr"] floating disable
# Games
for_window [class="kfgame.exe"] floating enable
2022-09-10 16:13:56 +03:00
for_window [class="noita.exe"] floating enable
for_window [class="^galaxyclient.exe$"] floating enable
for_window [class="epicgameslauncher.exe"] floating enable
2021-12-06 13:16:02 +02:00
for_window [class="Origin"] floating enable
for_window [class="^steam_app"] floating enable
for_window [class="Wine"] floating enable
for_window [class="Proton"] floating enable
for_window [class="Melvor Idle"] floating enable
for_window [app_id="AlienIsolation"] floating enable
for_window [app_id="FeralLinuxMessage"] floating enable
for_window [title="SRHK"] floating enable
# Steam
# https://github.com/ValveSoftware/steam-for-linux/issues/1040
for_window [class="^Steam$" title="^Friends$"] floating enable
for_window [class="^Steam$" title="Steam - News"] floating enable
for_window [class="^Steam$" title=".* - Chat"] floating enable
for_window [class="^Steam$" title="^Settings$"] floating enable
for_window [class="^Steam$" title=".* - event started"] floating enable
for_window [class="^Steam$" title=".* CD key"] floating enable
for_window [class="^Steam$" title="^Steam - Self Updater$"] floating enable
for_window [class="^Steam$" title="^Screenshot Uploader$"] floating enable
for_window [class="^Steam$" title="^Steam Guard - Computer Authorization Required$"] floating enable
for_window [title="^Steam Keyboard$"] floating enable
for_window [class="^Steam$"] move container to workspace $ws5
for_window [title="^Friends List$"] move container to workspace $ws5, floating enable, resize set width 400px
mouse_warping none
# Special keysyms
bindsym $mod+t [app_id="telegramdesktop"] scratchpad show
bindsym $mod+n [class="^Nextcloud"] scratchpad show
# gaps
2022-09-10 16:13:56 +03:00
#smart_borders off
#smart_gaps on
#gaps outer 0
#gaps inner 10
2021-12-06 13:16:02 +02:00
# Basic bar configuration using the Base16 variables.
bar {
swaybar_command waybar
}
2022-09-10 16:13:56 +03:00
include /home/lanxu/.config/sway/base16-gruvbox-dark-medium.config
2021-12-06 13:16:02 +02:00
# Basic color configuration using the Base16 variables for windows and borders.
# Property Name Border BG Text Indicator Child Border
client.focused $base05 $base0D $base00 $base0D $base0C
client.focused_inactive $base01 $base01 $base05 $base03 $base01
client.unfocused $base01 $base00 $base05 $base01 $base01
client.urgent $base08 $base08 $base00 $base08 $base08
client.placeholder $base00 $base00 $base05 $base00 $base00
client.background $base07
default_border pixel 1
# Removes all borders
for_window [class=".*"] border pixel 0
exec --no-startup-id "dunst" # in case multiple daemons are installed
# Services
exec --no-startup-id "mpd /home/lanxu/.config/mpd/mpd.conf" # Music Player Daemon
2022-09-10 16:13:56 +03:00
exec --no-startup-id "systemd-run --user --unit=fullscreen-inhibitor --on-calendar='*:*:0/15' /home/lanxu/Scripts/sway/fullscreen-inhibitor.sh" # Fullscreen inhibitor for dunst
2021-12-06 13:16:02 +02:00
#exec --no-startup-id "./Scripts/sway_screensaver.sh" # Screensaver
exec --no-startup-id "udiskie --notify --automount" # Automounter
# Background software
exec --no-startup-id "cantata"
exec --no-startup-id "pavucontrol"
exec --no-startup-id "keepassxc" # Password manager
exec --no-startup-id "nextcloud --background"
2022-09-10 16:13:56 +03:00
exec --no-startup-id "gammastep -l 61.49911:23.78712" # blue light filter, flickers
2021-12-06 13:16:02 +02:00
# Applications
exec --no-startup-id "dex -a -s ~/.config/autostart/"
2022-09-10 16:13:56 +03:00
# exec --no-startup-id "telegram-desktop" # Added to autostart
# exec --no-startup-id "element-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland" # Added to autostart
# exec --no-startup-id "steam" # Should be done with autostart
2021-12-06 13:16:02 +02:00
# Set manual layout for tray workspace
#exec --no-startup-id "i3-msg 'workspace 10:tray; append_layout /home/lanxu/.config/i3/tray.json'"
2022-09-10 16:13:56 +03:00
set $locker 'swaylock -f -c 000000'
exec swayidle -w \
timeout 60 $locker \
timeout 65 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep $locker
2021-12-06 13:16:02 +02:00
bindsym XF86AudioStop exec --no-startup-id mpc stop
bindsym XF86AudioPlay exec --no-startup-id mpc toggle
bindsym XF86AudioPause exec --no-startup-id mpc pause
bindsym XF86AudioNext exec --no-startup-id mpc next
bindsym XF86AudioPrev exec --no-startup-id mpc prev
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle
# Print screen
2022-09-10 16:13:56 +03:00
bindsym $mod+F8 exec --no-startup-id "./Scripts/sway/take_screencast.sh region-copy"
bindsym $mod+Shift+F8 exec --no-startup-id "./Scripts/sway/take_screencast.sh region"
2021-12-06 13:16:02 +02:00
bindsym $mod+Print exec --no-startup-id "./Scripts/sway/take_screenshot.sh region-copy"
bindsym $mod+Shift+Print exec --no-startup-id "./Scripts/sway/take_screenshot.sh region"
bindsym Print exec --no-startup-id "./Scripts/sway/take_screenshot.sh screen"
#bindsym Print exec --no-startup-id flameshot gui
#bindsym Scroll_Lock exec --no-startup-id "./Scripts/powermenu.sh"
2022-09-10 16:13:56 +03:00
# With Keychron Scroll_Lock is assigned automatically to mod+c (microphone on windows)
2021-12-06 13:16:02 +02:00
bindsym $mod+c exec --no-startup-id "./Scripts/powermenu.sh"
# Moving desktops
bindsym $mod+o move workspace to output left
bindsym $mod+Ctrl+Right move workspace to output right
bindsym $mod+Ctrl+Left move workspace to output left
2022-09-10 16:13:56 +03:00
## One screen
##output HDMI-A-1 disable
#output HDMI-A-2 disable
##output DP-2 pos 0 0 res 1920x1080@60Hz adaptive_sync on
#output DP-2 pos 0 0 res 1920x1080@120Hz adaptive_sync on
# Two screens
output HDMI-A-1 pos 0 0 res 1920x1080
output HDMI-A-2 disable
#output HDMI-A-1 disable
#output HDMI-A-2 pos 0 0 res 1920x1080
output DP-2 pos 1920 0 res 1920x1080@144Hz adaptive_sync on
#output DP-2 pos 0 0 res 1920x1080@144Hz adaptive_sync on
# Other
#output DVI-D-1 pos 0 0 res 1920x1080
2021-12-06 13:16:02 +02:00
#output DP-2 pos 1920 0 res 1920x1080@60Hz adaptive_sync off
#output DP-2 disable
#output DVI-D-1 disable
#output HDMI-A-1 disable
#output HDMI-A-1 pos 3840 0 res 1680x1050
#output HDMI-A-2 pos 5520 0 res 1920x1080 # TV
#output HDMI-A-2 pos 3840 0 res 1920x1080 # TV
2022-09-10 16:13:56 +03:00
output "*" bg "/home/lanxu/.config/sway/background2022.jpg" fill
#max_render_time 5
2021-12-06 13:16:02 +02:00
# inhibits
# wayland
for_window [app_id=".*"] inhibit_idle fullscreen
# xwayland
for_window [class=".*"] inhibit_idle fullscreen
exec_always "/home/lanxu/Scripts/import-gsettings"
# default includes
include /etc/sway/config.d/*