Files
nixos/modules/desktop/hypr-bindings.nix

70 lines
4.5 KiB
Nix

{ hyprLib, mainMod, ... }:
let
inherit (hyprLib)
bind
bindm
exec
focusDirection
focusWorkspace
moveDirection
moveWorkspace
;
in
{
home-manager.users."djai".wayland.windowManager.hyprland.settings.bind = [
# default binds
(bind "${mainMod} + T" (exec "~/.config/WMScripts/kitty_window.sh") "Kitty")
(bind "${mainMod} + SHIFT + T" (exec "~/.config/WMScripts/kitty_window.sh") "Kitty (with sh)")
(bind "${mainMod} + SHIFT + R" (exec "~/.config/WMScripts/record.sh") "Record screen with ffmpg")
(bind "CTRL + SHIFT + SPACE" (exec "~/.config/WMScripts/microphone.sh") "Global mute toggle")
(bind "PRINT" (exec "grimblast copy area --freeze") "Printscreen (frozen)")
(bind "SHIFT + PRINT" (exec "grimblast copy area") "Printscreen")
(bind "${mainMod} + SHIFT + S" (exec "grimblast copy area") "Printscreen")
(bind "CTRL + PRINT" (exec "~/.config/WMScripts/screenshot_float.sh") "Screenshot to feh (flameshot)")
(bind "CTRL + SHIFT + PRINT" (exec "~/.config/hypr/scripts/screenshot_float.sh") "Screenshot to feh (grim)")
(bind "${mainMod} + O" (exec "~/.config/WMScripts/tess.sh") "Screenshot to OCR")
(bind "${mainMod} + P" (exec "hyprpicker -ra") "Colour picker")
(bind "${mainMod} + CTRL + P" (exec "~/.config/WMScripts/changewall.fish") "Manually switch wallpaper")
(bind "${mainMod} + D" (exec "rofi -show drun") "Program runner")
(bind "${mainMod} + SHIFT + D" (exec "~/.config/hypr/scripts/keybinds.sh") "Show keybinds")
(bind "${mainMod} + N" (exec "dunstctl close-all") "Clear dunst notifications")
(bind "${mainMod} + SHIFT + N" (exec "~/.config/WMScripts/dunst.sh") "Toggle dunst notifications")
(bind "CTRL + SHIFT + ESCAPE" (exec "~/.config/WMScripts/murder.sh") "Terminate a program")
(bind "${mainMod} + CTRL + M" (exec "~/.config/WMScripts/mute_active.sh") "Toggle mute active window")
(bind "${mainMod} + CTRL + SHIFT + M" (exec "~/.config/WMScripts/mute_active.sh muted") "Toggle mute active window and apply the 'muted' shader")
(bind "${mainMod} + M" (exec "~/.config/WMScripts/toggle_audiocables.sh combine") "Toggle hyperx audio output")
(bind "${mainMod} + SHIFT + M" (exec "~/.config/WMScripts/toggle_audiocables.sh clementine") "Toggle clementine audio output")
(bind "${mainMod} + Q" (exec "killall deadcells") "Murder Dead cells specifically")
(bind "CTRL + ALT + M" (exec "pactl set-sink-mute 'alsa_output.pci-0000_06_00.6.analog-stereo' toggle") "Toggle internal speaker output")
(bind "${mainMod} + SHIFT + V" (exec "~/.config/hypr/scripts/shader_picker.sh") "Pick a shader")
(bind "${mainMod} + G" (exec "~/.config/hypr/scripts/gamemode_hypr.sh") "Toggle power-saving mode")
] ++ [
# window navigation
(bind "${mainMod} + V" "hl.dsp.window.pin()" "Pin window")
(bind "${mainMod} + SHIFT + C" "hl.dsp.window.center()" "Center floating window")
(bind "${mainMod} + SHIFT + MINUS" (moveWorkspace "special:magic" false) "Move window to special workspace")
(bind "${mainMod} + MINUS" "hl.dsp.workspace.toggle_special('magic')" "Toggle special workspace")
(bind "${mainMod} + SHIFT + Q" "hl.dsp.window.close()" "Kill focused window")
(bind "${mainMod} + SHIFT + SPACE" "hl.dsp.window.float()" "Toggle floating")
(bind "${mainMod} + SPACE" (exec "~/.config/hypr/scripts/toggle_focus_floating.sh") "Toggle floating focus")
(bind "${mainMod} + F" "hl.dsp.window.fullscreen()" "Toggle fullscreen")
(bind "${mainMod} + H" (focusDirection "left") "Focus left")
(bind "${mainMod} + J" (focusDirection "down") "Focus down")
(bind "${mainMod} + K" (focusDirection "up") "Focus up")
(bind "${mainMod} + L" (focusDirection "right") "Focus right")
(bind "${mainMod} + SHIFT + H" (moveDirection "left") "Move window left")
(bind "${mainMod} + SHIFT + J" (moveDirection "down") "Move window down")
(bind "${mainMod} + SHIFT + K" (moveDirection "up") "Move window up")
(bind "${mainMod} + SHIFT + L" (moveDirection "right") "Move window right")
(bind "${mainMod} + CTRL + F" "hl.dsp.window.pseudo()" "Toggle pesudo-floating")
(bind "${mainMod} + E" "hl.dsp.layout('togglesplit')" "Toggle split layout")
(bindm "${mainMod} + mouse:272" "hl.dsp.window.drag()" "Move using mouse")
(bindm "${mainMod} + mouse:273" "hl.dsp.window.resize()" "Resize using mouse")
(bind "${mainMod} + COMMA " (focusWorkspace 999) "")
(bind "${mainMod} + SHIFT + COMMA" (moveWorkspace 999 false) "")
(bind "${mainMod} + SHIFT + code:60" "hl.dsp.workspace.move({ monitor = '+1' })" "Move workspace between monitors")
];
}