Files
nixdots/modules/home-manager/sxhkd.nix
T
2026-10-03 13:04:01 -05:00

55 lines
1.6 KiB
Nix

{ config, lib, pkgs, ... }:
{
xdg.configFile."sxhkd/sxhkdrc".text = ''
# terminal / launcher
super + Return
${config.my.defaults.terminal}
super + space
dmenu_run
# close window / quit bspwm
super + q
bspc node -c
super + alt + Escape
bspc quit
# focus window
super + {Left,Down,Up,Right}
bspc node -f {west,south,north,east}
# move (swap) window
super + shift + {Left,Down,Up,Right}
bspc node -s {west,south,north,east}
# resize window
super + alt + {Left,Down,Up,Right}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# go to workspace / send window to workspace
super + {_,shift + }{1-9}
bspc {desktop -f,node -d} '^{1-9}'
# workspace next/previous
super + ctrl + {Left,Right}
bspc desktop -f {prev,next}.local
# fullscreen / floating
super + f
bspc node -t "~fullscreen"
super + shift + f
bspc node -t "~floating"
# screenshots
Print
scrot 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/screenshots && mv $f ~/screenshots && xclip -selection clipboard -t image/png -i ~/screenshots/`ls -1 -t ~/screenshots | head -1`'
super + shift + s
scrot -s 'screenshot_%Y%m%d_%H%M%S.png' -e 'mkdir -p ~/screenshots && mv $f ~/screenshots && xclip -selection clipboard -t image/png -i ~/screenshots/`ls -1 -t ~/screenshots | head -1`'
'';
home.activation.reloadSxhkd = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
${pkgs.procps}/bin/pkill -USR1 -x sxhkd || true
'';
}