Compare commits

...

2 Commits

Author SHA1 Message Date
bec07d6fea Fully modularize sway configs 2024-04-17 01:35:18 -05:00
6494402d57 Modularize sway configs 2024-04-17 01:27:21 -05:00
10 changed files with 211 additions and 223 deletions

View File

@ -1,235 +1,21 @@
# #
# Salt's Sway configuration file # Salt's Sway configuration file
# Licensed under the terms of the MIT License #
# NOTE
# Any further configuration that isn't just declaring a global should be
# done via the creation of a file in config.d.
#
# Note that you can also override system-provided configs by making an
# identically-named file in config.d
# #
# Configs ## CONFIGS
set $term foot set $term foot
## WINDOW RULES
for_window {
[app_id="org.mozilla.firefox"] move container to workspace $w1
[app_id="org.mozilla.Thunderbird"] move container to workspace $w7
[app_id="org.keepassxc.KeePassXC"] move container to workspace $w8
[app_id="com.discordapp.Discord"] move container to workspace $w9
[app_id="com.discordapp.Discord"] inhibit_idle visible
[class="Element"] move container to workspace $w9
[class="Element"] inhibit_idle visible
[class="Spotify"] move container to workspace $w10
}
## COSMETICS
font pango:IBM Plex Sans 12
default_border pixel 4
titlebar_border_thickness 4
focus_on_window_activation none
gaps inner 8
set $red #fb4934
set $green #b8bb26
set $yellow #fabd2f
set $blue #83a598
set $magenta #de869b
set $cyan #8ec07c
set $white #ebdbb2
set $black #282828
set $gray #32302f
# See sway(5) for details on these
# Border color of the view itself v
# Indicator color (like for v/h split) v
# Titlebar text color v
# Titlebar backgrouond color v
# Titlebar border color v
# <colorclass> <brd> <bg> <text> <ind> <chld>
# The currently focused window
client.focused $blue $blue $black $gray $blue
# The most recently focused view in an unfocused container
client.focused_inactive $gray $black $white $gray $gray
# Any other unfocused views
client.unfocused $gray $gray $white $gray $gray
# Any view with an urgency hint
client.urgent $yellow $black $white $gray $yellow
## KEYBINDINGS
# Set modifiers # Set modifiers
set $mod Mod1 set $mod Mod1
set $sup Mod4 set $sup Mod4
set $ctl Ctrl set $ctl Ctrl
set $shift Shift set $shift Shift
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# Program opening and closing
bindsym $mod+Return exec "$term"
bindsym $mod+q kill
bindsym $mod+space exec "rofi -show drun"
bindsym $mod+backslash exec "rofi -show ssh"
bindsym $mod+Tab exec "rofi -show window"
# Dunst management
bindsym $mod+$shift+space exec dunstctl close
bindsym $mod+$shift+Return exec dunstctl close-all
bindsym $mod+$shift+d exec dunstctl history-pop
bindsym $mod+$shift+o exec dunstctl context
# Pulse controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
# Screenshots
bindsym $mod+o exec grim -g "$(slurp -d)" - | wl-copy
# Brightness controls
#bindsym XF86MonBrightnessUp exec xbacklight -inc 5 # increase screen brightness
#bindsym XF86MonBrightnessDown exec xbacklight -dec 5 # decrease screen brightness
# pavucontrol-qt controls
bindsym $mod+p exec --no-startup-id "pgrep pavucontrol || pavucontrol"
bindsym $mod+$shift+p exec --no-startup-id "pkill pavucontrol"
# Miscellaneous non-movement hotkeys
bindsym $ctl+$mod+l exec --no-startup-id "loginctl lock-session"
bindsym $mod+$shift+c reload
# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# move focused window
bindsym $mod+$shift+h move left
bindsym $mod+$shift+j move down
bindsym $mod+$shift+k move up
bindsym $mod+$shift+l move right
# move focused workspace between monitors
bindsym $sup+h move workspace to output left
bindsym $sup+j move workspace to output down
bindsym $sup+k move workspace to output up
bindsym $sup+l move workspace to output right
# split in horizontal orientation
bindsym $mod+semicolon split h
# split in vertical orientation
bindsym $mod+v split v
# toggle tiling / floating
bindsym $mod+f floating toggle
# enter fullscreen mode for the focused container
bindsym $mod+$shift+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
# focus the parent container
bindsym $mod+a focus parent
# focus the child container
bindsym $mod+d focus child
# switch to workspace
bindsym $mod+1 workspace $w1
bindsym $mod+2 workspace $w2
bindsym $mod+3 workspace $w3
bindsym $mod+4 workspace $w4
bindsym $mod+5 workspace $w5
bindsym $mod+6 workspace $w6
bindsym $mod+7 workspace $w7
bindsym $mod+8 workspace $w8
bindsym $mod+9 workspace $w9
bindsym $mod+0 workspace $w10
# switch to next and previous workspaces
bindsym $mod+period workspace next
bindsym $mod+comma workspace prev
# move focused container to workspace
bindsym $mod+$shift+1 move container to workspace $w1
bindsym $mod+$shift+2 move container to workspace $w2
bindsym $mod+$shift+3 move container to workspace $w3
bindsym $mod+$shift+4 move container to workspace $w4
bindsym $mod+$shift+5 move container to workspace $w5
bindsym $mod+$shift+6 move container to workspace $w6
bindsym $mod+$shift+7 move container to workspace $w7
bindsym $mod+$shift+8 move container to workspace $w8
bindsym $mod+$shift+9 move container to workspace $w9
bindsym $mod+$shift+0 move container to workspace $w10
## INPUTS
# Mice
#input "type:pointer" {
# accel_profile flat # Disables mouse acceleration
# pointer_accel 0.000 # Set a sens that I like
#}
input "type:touchpad" {
drag enabled
dwt disabled
tap enabled
tap_button_map lrm
}
# Keyboards
input "type:keyboard" {
xkb_capslock disabled
xkb_numlock enabled
}
## OUTPUTS
# Wallpaper
output * bg ~/Pictures/Wallpapers/.current fill
## MODES
# Resize
bindsym $mod+r mode "resize"
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
## STARTUP APPLICATIONS
# Put them here
## OS-SPECIFIC INCLUDES
# Lifted from Fedora
# ---
# Include configs from 3 locations:
# - /usr/share/sway/config.d
# - /etc/sway/config.d
# - $XDG_CONFIG_HOME/sway/config.d ($HOME/.config/sway/config.d)
#
# If multiple directories contain the files with the same name, the later
# directory takes precedence; `$XDG_CONFIG_HOME/sway/config.d/20-swayidle.conf`
# will always be loaded instead of `/usr/share/sway/config.d/20-swayidle.conf`
# or `/etc/sway/config.d/20-swayidle.conf`
#
# This mechanism permits overriding our default configuration per-system
# (/etc) or per-user ($XDG_CONFIG_HOME) basis. Just create the file you
# want to modify/override in the higher-level directory.
#
# For example, to disable the default bar from Fedora configs, you'll need to
# $ echo -n > "$HOME/.config/sway/config.d/90-bar.conf"
#
# Note the quoting, the $() and the arguments quoting. All the parts are equally
# important to make the magic work. And if you want to learn the secret behind
# the trick, it's all in the `wordexp(3)`.
#
include '$(/usr/libexec/sway/layered-include "/usr/share/sway/config.d/*.conf" "/etc/sway/config.d/*.conf" "${XDG_CONFIG_HOME:-$HOME/.config}/sway/config.d/*.conf")' include '$(/usr/libexec/sway/layered-include "/usr/share/sway/config.d/*.conf" "/etc/sway/config.d/*.conf" "${XDG_CONFIG_HOME:-$HOME/.config}/sway/config.d/*.conf")'
include "${XDG_CONFIG_HOME:-$HOME/.config}/sway/machine.d/$HOSTNAME.conf" include "${XDG_CONFIG_HOME:-$HOME/.config}/sway/machine.d/$HOSTNAME.conf"

