267 lines
8.8 KiB
Cheetah
Raw Normal View History

2023-04-01 16:23:45 -07:00
# sway config file (v4)
# TODO: add scratchpads (terminal, password manager, discord, task)
#-------------------------------------------------------------------------------
#----- VARIABLES
#-------------------------------------------------------------------------------
set $HOME /home/{{ .user }}
2023-04-01 16:23:45 -07:00
2023-11-05 09:44:45 -08:00
set $DISP_SEC DP-2
set $DISP_PRI HDMI-A-1
2023-04-01 16:23:45 -07:00
2023-05-20 09:16:45 -07:00
set $BOR_WIDTH 3
set $GAP_INNER 3
2023-04-01 16:23:45 -07:00
set $mod Mod4
set $tag1 "1:game"
set $tag2 "2:dev"
set $tag3 "3:web"
set $tag4 "4:note"
2023-04-01 16:23:45 -07:00
set $tag5 "5:web"
set $tag6 "6:web"
set $tag7 "7:web"
2023-04-01 16:23:45 -07:00
set $tag8 "8:comm"
2023-04-03 14:00:04 -07:00
set $e exec swaymsg mode default
2023-04-01 16:23:45 -07:00
set $mode_power "[r]eboot | [s]hutdown"
2023-06-24 17:57:19 -07:00
set $TERM alacritty
2023-04-01 16:23:45 -07:00
#-------------------------------------------------------------------------------
#----- COLORS
#-------------------------------------------------------------------------------
2023-05-20 09:16:45 -07:00
set $background #282A36
set $foreground #F8F8F2
set $focused #bd93f9
set $inactive #44475A
set $urgent #FF5555
2023-07-10 17:52:34 -07:00
set $workspace #50FA7B
2023-04-01 16:23:45 -07:00
2023-05-20 09:16:45 -07:00
# class border bground text indicator child_border
client.focused $focused $focused $foreground $focused $focused
client.focused_inactive $inactive $inactive $foreground $inactive $inactive
client.unfocused $background $background $foreground $background $background
client.urgent $inactive $urgent $foreground $urgent $urgent
client.placeholder $background $background $foreground $background $background
client.background $foreground
2023-04-01 16:23:45 -07:00
#-------------------------------------------------------------------------------
#----- MISC. CONFIGURATION
#-------------------------------------------------------------------------------
2023-05-20 09:16:45 -07:00
font pango:JetBrains Mono Nerd Font 10
2023-04-01 16:23:45 -07:00
default_border pixel 3
default_floating_border pixel 3
#-------------------------------------------------------------------------------
#----- BINDING WORKSPACE TO DISPLAY
#-------------------------------------------------------------------------------
workspace $tag1 output $DISP_PRI
workspace $tag2 output $DISP_PRI
workspace $tag3 output $DISP_PRI
workspace $tag4 output $DISP_PRI
workspace $tag5 output $DISP_SEC
workspace $tag6 output $DISP_SEC
workspace $tag7 output $DISP_SEC
workspace $tag8 output $DISP_SEC
#-------------------------------------------------------------------------------
#----- CONTAINER GAPS
#-------------------------------------------------------------------------------
# CREATING GAPS BETWEEN THE WINDOWS AND EDGES
gaps inner $GAP_INNER
gaps outer 0
gaps horizontal 0
gaps vertical 0
gaps top 0
gaps bottom 0
gaps right 0
gaps left 0
#-------------------------------------------------------------------------------
#----- FORCE FLOATING
#-------------------------------------------------------------------------------
for_window [title="Steam - News"] floating enable
for_window [title="Friends List"] floating enable
2023-10-07 02:16:26 -07:00
for_window [title=".*mpv$"] sticky toggle
for_window [title=".*mpv$"] floating enable
2023-04-01 16:23:45 -07:00
2023-06-24 17:57:19 -07:00
for_window [app_id="file"] floating enable, \
border pixel 5, \
resize set 70 ppt 60 ppt, \
move position center, \
move to scratchpad, \
scratchpad show
2023-04-01 16:23:45 -07:00
#-------------------------------------------------------------------------------
#----- BINDING APPLICATIONS TO WORKSPACE
#-------------------------------------------------------------------------------
2023-09-10 11:43:47 -07:00
for_window [class="Steam"] move container to workspace "1:game"
for_window [class="discord"] move container to workspace $tag8
for_window [class="obsidian"] move container to workspace $tag4
for_window [title="launcher"] floating enable
2023-04-01 16:23:45 -07:00
#-------------------------------------------------------------------------------
#----- KEY BINDINGS
#-------------------------------------------------------------------------------
2023-07-30 08:33:11 -07:00
# Power commands
2023-04-01 16:23:45 -07:00
bindsym $mod+p mode $mode_power
mode $mode_power {
2023-05-25 22:01:36 -07:00
bindsym s exec shutdown now
bindsym r exec reboot
2023-04-01 16:23:45 -07:00
bindsym Escape mode default
}
2023-07-30 08:33:11 -07:00
# Utility commands
2023-04-01 16:23:45 -07:00
bindsym $mod+x mode utility
mode utility {
bindsym q exit
bindsym r reload
2023-05-20 09:16:45 -07:00
bindsym g exec "~/.config/sway/scripts/gamemode.sh", $e
bindsym v exec "~/bin/linux-toggle-vpn", $e
2023-04-01 16:23:45 -07:00
bindsym Escape mode default
}
2023-07-30 08:33:11 -07:00
# Layout commands
2023-04-01 16:23:45 -07:00
bindsym $mod+Ctrl+t splitv; layout tabbed
bindsym $mod+Ctrl+v layout splitv
bindsym $mod+Ctrl+s layout splith
bindsym $mod+Ctrl+h resize shrink width 50
bindsym $mod+Ctrl+j resize shrink height 50
bindsym $mod+Ctrl+k resize grow height 50
bindsym $mod+Ctrl+l resize grow width 50
bindsym $mod+Ctrl+c move position center
2023-07-30 08:33:11 -07:00
# Program management
2023-04-01 16:23:45 -07:00
bindsym $mod+d kill
bindsym $mod+f fullscreen toggle
bindsym $mod+t floating toggle
bindsym $mod+s sticky toggle
bindsym $mod+Tab focus mode_toggle
floating_modifier $mod
2023-07-30 08:33:11 -07:00
# Spatial container management
2023-05-20 09:16:45 -07:00
bindsym $mod+h exec ~/.config/sway/scripts/tabfocus.sh "h"
bindsym $mod+j exec ~/.config/sway/scripts/tabfocus.sh "j"
bindsym $mod+k exec ~/.config/sway/scripts/tabfocus.sh "k"
bindsym $mod+l exec ~/.config/sway/scripts/tabfocus.sh "l"
2023-04-01 16:23:45 -07:00
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right
bindsym $mod+minus split v
bindsym $mod+backslash split h
2023-05-20 09:16:45 -07:00
bindsym $mod+z splith; layout tabbed; focus parent
bindsym $mod+Shift+z layout default
2023-04-01 16:23:45 -07:00
2023-07-30 08:33:11 -07:00
# Workspace management
2023-04-01 16:23:45 -07:00
bindsym $mod+1 workspace $tag1
bindsym $mod+2 workspace $tag2
bindsym $mod+3 workspace $tag3
bindsym $mod+4 workspace $tag4
bindsym $mod+q workspace $tag5
bindsym $mod+w workspace $tag6
bindsym $mod+e workspace $tag7
bindsym $mod+r workspace $tag8
bindsym $mod+Shift+1 move container to workspace $tag1
bindsym $mod+Shift+2 move container to workspace $tag2
bindsym $mod+Shift+3 move container to workspace $tag3
bindsym $mod+Shift+4 move container to workspace $tag4
bindsym $mod+Shift+q move container to workspace $tag5
bindsym $mod+Shift+w move container to workspace $tag6
bindsym $mod+Shift+e move container to workspace $tag7
bindsym $mod+Shift+r move container to workspace $tag8
2023-07-30 08:33:11 -07:00
# Audio
2023-05-20 09:16:45 -07:00
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
2023-04-01 16:23:45 -07:00
2023-07-30 08:33:11 -07:00
# Open applications
2023-04-01 16:23:45 -07:00
bindsym $mod+Return exec alacritty
bindsym $mod+a mode launcher
mode launcher {
2023-11-05 09:44:45 -08:00
bindsym r exec alacritty --title launcher -e ~/bin/linux-app-launcher, $e
2023-05-20 09:16:45 -07:00
bindsym Escape mode default
}
2023-04-01 16:23:45 -07:00
bindsym $mod+o mode open
mode open {
bindsym b exec chromium, $e
bindsym o exec obsidian, $e
2023-06-08 16:48:27 -07:00
bindsym s exec steam || flatpak run com.valvesoftware.Steam, $e
bindsym d exec discord || flatpak run com.discordapp.Discord, $e
2023-10-07 02:16:26 -07:00
bindsym m exec mpv $(wl-paste), $e
2023-04-01 16:23:45 -07:00
bindsym Escape mode default
}
2023-09-10 11:43:47 -07:00
for_window [con_mark="SCRATCHPAD_jop"] border pixel 1
2023-07-30 08:33:11 -07:00
# Scratchpads commands
2023-04-01 16:23:45 -07:00
bindsym $mod+c mode scratch
mode scratch {
bindsym Return exec sway-scratchpad \
2023-06-08 16:48:27 -07:00
--command "alacritty" \
--mark term \
--width 40 \
--height 71, $e
bindsym b exec sway-scratchpad \
2023-06-08 16:48:27 -07:00
--command "blueman-manager" \
--mark blue \
--width 40 \
--height 71, $e
bindsym f exec sway-scratchpad \
--command "alacritty -e tmuxp load /home/{{ .user }}/.config/tmuxp/files.yml" \
2023-06-24 17:57:19 -07:00
--mark files \
--width 71 \
--height 71, $e
2023-09-02 12:38:32 -07:00
bindsym d exec sway-scratchpad \
--command "alacritty -e tmuxp load /home/{{ .user }}/.config/tmuxp/dot.yml" \
--mark dot \
--width 90 \
--height 90, $e
2023-06-24 17:57:19 -07:00
bindsym Shift+c move scratchpad, $e
bindsym c scratchpad show, $e
2023-04-01 16:23:45 -07:00
bindsym Escape mode default
}
2023-07-23 14:34:39 -07:00
output $DISP_PRI {
2023-04-03 14:00:04 -07:00
resolution 2560x1440@143.973Hz
2023-11-09 15:50:08 -08:00
position 2560,0
2023-04-03 14:00:04 -07:00
}
2023-07-30 08:33:11 -07:00
output $DISP_SEC {
resolution 2560x1440@143.912Hz
position 0,0
}
2023-05-20 09:16:45 -07:00
bar {
position top
tray_output none
pango_markup enabled
2023-07-30 08:33:11 -07:00
status_command while ~/.config/sway/scripts/status.sh; do sleep 1; done
2023-05-20 09:16:45 -07:00
colors {
background #000000
2023-07-10 17:52:34 -07:00
focused_workspace $workspace $workspace $background
2023-05-20 09:16:45 -07:00
}
}
2023-04-01 16:23:45 -07:00
#-------------------------------------------------------------------------------
#----- AUTOSTART WITH I3
#-------------------------------------------------------------------------------
2023-07-30 08:33:11 -07:00
#exec_always --no-startup-id "configure-gtk"
2023-05-13 16:15:13 -07:00
exec_always --no-startup-id "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK"
2023-07-10 17:52:34 -07:00
exec_always --no-startup-id "swaybg -i ~/media/pictures/wallpapers/solar_system_wallpapers/mars.png"
2023-05-20 09:16:45 -07:00
exec --no-startup-id "~/.config/sway/scripts/idle.sh"
2023-06-24 17:57:19 -07:00
exec --no-startup-id "udiskie"