Files
dotfiles/.config/sway/config

271 lines
9.2 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
# start daemons
exec copyq --start-server
# exec waybar
exec dunst
exec playerctld daemon
exec_always autotiling
# subscribe to ntfy notifications
exec ~/Scripts/ntfy/ntfy_subscribe.sh &
# start xwayland at session start to make DP-2 monitor primary
xwayland force
exec xrandr --output DP-2 --primary
bar {
id 1
tray_output none
font Input Nerd Font 9
status_command "~/Scripts/sway/bar.sh"
gaps 0 6 0 0
colors {
# focused_workspace #7E9CD8 #7E9CD8 #AAAAAA
}
}
# display & bg config
# you can get the names of your outputs by running: swaymsg -t get_outputs
output DP-2 position 0 0 mode 2560x1440@144Hz
output HDMI-A-1 position 2560 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 type:pointer {
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 msg create-window || $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 msg create-window --class in_scratchpad -e ncmpcpp || $term --class in_scratchpad -e ncmpcpp
bindsym --to-code $mod+e exec $term msg create-window -e neomutt || $term -e neomutt
bindsym --to-code $mod+n exec $term msg create-window -e newsboat || $term -e newsboat
# open windows with id "in_scratchpad" in scratchpad
for_window [app_id="in_scratchpad"] move container to scratchpad, focus
# # open apps in specified workspaces
assign [class="steam"] workspace 15
assign [app_id="DBeaver"] workspace 22
assign [class="jetbrains-datagrip"] workspace 23
assign [app_id="taxsee.im.desktop*"] workspace 24
assign [app_id="Element"] workspace number 25
assign [class="Element"] workspace number 25
# powermenu
bindsym --to-code $mod+SHIFT+BackSpace exec ~/Scripts/tofi/powermenu.sh
# vpn selector
bindsym --to-code $mod+SHIFT+v exec ~/Scripts/tofi/select_vpn.sh
# start search in browser
bindsym --to-code $mod+slash exec ~/Scripts/general/bin/browser_search_web
# get password from store
bindsym --to-code $mod+Shift+p exec ~/Scripts/tofi/get_password.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
# bind workspaces to specific outputs
workspace 10 output DP-2
workspace 11 output DP-2
workspace 12 output DP-2
workspace 13 output DP-2
workspace 14 output DP-2
workspace 15 output DP-2
workspace 16 output DP-2
workspace 17 output DP-2
workspace 18 output DP-2
workspace 19 output DP-2
workspace 10 output DP-2
workspace 21 output HDMI-A-1
workspace 22 output HDMI-A-1
workspace 23 output HDMI-A-1
workspace 24 output HDMI-A-1
workspace 25 output HDMI-A-1
workspace 26 output HDMI-A-1
workspace 27 output HDMI-A-1
workspace 28 output HDMI-A-1
workspace 29 output HDMI-A-1
workspace 20 output HDMI-A-1
# 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"
bindsym --to-code --no-warn $mod+1 workspace 11
bindsym --to-code --no-warn $mod+2 workspace 12
bindsym --to-code --no-warn $mod+3 workspace 13
bindsym --to-code --no-warn $mod+4 workspace 14
bindsym --to-code --no-warn $mod+5 workspace 15
bindsym --to-code --no-warn $mod+6 workspace 16
bindsym --to-code --no-warn $mod+7 workspace 17
bindsym --to-code --no-warn $mod+8 workspace 18
bindsym --to-code --no-warn $mod+9 workspace 19
bindsym --to-code --no-warn $mod+0 workspace 10
bindsym --to-code --no-warn $mod+Alt+1 workspace 21
bindsym --to-code --no-warn $mod+Alt+2 workspace 22
bindsym --to-code --no-warn $mod+Alt+3 workspace 23
bindsym --to-code --no-warn $mod+Alt+4 workspace 24
bindsym --to-code --no-warn $mod+Alt+5 workspace 25
bindsym --to-code --no-warn $mod+Alt+6 workspace 26
bindsym --to-code --no-warn $mod+Alt+7 workspace 27
bindsym --to-code --no-warn $mod+Alt+8 workspace 28
bindsym --to-code --no-warn $mod+Alt+9 workspace 29
# does not work,
# bindsym --to-code --no-warn $mod+Shift_R+1 workspace 21
# bindsym --to-code --no-warn $mod+Shift_R+2 workspace 22
# bindsym --to-code --no-warn $mod+Shift_R+3 workspace 23
# bindsym --to-code --no-warn $mod+Shift_R+4 workspace 24
# bindsym --to-code --no-warn $mod+Shift_R+5 workspace 25
# bindsym --to-code --no-warn $mod+Shift_R+6 workspace 26
# bindsym --to-code --no-warn $mod+Shift_R+7 workspace 27
# bindsym --to-code --no-warn $mod+Shift_R+8 workspace 28
# bindsym --to-code --no-warn $mod+Shift_R+9 workspace 29
# 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 $mod+Shift+y exec playerctl -p mpd shuffle Toggle
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
bindsym --to-code --locked Shift+XF86AudioPlay exec mpc toggle
bindsym --to-code --locked Shift+XF86AudioPause exec mpc toggle
bindsym --to-code --locked Shift+XF86AudioNext exec mpc next
bindsym --to-code --locked Shift+XF86AudioPrev exec mpc prev
# special key to take a screenshot with grim
bindsym --to-code $mod+Shift+s exec grim -g "$(slurp)" - | wl-copy
include /etc/sway/config.d/*