View File

@ -0,0 +1,89 @@
# vim: set ft=swayconfig:
#
# This file holds keybinds for all of swaywm
#
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# Program opening and closing
bindsym $mod+Return exec "$term"
bindsym $mod+q kill
bindsym $mod+space exec "rofi -show drun"
bindsym $mod+backslash exec "rofi -show ssh"
bindsym $mod+Tab exec "rofi -show window"
# Dunst management
bindsym $mod+$shift+space exec dunstctl close
bindsym $mod+$shift+Return exec dunstctl close-all
bindsym $mod+$shift+d exec dunstctl history-pop
bindsym $mod+$shift+o exec dunstctl context
# Pulse controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
# Screenshots
bindsym $mod+o exec grim -g "$(slurp -d)" - | wl-copy
# Brightness controls
#bindsym XF86MonBrightnessUp exec xbacklight -inc 5 # increase screen brightness
#bindsym XF86MonBrightnessDown exec xbacklight -dec 5 # decrease screen brightness
# pavucontrol controls
bindsym $mod+p exec --no-startup-id "pgrep pavucontrol || pavucontrol"
bindsym $mod+$shift+p exec --no-startup-id "pkill pavucontrol"
# Miscellaneous non-movement hotkeys
bindsym $ctl+$mod+l exec --no-startup-id "loginctl lock-session"
bindsym $mod+$shift+c reload
# Change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
# Move the focused window around
bindsym $mod+$shift+h move left
bindsym $mod+$shift+j move down
bindsym $mod+$shift+k move up
bindsym $mod+$shift+l move right
# Move the focused workspace between monitors
# Disabled here because I like having workspaces allocated to certain outputs
#bindsym $sup+h move workspace to output left
#bindsym $sup+j move workspace to output down
#bindsym $sup+k move workspace to output up
#bindsym $sup+l move workspace to output right
# Configure the split of this container
bindsym $mod+semicolon split h
bindsym $mod+v split v
# Toggle floating
bindsym $mod+f floating toggle
# Fullscreen
bindsym $mod+$shift+f fullscreen toggle
# Change the layout of this container
# Disabled because I just fatfinger these, they're never useful in my workflow
#bindsym $mod+s layout stacking
#bindsym $mod+w layout tabbed
#bindsym $mod+e layout toggle split
# Focus the parent container. Lets you move groups at a time
bindsym $mod+a focus parent
# Focus the child container
bindsym $mod+d focus child
# Switch between workspaces
bindsym $mod+1 workspace $w1
bindsym $mod+2 workspace $w2
bindsym $mod+3 workspace $w3
bindsym $mod+4 workspace $w4
bindsym $mod+5 workspace $w5
bindsym $mod+6 workspace $w6
bindsym $mod+7 workspace $w7
bindsym $mod+8 workspace $w8
bindsym $mod+9 workspace $w9
bindsym $mod+0 workspace $w10
bindsym $mod+period workspace next
bindsym $mod+comma workspace prev
# Move the focused container to a specific workspace
bindsym $mod+$shift+1 move container to workspace $w1
bindsym $mod+$shift+2 move container to workspace $w2
bindsym $mod+$shift+3 move container to workspace $w3
bindsym $mod+$shift+4 move container to workspace $w4
bindsym $mod+$shift+5 move container to workspace $w5
bindsym $mod+$shift+6 move container to workspace $w6
bindsym $mod+$shift+7 move container to workspace $w7
bindsym $mod+$shift+8 move container to workspace $w8
bindsym $mod+$shift+9 move container to workspace $w9
bindsym $mod+$shift+0 move container to workspace $w10

