dotfiles/home/default/.config/sway/config
2024-01-31 19:05:24 +07:00

420 lines
11 KiB
Plaintext

### sway(fx) settings
# logo key. Use Mod1 for Alt.
set $mod Mod4
# home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
set $term $TERMINAL
set $browser $BROWSER
set $editor $EDITOR
set $menu wofi -i --show drun | xargs swaymsg exec --
set $dmenu wofi -i --show run | xargs swaymsg exec --
# wallpaper
exec change-background
### daemons
# notifications
exec swaync
# display orientation
exec --no-startup-id kanshi
# input method
#exec fcitx5
# night light
#exec sleep 3 && gammastep -l LAT:LON
# mpd (music player daemon)
exec mpd
# xresources (nsxiv theme, and other programs)
exec sleep 5 && xrdb -load $HOME/.config/x11/xresources
# Syncthing (sync daemon)
exec syncthing --no-browser
# polkit
exec --no-startup-id /usr/libexec/polkit-gnome-authentication-agent-1
# sworkstyle
#exec sworkstyle &> /tmp/sworkstyle.log
#assign [app_id="librewolf"] 2
#assign [app_id="firefox"] 2
#assign [app_id="mumble"] 9
#assign [app_id="dino"] 9
#assign [app_id="deluge"] 10
#for_window [app_id=".*"] floating enable
for_window [app_id="uxnemu"] floating enable
for_window [app_id="uxnemu"] border pixel 0
#exec_always autotiling
exec systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
# behavior
focus_follows_mouse no
workspace_auto_back_and_forth no
show_marks yes
# looks
font pango: monospace 8
gaps inner 25
default_border pixel 2
hide_edge_borders smart
bindsym $mod+Control+y border toggle
# swayfx specific
blur enable
blur_xray enable
blur_passes 1
# 2
blur_radius 1
# 3
#corner_radius 20
shadows disable
#set $cl_high #333333
#set $cl_indi #333333
#set $cl_back #222222
#set $cl_high #000000
#set $cl_indi #000000
#set $cl_back #999999
# river colors
set $cl_high #93a1a1
set $cl_indi #586e75
set $cl_back #002b36
set $cl_fore #d9d8d8
set $cl_urge #FF0000
client.focused $cl_high $cl_high $cl_fore $cl_indi $cl_high
client.focused_inactive $cl_back $cl_back $cl_fore $cl_back $cl_back
client.unfocused $cl_back $cl_back $cl_fore $cl_back $cl_back
client.urgent $cl_urge $cl_urge $cl_fore $cl_urge $cl_urge
#set $gnome-schema org.gnome.desktop.interface
# exec_always {
# gsettings set $gnome-schema gtk-theme 'Materia-dark'
# gsettings set $gnome-schema icon-theme 'Papirus-Dark'
# gsettings set $gnome-schema color-scheme 'prefer-dark'
#}
### Idle configuration
# timeout
exec idle
### key bindings
# start a terminal
bindsym $mod+Return exec $term
# kill focused window
bindsym $mod+q kill
# start your launcher
bindsym $mod+d exec $menu
bindsym $mod+Shift+d exec $dmenu
# drag floating windows by holding down $mod and left mouse button.
# resize them with right mouse button + $mod.
# despite the name, also works for non-floating windows.
# change normal to inverse to use left mouse button for resizing and right
# mouse button for dragging.
floating_modifier $mod normal
# reload the configuration file
bindsym $mod+Shift+r reload
# toggle waybar
bindsym $mod+x exec killall -SIGUSR1 waybar
# exit sway (logs you out of your wayland session)
bindsym $mod+Shift+backspace exec prompt "Do you really wont to exit sway? This will end your Wayland session" "swaymsg exit"
# Prompts you options; shutdown, sleep, etc.
bindsym $mod+backspace exec sysact
# 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
# screenshot
bindsym Print exec screenshot.sh output
bindsym $mod+Print exec screenshot.sh active
bindsym $mod+Shift+Print exec screenshot.sh window
# alternative keybind
bindsym $mod+Control+u exec screenshot.sh output
bindsym $mod+u exec screenshot.sh active
bindsym $mod+Shift+u exec screenshot.sh window
# app switcher
#bindsym $mod+Tab exec sway-select-window
bindsym $mod+Tab exec ss.sh
### programs
# browser
bindsym $mod+w exec $browser
# agenda
bindsym $mod+c exec emacsclient -c -a '' --eval '(org-agenda-list)'
# org-capture
bindsym $mod+Shift+c exec ~/.emacs.d/bin/org-capture
# newsboat (rss)
bindsym $mod+Shift+n exec $term -e newsboat
# notifications tab
bindsym $mod+t exec swaync-client -t
# file manager
bindsym $mod+r exec $term -e lf
# emacs
bindsym $mod+e exec emacsclient -c -a ''
# mail
#bindsym $mod+e exec thunderbird-wayland
# bookmarks
# open
bindsym $mod+b exec emacsclient -c -a '' ~/notebook/bookmarks.org
# open bookmarks
bindsym $mod+shift+b exec bookmark
# insert
bindsym $mod+Insert exec wtype "$(grep -v '^#' ~/notebook/bookmarks.org | dmenu -l 50 | cut -d' ' -f1)"
# kaomiji?
# bindsym $mod+z exec dmenukaomoji
# keepass dmenu
bindsym $mod+shift+Insert exec keepmenu
# download script
bindsym $mod+Control+m exec musdl
# open youtube link in ft
bindsym $mod+y exec io.freetubeapp.FreeTube $(wl-paste)
# games
# bindsym $mod+g exec taverner
# workspace names
set $wp1 1
set $wp2 2
set $wp3 3
set $wp4 4
set $wp5 5
set $wp6 6
set $wp7 7
set $wp8 8
set $wp9 9
set $wp10 10
# binding workspace to monitors
# main monitor on right
#workspace $wp1 output DVI-D-1
#workspace $wp2 output DVI-D-1
#workspace $wp3 output DVI-D-1
#workspace $wp4 output DVI-D-1
#workspace $wp5 output DVI-D-1
#workspace $wp6 output HDMI-A-1
#workspace $wp7 output HDMI-A-1
#workspace $wp8 output HDMI-A-1
#workspace $wp9 output HDMI-A-1
#workspace $wp10 output HDMI-A-1
# main monitor on left
workspace $wp1 output HDMI-A-1
workspace $wp2 output HDMI-A-1
workspace $wp3 output HDMI-A-1
workspace $wp4 output HDMI-A-1
workspace $wp5 output HDMI-A-1
workspace $wp6 output DVI-D-1
workspace $wp7 output DVI-D-1
workspace $wp8 output DVI-D-1
workspace $wp9 output DVI-D-1
workspace $wp10 output DVI-D-1
# switch to workspace
bindsym $mod+1 workspace number $wp1
bindsym $mod+2 workspace number $wp2
bindsym $mod+3 workspace number $wp3
bindsym $mod+4 workspace number $wp4
bindsym $mod+5 workspace number $wp5
bindsym $mod+6 workspace number $wp6
bindsym $mod+7 workspace number $wp7
bindsym $mod+8 workspace number $wp8
bindsym $mod+9 workspace number $wp9
bindsym $mod+0 workspace number $wp10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $wp1
bindsym $mod+Shift+2 move container to workspace number $wp2
bindsym $mod+Shift+3 move container to workspace number $wp3
bindsym $mod+Shift+4 move container to workspace number $wp4
bindsym $mod+Shift+5 move container to workspace number $wp5
bindsym $mod+Shift+6 move container to workspace number $wp6
bindsym $mod+Shift+7 move container to workspace number $wp7
bindsym $mod+Shift+8 move container to workspace number $wp8
bindsym $mod+Shift+9 move container to workspace number $wp9
bindsym $mod+Shift+0 move container to workspace number $wp10
# move focused container to workspace
# with comma/period (</>)
bindsym $mod+comma focus output left
bindsym $mod+period focus output right
bindsym $mod+Shift+comma move window to output left
bindsym $mod+Shift+period move window to output right
bindsym $mod+Alt+comma move workspace to output left
bindsym $mod+Alt+period move workspace to output right
# with directional pad (up/down/left/right)
bindsym $mod+left focus output left
bindsym $mod+right focus output right
bindsym $mod+up focus output up
bindsym $mod+down focus output down
bindsym $mod+Shift+left move window to output left
bindsym $mod+Shift+right move window to output right
bindsym $mod+Shift+up move window to output up
bindsym $mod+Shift+down move window to output down
bindsym $mod+Alt+left move workspace to output left
bindsym $mod+Alt+right move workspace to output right
bindsym $mod+Alt+up move workspace to output up
bindsym $mod+Alt+down move workspace to output down
# splits
# bindsym $mod+b splith
# bindsym $mod+v splitv
# sticky
bindsym $mod+s sticky toggle
# switch the current container between different layout styles
#bindsym $mod+Shift+s layout stacking
bindsym $mod+Shift+w layout tabbed
bindsym $mod+Shift+e layout toggle split
# 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
# move focus to the parent container
bindsym $mod+a focus parent
# move the currently focused window to the scratchpad
bindsym $mod+Shift+grave 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 $mod+grave scratchpad show
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 $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
#bindsym $mod+r mode "resize"
# status bar
#include $HOME/.config/sway/bar
exec_always killall waybar
exec_always sleep 3 && waybar
### special keys
# keyboard brightness
bindsym XF86MonBrightnessDown exec brightnessctl set 10%-
bindsym XF86MonBrightnessUp exec brightnessctl set +10%
# volume
bindsym $mod+minus exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindsym $mod+equal exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindsym $mod+Shift+minus exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 15%-
bindsym $mod+Shift+equal exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 15%+
bindsym XF86AudioLowerVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindsym XF86AudioRaiseVolume exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
# mute
bindsym $mod+Shift+m exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindsym XF86AudioMute exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindsym XF86AudioMicMute exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
# music controls
bindsym $mod+p exec mpc toggle
bindsym $mod+o exec mpc next
bindsym $mod+i exec mpc prev
# music seeking
bindsym $mod+bracketleft exec mpc seek -10
bindsym $mod+bracketright exec mpc seek +10
bindsym $mod+Shift+bracketleft exec mpc seek -60
bindsym $mod+Shift+bracketright exec mpc seek +60
# audio controller
bindsym $mod+Control+p exec $term -e pulsemixer
# music player
bindsym $mod+m exec $term -e ncmpcpp
#bindsym $mod+Shift+o exec mpc repeat
#bindsym $mod+Shift+i exec mpc seek 0%
bindsym $mod+Shift+s exec ~/.config/sway/scripts/sway-select-window
include /etc/sway/config.d/*
include ~/.config/sway/priv