161 lines
7.7 KiB
Nix
161 lines
7.7 KiB
Nix
{ pkgs, config, ... }:
|
|
{
|
|
wayland.windowManager.sway.config = let
|
|
# Set default modifier and variables
|
|
primeMod = "Mod4";
|
|
secMod = "Mod1";
|
|
resizeAmount = "55";
|
|
in {
|
|
# Hotkeys
|
|
modifier = "${primeMod}";
|
|
keybindings = {
|
|
## Launchers
|
|
|
|
# Browser profiles
|
|
"${primeMod}+F1" = ''exec librewolf -p Main --name MainBrowser | notify-send "Main Browser"'';
|
|
"${primeMod}+F2" = ''exec librewolf -p Alt --name AltBrowser | notify-send "Alternate Browser"'';
|
|
"${primeMod}+F3" = ''exec librewolf -p Misc --name MiscBrowser | notify-send "Miscellaneous Browser"'';
|
|
|
|
# Virtual machines
|
|
"${primeMod}+F4" = ''exec virt-manager | notify-send "Virtual Machines"'';
|
|
"${primeMod}+F5" = ''exec looking-glass-client input:rawMouse=yes | notify-send "Looking Glass"'';
|
|
|
|
# Prime + key
|
|
"${primeMod}+s" = ''exec rofi -show run -p Command'';
|
|
"${primeMod}+c" = ''exec clipman pick -t rofi'';
|
|
"${primeMod}+x" = ''exec rofipower'';
|
|
"${primeMod}+b" = ''exec pkill -USR1 waybar'';
|
|
"${primeMod}+Return" = ''exec foot'';
|
|
|
|
# Prime + shift + key
|
|
"${primeMod}+Shift+s" = ''exec rofi -show drun -modi drun -drun-display-format {name} -show-icons -disable-history'';
|
|
"${primeMod}+Shift+t" = ''exec pcmanfm'';
|
|
"${primeMod}+Shift+e" = ''exec bemoji -n -P 0'';
|
|
"${primeMod}+Shift+b" = ''exec rofi-bluetooth'';
|
|
"${primeMod}+Shift+Return" = ''exec foot ranger'';
|
|
|
|
# Prime + ctrl + key
|
|
"${primeMod}+Ctrl+x" = ''exec prop-sway'';
|
|
"${primeMod}+Ctrl+s" = ''exec rofiscratch'';
|
|
"${primeMod}+Ctrl+c" = ''exec wlpicker && notify-send "Color copied to clipboard"'';
|
|
|
|
## Media
|
|
|
|
# Volume
|
|
"${secMod}+j" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-'';
|
|
"${secMod}+k" = ''exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+'';
|
|
|
|
# MPD
|
|
"${primeMod}+Backslash" = ''exec mpc toggle'';
|
|
"${secMod}+Shift+h" = ''exec mpc prev'';
|
|
"${secMod}+Shift+j" = ''exec mpc volume -3'';
|
|
"${secMod}+Shift+k" = ''exec mpc volume +3'';
|
|
"${secMod}+Shift+l" = ''exec mpc next'';
|
|
|
|
## Miscellaneous
|
|
|
|
# Notifications
|
|
"${primeMod}+n" = ''exec makotoggle'';
|
|
"${primeMod}+Shift+n" = ''exec makoctl restore'';
|
|
"${primeMod}+Ctrl+n" = ''exec makoctl dismiss -a'';
|
|
|
|
# Screenshots
|
|
"${secMod}+f" = ''exec grimedit'';
|
|
"${secMod}+Shift+f" = ''exec shot-sway --screen'';
|
|
|
|
# Display and keyboard brightness
|
|
"${primeMod}+equal" = ''exec brightnessctl s +5%'';
|
|
"${primeMod}+minus" = ''exec brightnessctl s 5%-'';
|
|
"${primeMod}+Shift+equal" = ''exec brightnessctl s +1%'';
|
|
"${primeMod}+Shift+minus" = ''exec brightnessctl s 1%-'';
|
|
|
|
## Window manager
|
|
"${primeMod}+q" = ''kill'';
|
|
"${primeMod}+Shift+r" = ''reload'';
|
|
|
|
# Switch to workspaces
|
|
"${primeMod}+grave" = ''workspace 0:${config.ws.w0}'';
|
|
"${primeMod}+1" = ''workspace 1:${config.ws.w1}'';
|
|
"${primeMod}+2" = ''workspace 2:${config.ws.w2}'';
|
|
"${primeMod}+3" = ''workspace 3:${config.ws.w3}'';
|
|
"${primeMod}+4" = ''workspace 4:${config.ws.w4}'';
|
|
"${primeMod}+5" = ''workspace 5:${config.ws.w5}'';
|
|
"${primeMod}+6" = ''workspace 6:${config.ws.w6}'';
|
|
"${primeMod}+7" = ''workspace 7:${config.ws.w7}'';
|
|
"${primeMod}+8" = ''workspace 8:${config.ws.w8}'';
|
|
"${primeMod}+9" = ''workspace 9:${config.ws.w9}'';
|
|
|
|
# Switch to alternate workspaces
|
|
"${secMod}+F1" = ''workspace 11:${config.ws.w1a}'';
|
|
"${secMod}+F2" = ''workspace 22:${config.ws.w2a}'';
|
|
"${secMod}+F3" = ''workspace 33:${config.ws.w3a}'';
|
|
"${secMod}+F4" = ''workspace 44:${config.ws.w4a}'';
|
|
"${secMod}+F5" = ''workspace 55:${config.ws.w5a}'';
|
|
"${secMod}+F6" = ''workspace 66:${config.ws.w6a}'';
|
|
"${secMod}+F7" = ''workspace 77:${config.ws.w7a}'';
|
|
"${secMod}+F8" = ''workspace 88:${config.ws.w8a}'';
|
|
"${secMod}+F9" = ''workspace 99:${config.ws.w9a}'';
|
|
|
|
# Move window to and focus workspace
|
|
"${primeMod}+Shift+grave" = ''move container to workspace 0:${config.ws.w0}; workspace 0:${config.ws.w0}'';
|
|
"${primeMod}+Shift+1" = ''move container to workspace 1:${config.ws.w1}; workspace 1:${config.ws.w1}'';
|
|
"${primeMod}+Shift+2" = ''move container to workspace 2:${config.ws.w2}; workspace 2:${config.ws.w2}'';
|
|
"${primeMod}+Shift+3" = ''move container to workspace 3:${config.ws.w3}; workspace 3:${config.ws.w3}'';
|
|
"${primeMod}+Shift+4" = ''move container to workspace 4:${config.ws.w4}; workspace 4:${config.ws.w4}'';
|
|
"${primeMod}+Shift+5" = ''move container to workspace 5:${config.ws.w5}; workspace 5:${config.ws.w5}'';
|
|
"${primeMod}+Shift+6" = ''move container to workspace 6:${config.ws.w6}; workspace 6:${config.ws.w6}'';
|
|
"${primeMod}+Shift+7" = ''move container to workspace 7:${config.ws.w7}; workspace 7:${config.ws.w7}'';
|
|
"${primeMod}+Shift+8" = ''move container to workspace 8:${config.ws.w8}; workspace 8:${config.ws.w8}'';
|
|
"${primeMod}+Shift+9" = ''move container to workspace 9:${config.ws.w9}; workspace 9:${config.ws.w9}'';
|
|
|
|
# Move window to and focus alternate workspace
|
|
"${secMod}+Shift+F1" = ''move container to workspace 11:${config.ws.w1a}; workspace 11:${config.ws.w1a}'';
|
|
"${secMod}+Shift+F2" = ''move container to workspace 22:${config.ws.w2a}; workspace 22:${config.ws.w2a}'';
|
|
"${secMod}+Shift+F3" = ''move container to workspace 33:${config.ws.w3a}; workspace 33:${config.ws.w3a}'';
|
|
"${secMod}+Shift+F4" = ''move container to workspace 44:${config.ws.w4a}; workspace 44:${config.ws.w4a}'';
|
|
"${secMod}+Shift+F5" = ''move container to workspace 55:${config.ws.w5a}; workspace 55:${config.ws.w5a}'';
|
|
"${secMod}+Shift+F6" = ''move container to workspace 66:${config.ws.w6a}; workspace 66:${config.ws.w6a}'';
|
|
"${secMod}+Shift+F7" = ''move container to workspace 77:${config.ws.w7a}; workspace 77:${config.ws.w7a}'';
|
|
"${secMod}+Shift+F8" = ''move container to workspace 88:${config.ws.w8a}; workspace 88:${config.ws.w8a}'';
|
|
"${secMod}+Shift+F9" = ''move container to workspace 99:${config.ws.w9a}; workspace 99:${config.ws.w9a}'';
|
|
|
|
# Change focused window
|
|
"${primeMod}+h" = ''focus left'';
|
|
"${primeMod}+j" = ''focus down'';
|
|
"${primeMod}+k" = ''focus up'';
|
|
"${primeMod}+l" = ''focus right'';
|
|
|
|
# Move focused window
|
|
"${primeMod}+Shift+h" = ''move left ${resizeAmount} px'';
|
|
"${primeMod}+Shift+j" = ''move down ${resizeAmount} px'';
|
|
"${primeMod}+Shift+k" = ''move up ${resizeAmount} px'';
|
|
"${primeMod}+Shift+l" = ''move right ${resizeAmount} px'';
|
|
|
|
# Resize window
|
|
"${primeMod}+${secMod}+h" = ''resize shrink width ${resizeAmount} px or 5 ppt'';
|
|
"${primeMod}+${secMod}+j" = ''resize shrink height ${resizeAmount} px or 5 ppt'';
|
|
"${primeMod}+${secMod}+k" = ''resize grow height ${resizeAmount} px or 5 ppt'';
|
|
"${primeMod}+${secMod}+l" = ''resize grow width ${resizeAmount} px or 5 ppt'';
|
|
|
|
# Floating
|
|
"${primeMod}+space" = ''focus mode_toggle'';
|
|
"${primeMod}+Shift+space" = ''floating toggle'';
|
|
|
|
# Change layout
|
|
"${primeMod}+f" = ''fullscreen toggle'';
|
|
"${primeMod}+w" = ''layout toggle split'';
|
|
"${primeMod}+v" = ''split v'';
|
|
"${primeMod}+e" = ''layout toggle tabbed stacking'';
|
|
|
|
# Focus parent / child
|
|
"${primeMod}+a" = ''focus parent'';
|
|
"${primeMod}+shift+a" = ''focus child'';
|
|
|
|
# Scratchpads
|
|
"${primeMod}+Shift+Backslash" = ''[app_id="btop"] scratchpad show, move position center, resize set 1216 888'';
|
|
"${primeMod}+Shift+m" = ''[app_id="music"] scratchpad show, move position center, resize set 1006 657'';
|
|
"${primeMod}+Shift+v" = ''[app_id="sound"] scratchpad show, move position center, resize set 1000 800'';
|
|
};
|
|
};
|
|
}
|