Files
dots/files/sway/.config/sway/config
2022-04-30 15:10:53 +02:00

208 lines
5.7 KiB
Plaintext

# config for sway
# Read `man 5 sway` for a complete reference.
# Font in sway
font pango: JuliaMono 9
# Variables
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
# Color
set $yellow #b58900
set $orange #cb4b16
set $red #dc322f
set $magenta #d33682
set $violet #6c71c4
set $blue #268bd2
set $cyan #2aa198
set $green #859900
set $baseA3 #fdf6e3
set $baseA2 #eee8d5
set $baseA1 #93a1a1
set $baseA0 #839496
set $baseB0 #657b83
set $baseB1 #586e75
set $baseB2 #073642
set $baseB3 #002b36
set $custom #e1cab3
# clientclass border backgr. text indicator
client.focused $green $green $baseB3 $blue
client.focused_inactive $baseA2 $baseA2 $baseB2 $violet
client.unfocused $baseA2 $baseA2 $baseB1 $baseA1
client.urgent $yellow $yellow $baseB3 $orange
# Output configuration
set $laptop eDP-1
output * bg ~/images/wallpaper/wallpaper.png fill
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
# Idle configuration
# Lock after 20 minutes
# Suspend after 30 minutes
exec swayidle -w \
timeout 1200 'swaylock -f' \
timeout 1800 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
before-sleep 'swaylock -f'
# Input configuration
input type:pointer {
accel_profile "flat"
}
input type:keyboard {
xkb_layout eu
xkb_options caps:escape
}
# Key bindings
# Basics:
# Floating
floating_modifier $mod normal
# Terminal
bindsym $mod+Return exec gnome-terminal
# Kill focused window
bindsym $mod+Shift+Backspace kill
# Application launcher
bindsym $mod+d exec dmenu_path | bemenu -l 5 --tf "#859900" --hf "#859900" --nb "#002b36" --hb "#002b36" --tb "#002b36" --fb "#002b36" --fn "JuliaMono 13" | xargs swaymsg exec --
# Screenshot
# bindsym $mod+Shift+s exec wayshot -s "$(slurp -f '%x %y %w %h')" --stdout | wl-copy
bindsym $mod+Shift+s exec grim -g "$(slurp)" - | swappy -f -
# Reload the configuration file
bindsym $mod+Shift+r reload
# Logout etc
bindsym $mod+Ctrl+Backspace exec wlogout
# Show notifications
bindsym $mod+v exec swaync-client -t -sw
# Brightness
bindsym XF86MonBrightnessUp exec light -A 10
bindsym XF86MonBrightnessDown exec light -U 10
# Audio
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
# Moving around:
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# Move the focused window with the same, but add Shift
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
# Ditto, with arrow keys
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# Workspaces:
# Declare workspaces
set $ws1 '1'
set $ws2 '2'
set $ws3 '3'
set $ws4 '4'
set $ws5 '5'
set $ws6 '6'
set $ws7 '7'
set $ws8 '8'
set $ws9 '9'
set $ws10 '10'
# Switch to workspace
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6
bindsym $mod+Shift+7 move container to workspace $ws7
bindsym $mod+Shift+8 move container to workspace $ws8
bindsym $mod+Shift+9 move container to workspace $ws9
bindsym $mod+Shift+0 move container to workspace $ws10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
# Layout stuff:
workspace_layout stacking
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Toggle the current focus between tiling and floating mode
bindsym $mod+Shift+space floating toggle
# Swap focus between the tiling area and the floating area
bindsym $mod+space focus mode_toggle
# Window rules
for_window [app_id="firefox" title="Firefox — Sharing Indicator"] kill
# Status Bar
# man 5 sway-bar
bar {
position top
tray_output none
status_command while ~/.config/sway/bar.sh; do sleep 5; done
colors {
separator $blue
background $baseA3
statusline $baseB2
# workclass border backgr. text
focused_workspace $green $green $baseB3
active_workspace $baseA3 $baseA3 $baseB1
inactive_workspace $baseA3 $baseA3 $baseB1
urgent_workspace $orange $orange $baseB3
}
}
# Startup programs
exec syncthing
exec swaync
# Include some defaults
include /etc/sway/config.d/*