dotfiles/home/default/.config/sway/config

379 lines
10 KiB
Plaintext
Raw Normal View History

2023-04-02 05:58:11 -04:00
### sway 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
2023-06-29 10:12:35 -04:00
#set $menu dmenu_path | dmenu | xargs swaymsg exec --
set $menu rofi -show combi | xargs swaymsg exec --
2023-04-02 05:58:11 -04:00
# wallpaper
2023-06-29 10:12:35 -04:00
exec change-background
2023-04-02 05:58:11 -04:00
### daemons
2023-06-29 10:12:35 -04:00
# notifications
exec swaync
2023-04-02 05:58:11 -04:00
# 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 xrdb $HOME/.config/x11/xresources
# Syncthing (sync daemon)
exec syncthing --no-browser
# polkit
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
2023-05-03 10:36:47 -04:00
# emacs daemon
exec /usr/bin/emacs --daemon
2023-06-29 10:12:35 -04:00
#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
#exec_always autotiling
2023-04-02 05:58:11 -04:00
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
hide_edge_borders smart
workspace_auto_back_and_forth no
show_marks yes
# looks
2023-06-29 10:12:35 -04:00
font pango: monospace 8
2023-05-03 10:36:47 -04:00
gaps inner 25
2023-06-29 10:12:35 -04:00
#default_border pixel 2
2023-05-03 10:36:47 -04:00
bindsym $mod+Control+y border toggle
2023-06-29 10:12:35 -04:00
set $cl_high #333333
set $cl_indi #333333
set $cl_back #222222
2023-04-02 05:58:11 -04:00
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
### 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
2023-06-29 10:12:35 -04:00
bindsym $mod+Shift+d exec dmenu_path | dmenu | xargs swaymsg exec
2023-04-02 05:58:11 -04:00
# 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
2023-05-03 10:36:47 -04:00
# toggle waybar
2023-06-29 10:12:35 -04:00
bindsym $mod+x exec killall -SIGUSR1 waybar
2023-05-03 10:36:47 -04:00
2023-04-02 05:58:11 -04:00
# 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
2023-05-03 10:36:47 -04:00
# screenshot
bindsym Print exec grimshot save output $HOME/Pictures/Screenshots/$(date +'%Y-%m-%d_%H.%M.%S_%Z').png
bindsym $mod+Print exec grimshot save active $HOME/Pictures/Screenshots/$(date +'%Y-%m-%d_%H.%M.%S_%Z').png
bindsym $mod+Shift+Print exec grimshot save window $HOME/Pictures/Screenshots/$(date +'%Y-%m-%d_%H.%M.%S_%Z').png
# alternative keybind
2023-06-29 10:12:35 -04:00
bindsym $mod+Control+u exec grimshot save output $HOME/Pictures/Screenshots/$(date +'%Y-%m-%d_%H.%M.%S_%Z').png
bindsym $mod+u exec grimshot save active $HOME/Pictures/Screenshots/$(date +'%Y-%m-%d_%H.%M.%S_%Z').png
bindsym $mod+Shift+u exec grimshot save window $HOME/Pictures/Screenshots/$(date +'%Y-%m-%d_%H.%M.%S_%Z').png
2023-04-02 05:58:11 -04:00
### programs
# sway config
2023-06-29 10:12:35 -04:00
bindsym $mod+F1 exec em ~/.config/sway/config
2023-07-01 07:47:19 -04:00
bindsym $mod+F2 exec em ~/.dotroot/packages.txt
bindsym $mod+F3 exec em ~/.dotroot/instructions.org
2023-04-02 05:58:11 -04:00
# browser
bindsym $mod+w exec $browser
2023-05-03 10:36:47 -04:00
# agenda
2023-06-29 10:12:35 -04:00
bindsym $mod+c exec emacsclient -c --eval '(org-agenda-list)' || emacs --eval '(org-agenda-list)'
2023-04-02 05:58:11 -04:00
2023-05-03 10:36:47 -04:00
# notebook
2023-05-12 14:06:40 -04:00
bindsym $mod+n exec $term -e $editor ~/notebook/index.org
2023-06-29 10:12:35 -04:00
bindsym $mod+v exec em ~/notebook/refile.org
2023-04-02 05:58:11 -04:00
# newsboat (rss)
bindsym $mod+Shift+n exec $term -e newsboat
# notifications tab
2023-06-29 10:12:35 -04:00
bindsym $mod+t exec swaync-client -t
2023-04-02 05:58:11 -04:00
# file manager
bindsym $mod+r exec $term -e lf
2023-05-03 10:36:47 -04:00
# emacs
2023-06-29 10:12:35 -04:00
bindsym $mod+e exec emacsclient -c || emacs
2023-05-03 10:36:47 -04:00
2023-04-02 05:58:11 -04:00
# mail
2023-05-03 10:36:47 -04:00
#bindsym $mod+e exec $term -e neomutt
2023-04-02 05:58:11 -04:00
# start tasks in dmenu
2023-07-01 07:47:19 -04:00
bindsym $mod+Control+d exec start-tasks
2023-06-29 10:12:35 -04:00
bindsym $mod+Shift+x exec start-tasks
2023-04-02 05:58:11 -04:00
# bookmarks
2023-06-29 10:12:35 -04:00
bindsym $mod+b exec em ~/notebook/bookmarks.org
2023-04-02 05:58:11 -04:00
bindsym $mod+shift+b exec bookmark
2023-06-29 10:12:35 -04:00
bindsym $mod+Insert exec wtype "$(grep -v '^#' ~/notebook/bookmarks.org | dmenu -l 50 | cut -d' ' -f1)"
2023-04-02 05:58:11 -04:00
# kaomiji?
2023-06-29 10:12:35 -04:00
bindsym $mod+z exec dmenukaomoji
2023-04-02 05:58:11 -04:00
# keepass dmenu
bindsym $mod+shift+Insert exec keepmenu
# download script
bindsym $mod+Control+m exec musdl
2023-05-03 10:36:47 -04:00
# youtube client
bindsym $mod+y exec io.freetubeapp.FreeTube $(wl-paste)
2023-04-02 05:58:11 -04:00
2023-06-29 10:12:35 -04:00
# games
bindsym $mod+g exec taverner
2023-04-02 05:58:11 -04:00
# 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
2023-06-29 10:12:35 -04:00
# binding workspace to monitors
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
2023-04-02 05:58:11 -04:00
# switch to workspace
bindsym $mod+1 workspace $wp1
bindsym $mod+2 workspace $wp2
bindsym $mod+3 workspace $wp3
bindsym $mod+4 workspace $wp4
bindsym $mod+5 workspace $wp5
bindsym $mod+6 workspace $wp6
bindsym $mod+7 workspace $wp7
bindsym $mod+8 workspace $wp8
bindsym $mod+9 workspace $wp9
bindsym $mod+0 workspace $wp10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $wp1
bindsym $mod+Shift+2 move container to workspace $wp2
bindsym $mod+Shift+3 move container to workspace $wp3
bindsym $mod+Shift+4 move container to workspace $wp4
bindsym $mod+Shift+5 move container to workspace $wp5
bindsym $mod+Shift+6 move container to workspace $wp6
bindsym $mod+Shift+7 move container to workspace $wp7
bindsym $mod+Shift+8 move container to workspace $wp8
bindsym $mod+Shift+9 move container to workspace $wp9
bindsym $mod+Shift+0 move container to workspace $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
2023-05-03 10:36:47 -04:00
# sticky
bindsym $mod+s sticky toggle
2023-04-02 05:58:11 -04:00
# switch the current container between different layout styles
2023-06-29 10:12:35 -04:00
#bindsym $mod+Shift+s layout stacking
bindsym $mod+Shift+w layout tabbed
bindsym $mod+Shift+e layout toggle split
2023-04-02 05:58:11 -04:00
# 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
2023-05-03 10:36:47 -04:00
#include $HOME/.config/sway/bar
exec_always killall waybar
exec_always sleep 2 && waybar
2023-04-02 05:58:11 -04:00
### special keys
2023-05-03 10:36:47 -04:00
# keyboard brightness
bindsym XF86MonBrightnessDown exec brightnessctl set 10%-
bindsym XF86MonBrightnessUp exec brightnessctl set +10%
2023-04-02 05:58:11 -04:00
# 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%+
2023-05-03 10:36:47 -04:00
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
2023-04-02 05:58:11 -04:00
# 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%
2023-06-29 10:12:35 -04:00
bindsym $mod+Shift+s exec ~/.config/sway/scripts/sway-select-window
2023-04-02 05:58:11 -04:00
include /etc/sway/config.d/*
2023-05-03 10:36:47 -04:00
include ~/syncthing/default/config.d/sway/*