View File

@ -0,0 +1,22 @@
# vim: set ft=swayconfig:
#
# This file stores global confguration for input devices
#
# Mice
#input "type:pointer" {
# accel_profile flat # Disables mouse acceleration
# pointer_accel 0.000 # Set a sens that I like
#}
input "type:touchpad" {
drag enabled
dwt disabled
tap enabled
tap_button_map lrm
}
# Keyboards
input "type:keyboard" {
xkb_capslock disabled
xkb_numlock enabled
}

View File

@ -0,0 +1,38 @@
# vim: set ft=swayconfig:
#
# This file controls all theming within swaywm, including colors, gaps,
# borders, fonts, etc.
#
# Right now we're staring at a nice gruvbox theme
#
font pango:IBM Plex Sans 12
default_border pixel 4
titlebar_border_thickness 4
focus_on_window_activation none
gaps inner 8
set $red #fb4934
set $green #b8bb26
set $yellow #fabd2f
set $blue #83a598
set $magenta #de869b
set $cyan #8ec07c
set $white #ebdbb2
set $black #282828
set $gray #32302f
# See sway(5) for details on these
# Border color of the view itself v
# Indicator color (like for v/h split) v
# Titlebar text color v
# Titlebar backgrouond color v
# Titlebar border color v
# <colorclass> <brd> <bg> <text> <ind> <chld>
# The currently focused window
client.focused $blue $blue $black $gray $blue
# The most recently focused view in an unfocused container
client.focused_inactive $gray $black $white $gray $gray
# Any other unfocused views
client.unfocused $gray $gray $white $gray $gray
# Any view with an urgency hint
client.urgent $yellow $black $white $gray $yellow

View File

@ -0,0 +1,24 @@
# vim: set ft=swayconfig:
#
# This file stores "modes" for sway, such as for resizing
#
# Resize
bindsym $mod+r mode "resize"
mode "resize" {
bindsym h resize shrink width 10 px or 10 ppt
bindsym j resize grow height 10 px or 10 ppt
bindsym k resize shrink height 10 px or 10 ppt
bindsym l resize grow width 10 px or 10 ppt
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Down resize grow height 10 px or 10 ppt
bindsym Up resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}

View File

@ -0,0 +1,4 @@
# vim: set ft=swayconfig:
# Wallpaper
output * bg ~/Pictures/Wallpapers/.current fill

View File

@ -0,0 +1,16 @@
# vim: set ft=swayconfig:
#
# This file allocates rules for organizing windows
#
for_window {
[app_id="org.mozilla.firefox"] move container to workspace $w1
[app_id="org.mozilla.Thunderbird"] move container to workspace $w7
[app_id="org.keepassxc.KeePassXC"] move container to workspace $w8
[app_id="com.discordapp.Discord"] move container to workspace $w9
[app_id="com.discordapp.Discord"] inhibit_idle visible
[class="Element"] move container to workspace $w9
[class="Element"] inhibit_idle visible
[class="Spotify"] move container to workspace $w10
}

View File

@ -1,3 +1,5 @@
# vim: set ft=swayconfig:
#
# Idle and lock configuration # Idle and lock configuration
# #
# This will lock your screen after 300 seconds of inactivity, then turn off # This will lock your screen after 300 seconds of inactivity, then turn off

View File

@ -1,5 +1,10 @@
# vim: set ft=swayconfig: # vim: set ft=swayconfig:
# wlsunset(1) #
# wlsunset is more or less redshift. It reddens the screen as the day draws
# to a close.
#
# For customization, see wlsunset(1)
#
exec wlsunset \ exec wlsunset \
-T 5300 \ -T 5300 \
-t 3500 \ -t 3500 \

View File

@ -0,0 +1,2 @@
# vim: set ft=swayconfig: