Files
dots/files/sway/.config/sway/config
2022-08-01 23:57:04 +02:00

242 lines
7.3 KiB
Plaintext

# config for sway
# Read `man 5 sway` for a complete reference.
# Font in sway
font pango: SFMono Nerd Font 9
# Variables
set $mod Mod4
set $left h
set $down j
set $up k
set $right l
# Color
# old solarized
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
# new everforest
set $bar_bg #323232
set $green #93b259
set $orange #f85551
# clientclass border backgr. text indicator
client.focused $green $green $bar_bg $green
client.focused_inactive $bar_bg $bar_bg $baseB0 $bar_bg
client.unfocused $bar_bg $bar_bg $baseB0 $bar_bg
client.urgent $orange $orange $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
exec light -S 20
# Idle configuration
# create blurred lock screen
exec_always convert ~/images/wallpaper/wallpaper.png -blur 0x8 /tmp/lock.png
# set lockc and save to script, so other programs can also use it
set $lock 'swaylock -f --image /tmp/lock.png --indicator-idle-visible -F'
exec_always echo $lock > ~/.local/bin/lock.sh
exec_always chmod +x ~/.local/bin/lock.sh
# Lock after 20 minutes
# Lock before suspend
exec swayidle -w \
timeout 1200 ~/.local/bin/lock.sh \
before-sleep ~/.local/bin/lock.sh
#timeout 1320 'systemctl suspend' \
# Input configuration
input type:pointer {
accel_profile "flat"
}
input type:keyboard {
# Umlauts on RAlt + {a,u,o,s}
xkb_layout eu
# Make Caps Lock an additional Esc
# https://man.archlinux.org/man/xkeyboard-config.7
xkb_options caps:escape
# Keyboard repeats
repeat_delay 300
repeat_rate 50
}
# Key bindings
# Basics:
# Terminal
bindsym $mod+Return exec alacritty
# Kill focused window
bindsym $mod+Shift+Backspace kill
# bemenu
set $bemenu bemenu \
-l 7 \
--nb "#282828" \
--nf "#ffffff" \
--ab "#282828" \
--af "#ffffff" \
--fb "#282828" \
--tf "#93b259" \
--tb "#282828" \
--hf "#ffffff" \
--hb "#393939" \
--fn "SFMono Nerd Font 13" -i -H 25 -W 0.5
set $files fd -I "pdf$" $HOME | cut -f 4- -d "/"
set $lock_screen \
printf "/home/marc/.local/bin/lock.sh\nsystemctl suspend\nswaymsg reload\nshutdown now\nloginctl terminate-user marc"
#bindsym $mod+d exec dmenu_path | $bemenu -p 'run' | xargs swaymsg exec --
bindsym $mod+d exec rofi -show drun
#bindsym $mod+p exec $files | $bemenu -l 20 -p 'pdf' -W 0.7 | xargs -d '\n' -r xdg-open
bindsym $mod+p exec $files | rofi -dmenu -p '  PDF ' -i | xargs -d '\n' -r xdg-open
#bindsym $mod+Ctrl+Backspace exec $lock_screen | $bemenu -p "power" | xargs -d '\n' -r /bin/bash -c
bindsym $mod+Ctrl+Backspace exec $lock_screen | rofi -dmenu -p " ⏻ Power " | xargs -d '\n' -r /bin/bash -c
# Screenshot
bindsym $mod+Shift+s exec grim -g "$(slurp)" - | wl-copy
bindsym $mod+Ctrl+Shift+s exec grim -g "$(slurp)" - | swappy -f -
# Show notifications
bindsym $mod+v exec swaync-client -t -sw
# Brightness
bindsym XF86MonBrightnessUp exec light -A 5
bindsym XF86MonBrightnessDown exec light -U 5
# 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
# 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
# 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 number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10
# Move between displays
bindsym $mod+Control+$left move workspace to output left
bindsym $mod+Control+$right move workspace to output right
# Layout stuff:
titlebar_padding 1
workspace_layout tabbed
title_align center
default_border pixel 0
default_floating_border pixel 0
# hide title and border, if only one application open
hide_edge_borders --i3 smart
# just show gaps between windows
# gaps inner 5
# gaps outer -5
# Make the current focus fullscreen
bindsym $mod+f fullscreen
# Resize windows with $mod + mouse
floating_modifier $mod normal
# 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
for_window [app_id="firefox"] move container to workspace number $ws2
for_window [class="discord"] move container to workspace number $ws3
for_window [app_id="org.telegram.desktop"] move container to workspace number $ws3
for_window [class="Spotify"] move container to workspace number $ws4
for_window [class="Joplin"] move container to workspace number $ws5
for_window [app_id="evolution"] move container to workspace number $ws8
for_window [app_id="org.keepassxc.KeePassXC"] move container to workspace number $ws9
# Status Bar
bar {
swaybar_command waybar
}
# Startup programs
exec syncthing
exec swaync
exec fcitx5
# Include some defaults
include /etc/sway/config.d/*