2024-09-09 00:22:14 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-09-11 23:16:44 +00:00
|
|
|
with lib; let
|
2024-09-24 16:02:10 +00:00
|
|
|
audio = "~/.local/bin/audio";
|
2024-09-09 00:22:14 +00:00
|
|
|
clipse = "${pkgs.clipse}/bin/clipse";
|
2024-09-11 23:16:44 +00:00
|
|
|
codium = "${config.home-manager.users.${config.custom.username}.programs.vscode.package}/bin/codium";
|
|
|
|
firefox-esr = "${config.home-manager.users.${config.custom.username}.programs.firefox.finalPackage}/bin/firefox-esr";
|
2024-09-09 00:22:14 +00:00
|
|
|
gnome-text-editor = "${pkgs.gnome-text-editor}/bin/gnome-text-editor";
|
|
|
|
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
|
2024-09-11 23:16:44 +00:00
|
|
|
hyprlock = "${config.home-manager.users.${config.custom.username}.programs.hyprlock.package}/bin/hyprlock";
|
2024-09-09 00:22:14 +00:00
|
|
|
hyprpicker = "${pkgs.hyprpicker}/bin/hyprpicker";
|
2024-09-24 16:02:10 +00:00
|
|
|
inhibit = "~/.local/bin/inhibit";
|
2024-09-09 00:22:14 +00:00
|
|
|
jq = "${pkgs.jq}/bin/jq";
|
|
|
|
kill = "${pkgs.procps}/bin/kill";
|
|
|
|
kitty = "${config.home-manager.users.${config.custom.username}.programs.kitty.package}/bin/kitty";
|
2024-09-15 23:22:23 +00:00
|
|
|
left = config.home-manager.users.${config.custom.username}.home.file.".local/bin/left".source;
|
2024-09-09 00:22:14 +00:00
|
|
|
loginctl = "${pkgs.systemd}/bin/loginctl";
|
2024-09-15 23:22:23 +00:00
|
|
|
menu = config.home-manager.users.${config.custom.username}.home.file.".local/bin/menu".source;
|
2024-09-09 00:22:14 +00:00
|
|
|
nautilus = "${pkgs.nautilus}/bin/nautilus";
|
|
|
|
networkmanager_dmenu = "${pkgs.networkmanager_dmenu}/bin/networkmanager_dmenu";
|
|
|
|
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
|
|
|
obsidian = "${pkgs.obsidian}/bin/obsidian";
|
2024-09-14 21:03:48 +00:00
|
|
|
onlyoffice = "${pkgs.onlyoffice-bin}/bin/onlyoffice-desktopeditors";
|
2024-09-09 00:22:14 +00:00
|
|
|
pkill = "${pkgs.procps}/bin/pkill";
|
|
|
|
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
|
|
|
rofi-rbw = "${pkgs.rofi-rbw}/bin/rofi-rbw";
|
2024-09-15 22:41:21 +00:00
|
|
|
rm = "${pkgs.coreutils}/bin/rm";
|
2024-09-24 16:02:10 +00:00
|
|
|
screenshot = "~/.local/bin/screenshot";
|
2024-09-09 00:22:14 +00:00
|
|
|
sleep = "${pkgs.coreutils}/bin/sleep";
|
2024-09-11 23:16:44 +00:00
|
|
|
steam = "${config.programs.steam.package}/bin/steam";
|
2024-09-09 00:22:14 +00:00
|
|
|
swayosd-client = "${pkgs.swayosd}/bin/swayosd-client";
|
|
|
|
systemctl = "${pkgs.systemd}/bin/systemctl";
|
2024-09-24 16:02:10 +00:00
|
|
|
toggle = "~/.local/bin/toggle";
|
2024-09-09 00:22:14 +00:00
|
|
|
virt-manager = "${config.programs.virt-manager.package}/bin/virt-manager";
|
2024-09-24 16:02:10 +00:00
|
|
|
vm = "~/.local/bin/vm";
|
2024-09-14 21:05:34 +00:00
|
|
|
walker = "${config.home-manager.users.${config.custom.username}.programs.walker.package}/bin/walker";
|
2024-09-09 00:22:14 +00:00
|
|
|
waydroid = "${pkgs.waydroid}/bin/waydroid";
|
2024-09-24 16:02:10 +00:00
|
|
|
zoom = "~/.local/bin/zoom";
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
cfg = config.custom.desktops.hyprland.binds;
|
2024-09-11 23:16:44 +00:00
|
|
|
in {
|
|
|
|
options.custom.desktops.hyprland.binds.enable = mkOption {default = false;};
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
config.home-manager.users.${config.custom.username} = mkIf cfg.enable {
|
2024-09-11 23:16:44 +00:00
|
|
|
wayland.windowManager.hyprland.settings = let
|
|
|
|
# Reverse mods and key for alphabetical sorting
|
|
|
|
#?? key <"KEY"> <"MODS"|null> <"DISPATCHER"> <"PARAMS"|null>
|
|
|
|
key = key: mods: dispatcher: params: "${
|
|
|
|
if (isNull mods)
|
|
|
|
then ""
|
|
|
|
else mods
|
|
|
|
}, ${key}, ${dispatcher}${
|
|
|
|
if (isNull params)
|
|
|
|
then ""
|
|
|
|
else ", ${params}"
|
|
|
|
}";
|
|
|
|
in {
|
2024-09-09 00:22:14 +00:00
|
|
|
# https://wiki.hyprland.org/Configuring/Binds
|
|
|
|
#?? bind = MODS, KEY, DISPATCHER, [PARAMS]
|
|
|
|
#?? wev
|
|
|
|
|
|
|
|
# Lockscreen binds
|
|
|
|
bindl = [
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "Delete" "Ctrl" "exec" "${hyprctl} reload")
|
|
|
|
(key "Delete" "Ctrl+Alt" "exec" "${loginctl} terminate-session ''")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "Slash" "Super" "exec" inhibit)
|
|
|
|
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "L" "Super" "exec" "${hyprlock} --immediate & ${sleep} 1 && ${hyprctl} dispatch dpms off")
|
2024-09-09 00:22:14 +00:00
|
|
|
|
2024-09-09 22:37:50 +00:00
|
|
|
# Laptop lid switches
|
|
|
|
# https://wiki.hyprland.org/Configuring/Binds/#switches
|
|
|
|
#?? hyprctl devices
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "switch:off:Lid Switch" null "dpms" "on") # Open
|
|
|
|
(key "switch:on:Lid Switch" null "dpms" "off") # Close
|
2024-09-09 00:22:14 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Mouse binds
|
|
|
|
bindm = [
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "mouse:272" "Super" "movewindow" null) # LMB
|
|
|
|
(key "mouse:273" "Super" "resizewindow" null) # RMB
|
2024-09-09 00:22:14 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Repeat binds
|
|
|
|
binde = [
|
|
|
|
# Media keys
|
|
|
|
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "XF86AudioMute" null "exec" "${swayosd-client} --output-volume mute-toggle") # F1
|
|
|
|
(key "XF86AudioLowerVolume" null "exec" "${swayosd-client} --output-volume lower") # F2
|
|
|
|
(key "XF86AudioRaiseVolume" null "exec" "${swayosd-client} --output-volume raise") # F3
|
|
|
|
(key "XF86AudioPrev" null "exec" "${playerctl} previous") # F4
|
|
|
|
(key "XF86AudioPlay" null "exec" "${playerctl} play-pause") # F5
|
|
|
|
(key "XF86AudioNext" null "exec" "${playerctl} next") # F6
|
|
|
|
(key "XF86MonBrightnessDown" null "exec" "${swayosd-client} --brightness lower") # F7
|
|
|
|
(key "XF86MonBrightnessUp" null "exec" "${swayosd-client} --brightness raise") # F8
|
|
|
|
(key "XF86AudioMedia" null "exec" "${notify-send} test") # F12
|
2024-09-09 00:22:14 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Release binds
|
|
|
|
bindr = [
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "Alt_L" "Super+Alt" "togglespecialworkspace" "wallpaper")
|
2024-09-13 18:44:54 +00:00
|
|
|
(key "Alt_L" "Super+Alt+Shift" "movetoworkspacesilent" "special:wallpaper")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "Control_L" "Super+Ctrl" "layoutmsg" "swapwithmaster master")
|
|
|
|
(key "Control_L" "Super+Ctrl+Alt+Shift" "layoutmsg" "removemaster")
|
|
|
|
(key "Control_L" "Super+Ctrl+Shift" "layoutmsg" "addmaster")
|
|
|
|
(key "Shift_L" "Super+Shift" "workspace" "previous")
|
2024-09-24 23:23:22 +00:00
|
|
|
(key "Super_L" "Super" "exec" "${menu}")
|
2024-09-14 21:06:18 +00:00
|
|
|
(key "Super_L" "Super+Alt" "exec" "${menu} --passwords")
|
|
|
|
(key "Super_L" "Super+Ctrl" "exec" "${menu} --calculator")
|
|
|
|
(key "Super_L" "Super+Ctrl+Shift" "exec" "${menu} --networks")
|
2024-09-24 23:23:22 +00:00
|
|
|
(key "Super_L" "Super+Shift" "exec" "${menu} --search")
|
2024-09-09 00:22:14 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Regular binds
|
|
|
|
bind = [
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "mouse:274" "Super" "layoutmsg" "swapwithmaster master")
|
|
|
|
(key "mouse:274" "Super+Shift" "layoutmsg" "addmaster")
|
|
|
|
(key "mouse:274" "Super+Ctrl+Shift" "layoutmsg" "removemaster")
|
|
|
|
|
|
|
|
(key "Backslash" "Super" "layoutmsg" "orientationcenter")
|
|
|
|
(key "Backslash" "Super+Shift" "splitratio" "exact 0.5") # Reset layout ratio
|
|
|
|
(key "Backspace" "Super" "changegroupactive" "f")
|
|
|
|
(key "Backspace" "Super+Ctrl" "togglegroup" null)
|
|
|
|
(key "Backspace" "Super+Ctrl+Shift" "lockactivegroup" "toggle")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "Backspace" "Super+Shift" "movegroupwindow" null)
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "Bracketleft" "Super" "layoutmsg" "orientationprev")
|
|
|
|
(key "Bracketleft" "Super+Shift" "splitratio" "-0.1")
|
|
|
|
(key "Bracketright" "Super" "layoutmsg" "orientationnext")
|
|
|
|
(key "Bracketright" "Super+Shift" "splitratio" "+0.1")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "Delete" "Super" "exec" "${swayosd-client} --output-volume mute")
|
2024-09-24 23:24:27 +00:00
|
|
|
(key "Delete" "Super+Shift" "exec" "${left} --scroll kensington-orbit-wireless-tb-mouse")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "Down" "Super" "movewindow" "d")
|
|
|
|
(key "Down" "Super+Shift" "movewindoworgroup" "d")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "Equal" "Super" "exec" "${swayosd-client} --output-volume raise")
|
|
|
|
(key "Equal" "Super+Shift" "exec" "${zoom} +0.1")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "Escape" "Super" "togglefloating" null)
|
|
|
|
(key "Escape" "Super+Alt" "exec" "lifx state --color red")
|
|
|
|
(key "Escape" "Super+Shift" "centerwindow" null)
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "Left" "Super" "movewindow" "l")
|
|
|
|
(key "Left" "Super+Shift" "movewindoworgroup" "l")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "Minus" "Super" "exec" "${swayosd-client} --output-volume lower")
|
|
|
|
(key "Minus" "Super+Shift" "exec" "${zoom} -0.1")
|
|
|
|
(key "Print" "Shift" "exec" "${screenshot} display")
|
|
|
|
(key "Print" "Super" "exec" "${screenshot} selection --edit")
|
|
|
|
(key "Print" "Super+Shift" "exec" "${screenshot} display --edit")
|
|
|
|
(key "Print" null "exec" "${screenshot} selection")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "Return" "Super" "fullscreen" "1") # Maximize
|
|
|
|
(key "Return" "Super+Shift" "fullscreen" "0") # Fullscreen
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "Right" "Super" "movewindow" "r")
|
|
|
|
(key "Right" "Super+Shift" "movewindoworgroup" "r")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "Space" "Ctrl" "exec" (concatStringsSep " " [
|
2024-09-24 16:02:10 +00:00
|
|
|
"${toggle}"
|
2024-09-11 23:16:44 +00:00
|
|
|
"--focus"
|
|
|
|
"--type class"
|
|
|
|
"--expression '^dropdown$'"
|
|
|
|
"--workspace special:dropdown"
|
|
|
|
"--"
|
|
|
|
"${kitty} --app-id dropdown --override font_size=12"
|
|
|
|
]))
|
|
|
|
(key "Space" "Ctrl+Alt" "exec" "lifx toggle")
|
|
|
|
(key "Space" "Ctrl+Shift" "exec" (concatStringsSep " " [
|
2024-09-24 16:02:10 +00:00
|
|
|
"${toggle}"
|
2024-09-11 23:16:44 +00:00
|
|
|
"--type title"
|
|
|
|
"--expression '^Picture.in.[Pp]icture$'"
|
|
|
|
"--workspace special:pip"
|
|
|
|
]))
|
|
|
|
(key "Space" "Super" "togglespecialworkspace" "scratchpad")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "Space" "Super+Shift" "movetoworkspacesilent" "special:scratchpad")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "Tab" "Super" "cyclenext" "tiled")
|
|
|
|
(key "Tab" "Super+Shift" "alterzorder" "top")
|
|
|
|
(key "Tab" "Super+Shift" "cyclenext" "floating")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "Up" "Super" "movewindow" "u")
|
|
|
|
(key "Up" "Super+Shift" "movewindoworgroup" "u")
|
2024-09-11 23:16:44 +00:00
|
|
|
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "0" "Super" "exec" "${audio}")
|
|
|
|
(key "0" "Super+Shift" "exec" "${zoom}")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "1" "Ctrl+Alt" "exec" "lifx state --brightness 0.01")
|
|
|
|
(key "1" "Super" "workspace" "1")
|
|
|
|
(key "1" "Super+Alt" "exec" "lifx state --kelvin 1500")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "1" "Super+Shift" "movetoworkspacesilent" "1")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "2" "Ctrl+Alt" "exec" "lifx state --brightness 0.25")
|
|
|
|
(key "2" "Super" "workspace" "2")
|
|
|
|
(key "2" "Super+Alt" "exec" "lifx state --kelvin 2500")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "2" "Super+Shift" "movetoworkspacesilent" "2")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "3" "Ctrl+Alt" "exec" "lifx state --brightness 0.50")
|
|
|
|
(key "3" "Super" "workspace" "3")
|
|
|
|
(key "3" "Super+Alt" "exec" "lifx state --kelvin 3000")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "3" "Super+Shift" "movetoworkspacesilent" "3")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "4" "Ctrl+Alt" "exec" "lifx state --brightness 0.75")
|
|
|
|
(key "4" "Super" "workspace" "4")
|
|
|
|
(key "4" "Super+Alt" "exec" "lifx state --kelvin 4000")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "4" "Super+Shift" "movetoworkspacesilent" "4")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "5" "Ctrl+Alt" "exec" "lifx state --brightness 1.00")
|
|
|
|
(key "5" "Super" "workspace" "5")
|
|
|
|
(key "5" "Super+Alt" "exec" "lifx state --kelvin 5000")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "5" "Super+Shift" "movetoworkspacesilent" "5")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "6" "Super" "workspace" "6")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "6" "Super+Shift" "movetoworkspacesilent" "6")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "7" "Super" "workspace" "7")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "7" "Super+Shift" "movetoworkspacesilent" "7")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "8" "Super" "workspace" "8")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "8" "Super+Shift" "movetoworkspacesilent" "8")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "9" "Super" "workspace" "9")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "9" "Super+Shift" "movetoworkspacesilent" "9")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "A" "Ctrl+Alt" "exec" "${waydroid} session stop")
|
|
|
|
(key "A" "Super" "togglespecialworkspace" "android")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "A" "Super+Shift" "movetoworkspacesilent" "special:android")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "B" "Super" "exec" "[group new lock; tile] ${firefox-esr}")
|
|
|
|
(key "C" "Super" "exec" codium)
|
|
|
|
(key "E" "Super" "exec" gnome-text-editor)
|
|
|
|
(key "F" "Super" "exec" nautilus)
|
|
|
|
(key "G" "Super" "workspace" "name:game")
|
|
|
|
(key "G" "Super+Alt" "workspace" "name:gamescope")
|
|
|
|
(key "G" "Super+Ctrl+Alt" "exec" "${pkill} gamescope")
|
2024-09-13 18:44:54 +00:00
|
|
|
(key "G" "Super+Shift" "movetoworkspacesilent" "name:game")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "K" "Super" "exec" obsidian)
|
|
|
|
(key "M" "Super" "togglespecialworkspace" "music")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "M" "Super+Shift" "movetoworkspacesilent" "special:music")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "O" "Super" "togglespecialworkspace" "office")
|
2024-09-14 21:03:48 +00:00
|
|
|
(key "O" "Super+Ctrl" "exec" "${onlyoffice}")
|
2024-09-13 18:44:54 +00:00
|
|
|
(key "O" "Super+Shift" "movetoworkspacesilent" "special:office")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "P" "Super" "exec" "${hyprpicker} --autocopy")
|
|
|
|
(key "P" "Super+Shift" "exec" "${hyprpicker} --autocopy --format rgb")
|
|
|
|
(key "Q" "Ctrl+Alt" "exec" "${kill} -9 $(${hyprctl} -j activewindow | ${jq} .pid)")
|
|
|
|
(key "Q" "Ctrl+Alt+Shift" "exec" "close") # Quit all windows
|
|
|
|
(key "Q" "Super" "killactive" null)
|
|
|
|
(key "S" "Ctrl+Alt" "exec" "${pkill} steam")
|
|
|
|
(key "S" "Super" "togglespecialworkspace" "steam")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "S" "Super+Shift" "movetoworkspacesilent" "special:steam")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "S" "Super+Shift" "exec" steam)
|
|
|
|
(key "T" "Ctrl+Alt" "exec" "${pkill} kitty")
|
|
|
|
(key "T" "Super" "togglespecialworkspace" "terminal")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "T" "Super+Shift" "movetoworkspacesilent" "special:terminal")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "T" "Super+Shift" "exec" kitty)
|
2024-09-24 23:21:27 +00:00
|
|
|
(key "V" "Super" "exec" "${kitty} --app-id clipboard --override font_size=12 ${clipse}")
|
|
|
|
(key "V" "Super+Shift" "exec" "${clipse} --clear && ${notify-send} clipse 'Clipboard cleared' --urgency low")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "W" "Super" "togglespecialworkspace" "vm")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "W" "Super+Ctrl" "exec" "${vm} -x ${
|
2024-09-11 23:16:44 +00:00
|
|
|
if config.custom.hidpi
|
|
|
|
then "/scale:140 +f"
|
|
|
|
else ""
|
|
|
|
}")
|
2024-09-24 16:02:10 +00:00
|
|
|
(key "W" "Super+Ctrl+Shift" "exec" "${vm} ${virt-manager} --show-domain-console myndows")
|
|
|
|
(key "W" "Super+Shift" "movetoworkspacesilent" "special:vm")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "X" "Super" "workspace" "+1")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "X" "Super+Shift" "movetoworkspacesilent" "+1")
|
2024-09-11 23:16:44 +00:00
|
|
|
(key "Z" "Super" "workspace" "-1")
|
2024-09-12 17:59:25 +00:00
|
|
|
(key "Z" "Super+Shift" "movetoworkspacesilent" "-1")
|
2024-09-09 00:22:14 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|