diff options
Diffstat (limited to 'dots/sway/.config')
-rw-r--r-- | dots/sway/.config/sway/bindings.j2 | 80 | ||||
-rw-r--r-- | dots/sway/.config/sway/config | 11 | ||||
-rw-r--r-- | dots/sway/.config/sway/config.d/10-autostart-applications | 47 | ||||
-rw-r--r-- | dots/sway/.config/sway/config.d/bindings.j2 | 151 | ||||
-rw-r--r-- | dots/sway/.config/sway/config.d/swayfx | 14 | ||||
-rw-r--r-- | dots/sway/.config/sway/config.d/theme | 23 |
6 files changed, 326 insertions, 0 deletions
diff --git a/dots/sway/.config/sway/bindings.j2 b/dots/sway/.config/sway/bindings.j2 new file mode 100644 index 0000000..27b7960 --- /dev/null +++ b/dots/sway/.config/sway/bindings.j2 @@ -0,0 +1,80 @@ +set $mod {{ window_manager.key.mod }} +set $mov {{ window_manager.key.mov }} + +set $left h +set $down j +set $up k +set $right l + +set $browser zen +set $term alacritty +set $filemanager pcmanfm + +set $launcher wofi + +bindsym --to-code { + $mod+Shift+r reload + + $mod+Return exec $term + $mod+m exec $filemanager + $mod+d exec $menu + + $mod+f fullscreen + $mod+v layout tabbed +} + +bindsym --to-code { + $mod+$left focus left + $mod+$down focus down + $mod+$up focus up + $mod+$right focus right + + $mod+$mov+$left move left + $mod+$mov+$down move down + $mod+$mov+$up move up + $mod+$mov+$right move right +} + +bindsym --to-code { +{% for name, ws in window_manager.workspaces.items() %} + $mod+{{ ws.key }} workspace number {{ ws.order }} + $mod+$mov+{{ ws.key }} move container to workspace number {{ ws.order }} +{% endfor %} +} + +bindsym --to-code $mod+Shift+minus move scratchpad +bindsym --to-code $mod+minus scratchpad show + +mode "resize" { + bindsym --to-code { + $left resize shrink width 10px + $down resize grow height 10px + $up resize shrink height 10px + $right resize grow width 10px + + Return mode "default" + Escape mode "default" + } +} + +bindsym --to-code $mod+n mode "resize" + +bindsym { + XF86AudioRaiseVolume exec volumectl -u up + XF86AudioLowerVolume exec volumectl -u down + XF86AudioMute exec volumectl toggle-mute + XF86AudioMicMute exec volumectl -m toggle-mute +} + +bindsym { + XF86MonBrightnessUp exec lightctl up + XF86MonBrightnessDown exec lightctl down +} + +bindsym { + XF86AudioPlay exec playerctl play + XF86AudioPause exec playerctl pause + XF86AudioNext exec playerctl next + XF86AudioPrev exec playerctl previous +} + diff --git a/dots/sway/.config/sway/config b/dots/sway/.config/sway/config new file mode 100644 index 0000000..1548946 --- /dev/null +++ b/dots/sway/.config/sway/config @@ -0,0 +1,11 @@ +# Config for sway +# +# Read `man 5 sway` for a complete reference. + +# user config directory +include $HOME/.config/sway/config.d/* +include $HOME/.config/sway/user/* +include /etc/sway/outputs/* + +# only enable this if every app you use is compatible with wayland +# xwayland disable diff --git a/dots/sway/.config/sway/config.d/10-autostart-applications b/dots/sway/.config/sway/config.d/10-autostart-applications new file mode 100644 index 0000000..ef4009c --- /dev/null +++ b/dots/sway/.config/sway/config.d/10-autostart-applications @@ -0,0 +1,47 @@ +# exec $HOME/.config/sway/scripts/startup_config.sh +# exec wmname LG3D + +# TODO: auth with polkit-kde-agent +# Auth with polkit-gnome: +# exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 + +# Desktop notifications +exec mako -c ~/.config/mako/ + +# GTK3 applications take a long time to start +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK +exec hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK + +# Idle settings +exec swayidle -w \ + timeout 500 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + timeout 700 'systemctl suspend' + +# Gnome Keyring +exec gnome-keyring-daemon --daemonize --start --components=gpg,pkcs11,secrets,ssh + +exec_always { + # poweralert + '[ -x "$(command -v poweralertd)" ] && pkill poweralertd; poweralertd -s -i "line power" &' + + # playerctl + '[ -x "$(command -v playerctl)" ] && pkill playerctl; playerctl -a metadata --format \'{{status}} {{title}}\' --follow | while read line; do pkill -RTMIN+5 waybar; done' +} + +exec { + # mounting daemon + '[ -x "$(command -v pcmanfm)" ] && pcmanfm -d' + + # xdg user dirs + '[ -x "$(command -v xdg-user-dirs-update)" ] && exec xdg-user-dirs-update' +} + + +# Status Bars: + +exec nm-applet --indicator +bar { + swaybar_command waybar +} diff --git a/dots/sway/.config/sway/config.d/bindings.j2 b/dots/sway/.config/sway/config.d/bindings.j2 new file mode 100644 index 0000000..246b80f --- /dev/null +++ b/dots/sway/.config/sway/config.d/bindings.j2 @@ -0,0 +1,151 @@ +set $mod Mod1 + +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l + +set $browser zen +set $term alacritty +set $filemanager pcmanfm + +set $launcher wofi + +bindsym --to-code { + $mod+Shift+r reload + + $mod+Return exec $term + + $mod+d exec $menu + + # f + $mod+f fullscreen + + # n + $mod+n exec $filemanager + + # v + $mod+v layout tabbed +} + +bindsym --to-code { + $mod+$left focus left + $mod+$down focus down + $mod+$up focus up + $mod+$right focus right + + $mod+Shift+$left move left + $mod+Shift+$down move down + $mod+Shift+$up move up + $mod+Shift+$right move right +} + +# Workspaces: +bindsym --to-code { + + # Switch to workspace + $mod+1 workspace number 1 + $mod+2 workspace number 2 + $mod+3 workspace number 3 + $mod+4 workspace number 4 + $mod+5 workspace number 5 + $mod+6 workspace number 6 + $mod+7 workspace number 7 + $mod+8 workspace number 8 + $mod+9 workspace number 9 + $mod+0 workspace number 10 + + # Move focused container to workspace + $mod+Shift+1 move container to workspace number 1 + $mod+Shift+2 move container to workspace number 2 + $mod+Shift+3 move container to workspace number 3 + $mod+Shift+4 move container to workspace number 4 + $mod+Shift+5 move container to workspace number 5 + $mod+Shift+6 move container to workspace number 6 + $mod+Shift+7 move container to workspace number 7 + $mod+Shift+8 move container to workspace number 8 + $mod+Shift+9 move container to workspace number 9 + $mod+Shift+0 move container to workspace number 10 +} + +# Scratchpad: +# Move the currently focused window to the scratchpad +bindsym --to-code $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 --to-code $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 --to-code { + $left resize shrink width 10px + $down resize grow height 10px + $up resize shrink height 10px + $right resize grow width 10px + + # Ditto, with arrow keys + Left resize shrink width 10px + Down resize grow height 10px + Up resize shrink height 10px + Right resize grow width 10px + + # Return to default mode + Return mode "default" + Escape mode "default" + } +} + +bindsym --to-code $mod+r mode "resize" + +# Resize floating windows with mouse scroll: +bindsym --to-code --whole-window --border { + $mod+button4 resize shrink height 5 px or 5 ppt + $mod+button5 resize grow height 5 px or 5 ppt + $mod+shift+button4 resize shrink width 5 px or 5 ppt + $mod+shift+button5 resize grow width 5 px or 5 ppt +} + +# Volume + # bindsym --to-code XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% + # bindsym --to-code XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% + # bindsym --to-code XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle # mute sound + + #wob +# bindsym { +# XF86AudioRaiseVolume exec pamixer -ui 10 && pamixer --get-volume > $SWAYSOCK.wob +# XF86AudioLowerVolume exec pamixer -ud 10 && pamixer --get-volume > $SWAYSOCK.wob +# XF86AudioMute exec pamixer --toggle-mute && ( pamixer --get-mute && echo 0 > $SWAYSOCK.wob ) || pamixer --get-volume > $SWAYSOCK.wob +# } +# +# # Backlight +# #wob +# bindsym { +# XF86MonBrightnessUp exec light -A 10 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob +# XF86MonBrightnessDown exec light -U 10 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob +# } + +bindsym { + XF86AudioRaiseVolume exec volumectl -u up + XF86AudioLowerVolume exec volumectl -u down + XF86AudioMute exec volumectl toggle-mute + XF86AudioMicMute exec volumectl -m toggle-mute +} + +bindsym { + XF86MonBrightnessUp exec lightctl up + XF86MonBrightnessDown exec lightctl down +} + +bindsym { + XF86AudioPlay exec playerctl play + XF86AudioPause exec playerctl pause + XF86AudioNext exec playerctl next + XF86AudioPrev exec playerctl previous +} + diff --git a/dots/sway/.config/sway/config.d/swayfx b/dots/sway/.config/sway/config.d/swayfx new file mode 100644 index 0000000..204c3b5 --- /dev/null +++ b/dots/sway/.config/sway/config.d/swayfx @@ -0,0 +1,14 @@ +layer_effects "waybar" blur enable; shadows disable; +layer_effects "gtk-layer-shell" blur enable; shadows enable; corner_radius 13 +layer_effects "wofi" blur enable; shadows enable; corner_radius 13 + +smart_corner_radius enable +corner_radius 15 +shadows enable +shadows_on_csd enable +shadow_blur_radius 20 + +blur enable +blur_xray disable +blur_passes 4 +blur_radius 4 diff --git a/dots/sway/.config/sway/config.d/theme b/dots/sway/.config/sway/config.d/theme new file mode 100644 index 0000000..83b5ffa --- /dev/null +++ b/dots/sway/.config/sway/config.d/theme @@ -0,0 +1,23 @@ +gaps inner 25 +gaps outer 0 + +# hide titlebar on windows +default_border pixel 5 + +font pango:AgaveNerdFontMono Regular 11 + +smart_borders on +smart_gaps off + +exec swww-daemon -f xrgb +# TODO: shift every 30 mins +exec swww img $HOME/Pictures/wallpapers/penguins-hugging.jpg + +# TODO: pull from context +#class border backgr text indicator child_border +client.focused #333845 #333845 #ffffff #2e9ef4 #8fbcbb +client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a +client.unfocused #2f343a #222222 #888888 #333845 #333845 +client.urgent #2f343a #900000 #ffffff #900000 #900000 +client.placeholder #000000 #0c0c0c #ffffff #000000 #333845 +client.background #ffffff |