Files
dotfiles/.config/sway/config
2025-03-16 21:26:10 +05:00

176 lines
5.9 KiB
Plaintext

# shortcut bindings to app and directions
set $mod Mod4
set $term alacritty
set $menu tofi-drun | xargs swaymsg exec --
set $left h
set $down j
set $up k
set $right l
# autostart
exec copyq --start-server
exec waybar
exec dunst
exec_always autotiling
# fix audio mute on start
exec sleep 7s && amixer -c 0 set Front unmute
exec sleep 7s && amixer -c 1 set Front unmute
# display & bg config
# you can get the names of your outputs by running: swaymsg -t get_outputs
output DP-2 position 1920 0 mode 2560x1440@144Hz
output HDMI-A-1 position 0 360 mode 1920x1080@60Hz
output * bg /home/nikita/Pictures/wallpapers/nord-street.png fill
# input configuration
# 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.
input "1133:16505:Logitech_G_Pro" {
pointer_accel 0
accel_profile "flat"
}
input type:keyboard {
repeat_rate 35
repeat_delay 500
xkb_layout us,ru
xkb_options grp:lalt_lshift_toggle,caps:escape
}
# key bindings
# start a terminal
bindsym --to-code $mod+Return exec $term
# kill focused window
bindsym --to-code $mod+Shift+q kill
# start your launcher
bindsym --to-code $mod+d exec $menu
# app shortcuts
bindsym --to-code $mod+b exec librewolf
bindsym --to-code $mod+m exec $term -e ncmpcpp
bindsym --to-code $mod+e exec $term -e neomutt
bindsym --to-code $mod+n exec $term -e newsboat
# powermenu
bindsym --to-code $mod+SHIFT+BackSpace exec ~/.config/tofi/powermenu.sh
# drag floating windows by holding down $mod and left mouse button.
# resize them with right mouse button + $mod.
floating_modifier $mod normal
# reload the configuration file
bindsym --to-code $mod+Shift+r reload
# exit sway (logs you out of your wayland session)
bindsym --to-code $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'
# style
gaps outer 15
gaps inner 10
default_border pixel 2
client.focused #7e9cd8 #7e9cd8 #ffffff #7e9cd8 #7e9cd8
client.unfocused #1f1f28 #1f1f28 #888888 #1f1f28 #1f1f28
client.urgent #1f1f28 #1f1f28 #888888 #1f1f28 #1f1f28
client.focused_inactive #1f1f28 #1f1f28 #888888 #1f1f28 #1f1f28
# move mouse to focused window/workspace
mouse_warping output
focus_wrapping workspace
# hide cursor after ... time
seat * hide_cursor 5000
# move your focus around
bindsym --to-code $mod+$left focus left
bindsym --to-code $mod+$down focus down
bindsym --to-code $mod+$up focus up
bindsym --to-code $mod+$right focus right
# move the focused window with the same, but add shift
bindsym --to-code $mod+Shift+$left move left
bindsym --to-code $mod+Shift+$down move down
bindsym --to-code $mod+Shift+$up move up
bindsym --to-code $mod+Shift+$right move right
# switch focus to other monitor
bindsym --to-code $mod+i focus output left
# workspaces
# change focus between workspaces
bindsym --to-code --no-warn $mod+1 exec "swaysome focus 1"
bindsym --to-code --no-warn $mod+2 exec "swaysome focus 2"
bindsym --to-code --no-warn $mod+3 exec "swaysome focus 3"
bindsym --to-code --no-warn $mod+4 exec "swaysome focus 4"
bindsym --to-code --no-warn $mod+5 exec "swaysome focus 5"
bindsym --to-code --no-warn $mod+6 exec "swaysome focus 6"
bindsym --to-code --no-warn $mod+7 exec "swaysome focus 7"
bindsym --to-code --no-warn $mod+8 exec "swaysome focus 8"
bindsym --to-code --no-warn $mod+9 exec "swaysome focus 9"
bindsym --to-code --no-warn $mod+0 exec "swaysome focus 0"
# move containers between workspaces
bindsym --to-code --no-warn $mod+Shift+1 exec "swaysome move 1"
bindsym --to-code --no-warn $mod+Shift+2 exec "swaysome move 2"
bindsym --to-code --no-warn $mod+Shift+3 exec "swaysome move 3"
bindsym --to-code --no-warn $mod+Shift+4 exec "swaysome move 4"
bindsym --to-code --no-warn $mod+Shift+5 exec "swaysome move 5"
bindsym --to-code --no-warn $mod+Shift+6 exec "swaysome move 6"
bindsym --to-code --no-warn $mod+Shift+7 exec "swaysome move 7"
bindsym --to-code --no-warn $mod+Shift+8 exec "swaysome move 8"
bindsym --to-code --no-warn $mod+Shift+9 exec "swaysome move 9"
bindsym --to-code --no-warn $mod+Shift+0 exec "swaysome move 0"
# Move focused container to other monitor
bindsym --to-code $mod+p exec "swaysome next-output"
# init workspaces for every screen plugin
exec "swaysome init 1"
# make the current focus fullscreen
bindsym --to-code $mod+f fullscreen
# toggle the current focus between tiling and floating mode
bindsym --to-code $mod+Shift+space floating toggle
# swap focus between the tiling area and the floating area
bindsym --to-code $mod+space focus mode_toggle
# resizing containers
bindsym --to-code $mod+y resize shrink width 5ppt
bindsym --to-code $mod+o resize grow width 5ppt
# bindsym --to-code $up resize shrink height 10px
# bindsym --to-code $right resize grow width 10px
# utilities
# special keys to adjust volume via pulseaudio
bindsym --to-code $mod+Shift+bracketleft exec playerctl -p mpd volume 0.05-
bindsym --to-code $mod+Shift+bracketright exec playerctl -p mpd volume 0.05+
bindsym --to-code --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
bindsym --to-code --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
bindsym --to-code --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
bindsym --to-code --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
bindsym --to-code --locked XF86AudioPlay exec playerctl play-pause
bindsym --to-code --locked XF86AudioPause exec playerctl play-pause
bindsym --to-code --locked XF86AudioNext exec playerctl next
bindsym --to-code --locked XF86AudioPrev exec playerctl previous
# special key to take a screenshot with grim
bindsym --to-code $mod+Shift+s exec grim -g "$(slurp)" - | wl-copy
# try to make DP-2 monitor primary for xwayland apps
exec xrandr --output DP-2 --primary
exec_always sleep 10s && xrandr --output DP-2 --primary
include /etc/sway/config.d/*