Compare commits
14 commits
ff341930c9
...
786c090767
Author | SHA1 | Date | |
---|---|---|---|
786c090767 | |||
cfcba50437 | |||
acd5cc0ee3 | |||
9671be0468 | |||
1c024b8559 | |||
b1ac30ba40 | |||
f8081aebc7 | |||
ba5a97852e | |||
1196fdb95b | |||
6cde225c08 | |||
a691050bc4 | |||
c3e79d8926 | |||
e89a712c9a | |||
b057b79671 |
16 changed files with 492 additions and 387 deletions
|
@ -29,7 +29,7 @@ in {
|
|||
ultrawide = mkOption {default = cfg.width * 9 / 16 > cfg.height;}; # Wider than 16:9
|
||||
hidpi = mkOption {default = cfg.scale > 1;};
|
||||
scale = mkOption {default = 1;};
|
||||
border = mkOption {default = 2;};
|
||||
border = mkOption {default = 3;};
|
||||
gap = mkOption {default = 10;};
|
||||
padding = mkOption {default = 51;}; # ?? journalctl --user -u waybar.service | grep height:
|
||||
rounding = mkOption {default = 15;};
|
||||
|
|
|
@ -17,9 +17,6 @@ with lib; let
|
|||
hyprlock = getExe hm.programs.hyprlock.package;
|
||||
hyprpicker = getExe pkgs.hyprpicker;
|
||||
inhibit = hm.home.file.".local/bin/inhibit".source;
|
||||
jq = getExe pkgs.jq;
|
||||
kill = getExe' pkgs.procps "kill";
|
||||
kitty = getExe hm.programs.kitty.package;
|
||||
left = hm.home.file.".local/bin/left".source;
|
||||
loginctl = getExe' pkgs.systemd "loginctl";
|
||||
nautilus = getExe pkgs.nautilus;
|
||||
|
@ -34,227 +31,246 @@ with lib; let
|
|||
steam = getExe config.programs.steam.package;
|
||||
swayosd-client = getExe' pkgs.swayosd "swayosd-client";
|
||||
toggle = hm.home.file.".local/bin/toggle".source;
|
||||
uwsm = getExe pkgs.uwsm;
|
||||
virt-manager = getExe config.programs.virt-manager.package;
|
||||
vrr = hm.home.file.".local/bin/vrr".source;
|
||||
waydroid = getExe pkgs.waydroid;
|
||||
window = hm.home.file.".local/bin/window".source;
|
||||
zoom = hm.home.file.".local/bin/zoom".source;
|
||||
|
||||
command = command: "${uwsm} app -- ${command}";
|
||||
in {
|
||||
options.custom.desktops.hyprland.binds.enable = mkOption {default = false;};
|
||||
options.custom.desktops.hyprland.binds = {
|
||||
enable = mkOption {default = false;};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home-manager.users.${config.custom.username} = {
|
||||
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}"
|
||||
}";
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
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 ", ${
|
||||
if dispatcher == "exec"
|
||||
then command params
|
||||
else params
|
||||
}"
|
||||
}";
|
||||
|
||||
dropdown = concatStringsSep " " [
|
||||
"${toggle}"
|
||||
"--focus"
|
||||
"--type class"
|
||||
"--expression '^dropdown$'"
|
||||
"--workspace special:dropdown"
|
||||
"--"
|
||||
"${ghostty} --class=dropdown"
|
||||
];
|
||||
dropdown = concatStringsSep " " [
|
||||
"${toggle}"
|
||||
"--focus"
|
||||
"--type class"
|
||||
"--expression '^.*dropdown$'"
|
||||
"--workspace special:dropdown"
|
||||
"--"
|
||||
|
||||
pip-switch = with config.custom;
|
||||
concatStringsSep " " [
|
||||
"${window} move"
|
||||
"--current"
|
||||
"--property title"
|
||||
"'^Picture.in.[Pp]icture$'"
|
||||
"${toString (gap + border)},${toString (gap + border)}"
|
||||
#!! Must be valid GTK class
|
||||
# https://github.com/ghostty-org/ghostty/issues/3336
|
||||
"${ghostty} --class=gtk.dropdown"
|
||||
];
|
||||
|
||||
pip-toggle = concatStringsSep " " [
|
||||
"${toggle}"
|
||||
"--type title"
|
||||
"--expression '^Picture.in.[Pp]icture$'"
|
||||
"--workspace special:pip"
|
||||
];
|
||||
pip-switch = with config.custom;
|
||||
concatStringsSep " " [
|
||||
"${window} move"
|
||||
"--current"
|
||||
"--property title"
|
||||
"'^Picture.in.[Pp]icture$'"
|
||||
"${toString (gap + border)},${toString (gap + border)}"
|
||||
];
|
||||
|
||||
vm = ''${remote} --vm --client xfreerdp --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${
|
||||
if config.custom.hidpi
|
||||
then "--scale 140"
|
||||
else ""
|
||||
} myndows'';
|
||||
in {
|
||||
# https://wiki.hyprland.org/Configuring/Binds
|
||||
#?? bind = MODS, KEY, DISPATCHER, [PARAMS]
|
||||
#?? wev
|
||||
pip-toggle = concatStringsSep " " [
|
||||
"${toggle}"
|
||||
"--type title"
|
||||
"--expression '^Picture.in.[Pp]icture$'"
|
||||
"--workspace special:pip"
|
||||
];
|
||||
|
||||
# Regular binds
|
||||
bind = [];
|
||||
vm = ''${remote} --vm --client xfreerdp --username Myned --password "$(${cat} ${config.age.secrets."desktop/vm/myndows.pass".path})" ${
|
||||
if config.custom.hidpi
|
||||
then "--scale 140"
|
||||
else ""
|
||||
} myndows'';
|
||||
in {
|
||||
# https://wiki.hyprland.org/Configuring/Binds
|
||||
#?? bind = MODS, KEY, DISPATCHER, [PARAMS]
|
||||
#?? wev
|
||||
|
||||
# Repeat binds
|
||||
binde = [
|
||||
# Media keys
|
||||
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
|
||||
(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
|
||||
# Regular binds
|
||||
bind = [];
|
||||
|
||||
# Meta alternatives
|
||||
(key "0" "Super" "exec" "${swayosd-client} --output-volume mute-toggle")
|
||||
(key "Minus" "Super" "exec" "${swayosd-client} --output-volume lower")
|
||||
(key "Equal" "Super" "exec" "${swayosd-client} --output-volume raise")
|
||||
(key "Left" "Super" "exec" "${playerctl} previous")
|
||||
(key "Delete" "Super" "exec" "${playerctl} play-pause")
|
||||
(key "Right" "Super" "exec" "${playerctl} next")
|
||||
(key "Down" "Super" "exec" "${swayosd-client} --brightness lower")
|
||||
(key "Up" "Super" "exec" "${swayosd-client} --brightness raise")
|
||||
# Repeat binds
|
||||
binde = [
|
||||
# Media keys
|
||||
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
|
||||
(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
|
||||
|
||||
# Special keys
|
||||
(key "Apostrophe" "Super" "exec" "${screenshot} selection")
|
||||
(key "Apostrophe" "Super+Alt" "exec" "${screenshot} selection --edit")
|
||||
(key "Apostrophe" "Super+Alt+Shift" "exec" "${screenshot} display --edit")
|
||||
(key "Apostrophe" "Super+Shift" "exec" "${screenshot} display")
|
||||
(key "Backslash" "Super+Shift" "exec" power)
|
||||
(key "Backspace" "Super" "scroller:alignwindow" "middle")
|
||||
(key "Backspace" "Super+Shift" "scroller:fitsize" "visible")
|
||||
(key "Equal" "Super+Shift" "exec" "${zoom} +0.1")
|
||||
(key "Escape" "Super" "togglefloating" null)
|
||||
(key "Escape" "Super+Alt" "exec" "lifx state --color red")
|
||||
(key "Escape" "Super+Shift" "scroller:pin" null)
|
||||
(key "Left" "Super+Ctrl+Shift" "exec" "${left} --scroll kensington-orbit-wireless-tb-mouse")
|
||||
(key "Minus" "Super+Shift" "exec" "${zoom} -0.1")
|
||||
(key "Return" "Super" "fullscreen" "1") # Maximize
|
||||
(key "Return" "Super+Shift" "fullscreen" "0") # Fullscreen
|
||||
(key "Slash" "Super" "exec" vrr)
|
||||
(key "Space" "Ctrl" "exec" dropdown)
|
||||
(key "Space" "Ctrl+Alt" "exec" "lifx toggle")
|
||||
(key "Space" "Ctrl+Shift" "exec" pip-toggle)
|
||||
(key "Space" "Super" "togglespecialworkspace" "scratchpad")
|
||||
(key "Space" "Super+Ctrl+Shift" "exec" pip-switch)
|
||||
(key "Space" "Super+Shift" "movetoworkspacesilent" "special:scratchpad")
|
||||
(key "Tab" "Super" "scroller:toggleoverview" null)
|
||||
# Meta alternatives
|
||||
(key "0" "Super" "exec" "${swayosd-client} --output-volume mute-toggle")
|
||||
(key "Minus" "Super" "exec" "${swayosd-client} --output-volume lower")
|
||||
(key "Equal" "Super" "exec" "${swayosd-client} --output-volume raise")
|
||||
(key "Left" "Super" "exec" "${playerctl} previous")
|
||||
(key "Delete" "Super" "exec" "${playerctl} play-pause")
|
||||
(key "Right" "Super" "exec" "${playerctl} next")
|
||||
(key "Down" "Super" "exec" "${swayosd-client} --brightness lower")
|
||||
(key "Up" "Super" "exec" "${swayosd-client} --brightness raise")
|
||||
|
||||
# Alphanumeric keys
|
||||
(key "0" "Super+Shift" "exec" zoom)
|
||||
(key "1" "Ctrl+Alt" "exec" "lifx state --brightness 0.01")
|
||||
(key "1" "Super" "workspace" "1")
|
||||
(key "1" "Super+Alt" "exec" "lifx state --kelvin 1500")
|
||||
(key "1" "Super+Shift" "movetoworkspacesilent" "1")
|
||||
(key "2" "Ctrl+Alt" "exec" "lifx state --brightness 0.25")
|
||||
(key "2" "Super" "workspace" "2")
|
||||
(key "2" "Super+Alt" "exec" "lifx state --kelvin 2500")
|
||||
(key "2" "Super+Shift" "movetoworkspacesilent" "2")
|
||||
(key "3" "Ctrl+Alt" "exec" "lifx state --brightness 0.50")
|
||||
(key "3" "Super" "workspace" "3")
|
||||
(key "3" "Super+Alt" "exec" "lifx state --kelvin 3000")
|
||||
(key "3" "Super+Shift" "movetoworkspacesilent" "3")
|
||||
(key "4" "Ctrl+Alt" "exec" "lifx state --brightness 0.75")
|
||||
(key "4" "Super" "workspace" "4")
|
||||
(key "4" "Super+Alt" "exec" "lifx state --kelvin 4000")
|
||||
(key "4" "Super+Shift" "movetoworkspacesilent" "4")
|
||||
(key "5" "Ctrl+Alt" "exec" "lifx state --brightness 1.00")
|
||||
(key "5" "Super" "workspace" "5")
|
||||
(key "5" "Super+Alt" "exec" "lifx state --kelvin 5000")
|
||||
(key "5" "Super+Shift" "movetoworkspacesilent" "5")
|
||||
(key "6" "Super" "workspace" "6")
|
||||
(key "6" "Super+Shift" "movetoworkspacesilent" "6")
|
||||
(key "7" "Super" "workspace" "7")
|
||||
(key "7" "Super+Shift" "movetoworkspacesilent" "7")
|
||||
(key "8" "Super" "workspace" "8")
|
||||
(key "8" "Super+Shift" "movetoworkspacesilent" "8")
|
||||
(key "9" "Super" "exec" audio)
|
||||
(key "A" "Ctrl+Alt" "exec" "${waydroid} session stop")
|
||||
(key "A" "Super" "scroller:movefocus" "l")
|
||||
(key "A" "Super+Ctrl" "scroller:alignwindow" "left")
|
||||
(key "A" "Super+Shift" "scroller:movewindow" "l")
|
||||
(key "B" "Super" "exec" config.custom.browser.command)
|
||||
(key "C" "Super" "exec" config.custom.menus.clipboard.show)
|
||||
(key "C" "Super+Shift" "exec" config.custom.menus.clipboard.clear)
|
||||
(key "D" "Super" "togglespecialworkspace" "android")
|
||||
(key "D" "Super+Shift" "movetoworkspacesilent" "special:android")
|
||||
(key "E" "Super" "exec" gnome-text-editor)
|
||||
(key "F" "Super" "exec" "${nautilus} --new-window")
|
||||
(key "G" "Super" "togglespecialworkspace" "game")
|
||||
(key "G" "Super+Ctrl" "exec" steam)
|
||||
(key "G" "Super+Shift" "movetoworkspacesilent" "special:game")
|
||||
(key "I" "Super" "exec" codium)
|
||||
(key "K" "Super" "exec" obsidian)
|
||||
(key "M" "Super" "togglespecialworkspace" "music")
|
||||
(key "M" "Super+Shift" "movetoworkspacesilent" "special:music")
|
||||
(key "O" "Super" "exec" "${hyprpicker} --autocopy")
|
||||
(key "O" "Super+Shift" "exec" "${hyprpicker} --autocopy --format rgb")
|
||||
(key "P" "Ctrl+Alt" "exec" "${pkill} --full --exact 1password")
|
||||
(key "P" "Super" "togglespecialworkspace" "password")
|
||||
(key "P" "Super+Shift" "movetoworkspacesilent" "special:password")
|
||||
(key "Q" "Ctrl+Alt" "exec" "${kill} -9 $(${hyprctl} -j activewindow | ${jq} .pid)")
|
||||
(key "Q" "Super" "killactive" null)
|
||||
(key "R" "Super" "scroller:movefocus" "d")
|
||||
(key "R" "Super+Ctrl" "scroller:alignwindow" "down")
|
||||
(key "R" "Super+Shift" "scroller:movewindow" "d")
|
||||
(key "S" "Ctrl+Alt" "exec" "${pkill} --full --exact steam")
|
||||
(key "S" "Super" "scroller:movefocus" "r")
|
||||
(key "S" "Super+Ctrl" "scroller:alignwindow" "right")
|
||||
(key "S" "Super+Shift" "scroller:movewindow" "r")
|
||||
(key "T" "Ctrl+Alt" "exec" "${pkill} --full --exact ghostty")
|
||||
(key "T" "Super" "togglespecialworkspace" "terminal")
|
||||
(key "T" "Super+Ctrl" "exec" ghostty)
|
||||
(key "T" "Super+Shift" "movetoworkspacesilent" "special:terminal")
|
||||
(key "V" "Super" "togglespecialworkspace" "vm")
|
||||
(key "V" "Super+Ctrl" "exec" vm)
|
||||
(key "V" "Super+Ctrl+Shift" "exec" virt-manager)
|
||||
(key "V" "Super+Shift" "movetoworkspacesilent" "special:vm")
|
||||
(key "W" "Super" "scroller:movefocus" "u")
|
||||
(key "W" "Super+Ctrl" "scroller:alignwindow" "up")
|
||||
(key "W" "Super+Shift" "scroller:movewindow" "u")
|
||||
(key "X" "Super" "scroller:cyclesize" "next")
|
||||
(key "Z" "Super" "scroller:cyclesize" "previous")
|
||||
];
|
||||
# Special keys
|
||||
(key "Apostrophe" "Super" "exec" "${screenshot} selection")
|
||||
(key "Apostrophe" "Super+Alt" "exec" "${screenshot} selection --edit")
|
||||
(key "Apostrophe" "Super+Alt+Shift" "exec" "${screenshot} display --edit")
|
||||
(key "Apostrophe" "Super+Shift" "exec" "${screenshot} display")
|
||||
(key "Backslash" "Super+Shift" "exec" power)
|
||||
(key "Backspace" "Super" "scroller:alignwindow" "middle")
|
||||
(key "Backspace" "Super+Shift" "scroller:fitsize" "visible")
|
||||
(key "Equal" "Super+Shift" "exec" "${zoom} +0.1")
|
||||
(key "Escape" "Super" "pin" null)
|
||||
(key "Escape" "Super+Alt" "exec" "lifx state --color red")
|
||||
(key "Escape" "Super+Shift" "togglefloating" null)
|
||||
(key "Left" "Super+Ctrl+Shift" "exec" "${left} --scroll kensington-orbit-wireless-tb-mouse")
|
||||
(key "Minus" "Super+Shift" "exec" "${zoom} -0.1")
|
||||
(key "Return" "Super" "fullscreen" "1") # Maximize
|
||||
(key "Return" "Super+Shift" "fullscreen" "0") # Fullscreen
|
||||
(key "Slash" "Super" "exec" vrr)
|
||||
(key "Space" "Ctrl" "exec" dropdown)
|
||||
(key "Space" "Ctrl+Alt" "exec" "lifx toggle")
|
||||
(key "Space" "Ctrl+Shift" "exec" pip-toggle)
|
||||
(key "Space" "Super" "togglespecialworkspace" "scratchpad")
|
||||
(key "Space" "Super+Ctrl+Shift" "exec" pip-switch)
|
||||
(key "Space" "Super+Shift" "movetoworkspacesilent" "special:scratchpad")
|
||||
(key "Tab" "Super" "scroller:toggleoverview" null)
|
||||
|
||||
# Lockscreen binds
|
||||
bindl = [
|
||||
(key "Delete" "Ctrl" "exec" "${hyprctl} reload")
|
||||
(key "Delete" "Ctrl+Alt" "exec" "${loginctl} terminate-user ''") # Current user sessions
|
||||
(key "Delete" "Super" "exec" inhibit)
|
||||
(key "L" "Super" "exec" "${hyprlock} --immediate & ${sleep} 1 && ${hyprctl} dispatch dpms off")
|
||||
# Alphanumeric keys
|
||||
(key "0" "Super+Shift" "exec" zoom)
|
||||
(key "1" "Ctrl+Alt" "exec" "lifx state --brightness 0.01")
|
||||
(key "1" "Super" "workspace" "1")
|
||||
(key "1" "Super+Alt" "exec" "lifx state --kelvin 1500")
|
||||
(key "1" "Super+Shift" "movetoworkspacesilent" "1")
|
||||
(key "2" "Ctrl+Alt" "exec" "lifx state --brightness 0.25")
|
||||
(key "2" "Super" "workspace" "2")
|
||||
(key "2" "Super+Alt" "exec" "lifx state --kelvin 2500")
|
||||
(key "2" "Super+Shift" "movetoworkspacesilent" "2")
|
||||
(key "3" "Ctrl+Alt" "exec" "lifx state --brightness 0.50")
|
||||
(key "3" "Super" "workspace" "3")
|
||||
(key "3" "Super+Alt" "exec" "lifx state --kelvin 3000")
|
||||
(key "3" "Super+Shift" "movetoworkspacesilent" "3")
|
||||
(key "4" "Ctrl+Alt" "exec" "lifx state --brightness 0.75")
|
||||
(key "4" "Super" "workspace" "4")
|
||||
(key "4" "Super+Alt" "exec" "lifx state --kelvin 4000")
|
||||
(key "4" "Super+Shift" "movetoworkspacesilent" "4")
|
||||
(key "5" "Ctrl+Alt" "exec" "lifx state --brightness 1.00")
|
||||
(key "5" "Super" "workspace" "5")
|
||||
(key "5" "Super+Alt" "exec" "lifx state --kelvin 5000")
|
||||
(key "5" "Super+Shift" "movetoworkspacesilent" "5")
|
||||
(key "6" "Super" "workspace" "6")
|
||||
(key "6" "Super+Shift" "movetoworkspacesilent" "6")
|
||||
(key "7" "Super" "workspace" "7")
|
||||
(key "7" "Super+Shift" "movetoworkspacesilent" "7")
|
||||
(key "8" "Super" "workspace" "8")
|
||||
(key "8" "Super+Shift" "movetoworkspacesilent" "8")
|
||||
(key "9" "Super" "exec" audio)
|
||||
(key "A" "Ctrl+Alt" "exec" "${waydroid} session stop")
|
||||
(key "A" "Super" "scroller:movefocus" "l")
|
||||
(key "A" "Super+Ctrl" "scroller:alignwindow" "left")
|
||||
(key "A" "Super+Shift" "scroller:movewindow" "l")
|
||||
(key "B" "Super" "exec" config.custom.browser.command)
|
||||
(key "C" "Super" "exec" config.custom.menus.clipboard.show)
|
||||
(key "C" "Super+Shift" "exec" config.custom.menus.clipboard.clear)
|
||||
(key "D" "Super" "togglespecialworkspace" "android")
|
||||
(key "D" "Super+Shift" "movetoworkspacesilent" "special:android")
|
||||
(key "E" "Super" "exec" "${gnome-text-editor} --new-window")
|
||||
(key "F" "Super" "exec" "${nautilus} --new-window")
|
||||
(key "G" "Super" "togglespecialworkspace" "game")
|
||||
(key "G" "Super+Ctrl" "exec" steam)
|
||||
(key "G" "Super+Shift" "movetoworkspacesilent" "special:game")
|
||||
(key "I" "Super" "exec" codium)
|
||||
(key "K" "Super" "exec" obsidian)
|
||||
(key "M" "Super" "togglespecialworkspace" "music")
|
||||
(key "M" "Super+Shift" "movetoworkspacesilent" "special:music")
|
||||
(key "O" "Super" "exec" "${hyprpicker} --autocopy")
|
||||
(key "O" "Super+Shift" "exec" "${hyprpicker} --autocopy --format rgb")
|
||||
(key "P" "Ctrl+Alt" "exec" "${pkill} --exact 1password")
|
||||
(key "P" "Super" "togglespecialworkspace" "password")
|
||||
(key "P" "Super+Shift" "movetoworkspacesilent" "special:password")
|
||||
(key "Q" "Ctrl+Alt" "exec" "${hyprctl} kill")
|
||||
(key "Q" "Super" "killactive" null)
|
||||
(key "R" "Super" "scroller:movefocus" "d")
|
||||
(key "R" "Super+Ctrl" "scroller:alignwindow" "down")
|
||||
(key "R" "Super+Shift" "scroller:movewindow" "d")
|
||||
(key "S" "Ctrl+Alt" "exec" "${pkill} --exact steam")
|
||||
(key "S" "Super" "scroller:movefocus" "r")
|
||||
(key "S" "Super+Ctrl" "scroller:alignwindow" "right")
|
||||
(key "S" "Super+Shift" "scroller:movewindow" "r")
|
||||
(key "T" "Ctrl+Alt" "exec" "${pkill} --exact ghostty")
|
||||
(key "T" "Super" "togglespecialworkspace" "terminal")
|
||||
(key "T" "Super+Ctrl" "exec" ghostty)
|
||||
(key "T" "Super+Shift" "movetoworkspacesilent" "special:terminal")
|
||||
(key "V" "Super" "togglespecialworkspace" "vm")
|
||||
(key "V" "Super+Ctrl" "exec" vm)
|
||||
(key "V" "Super+Ctrl+Shift" "exec" virt-manager)
|
||||
(key "V" "Super+Shift" "movetoworkspacesilent" "special:vm")
|
||||
(key "W" "Super" "scroller:movefocus" "u")
|
||||
(key "W" "Super+Ctrl" "scroller:alignwindow" "up")
|
||||
(key "W" "Super+Shift" "scroller:movewindow" "u")
|
||||
(key "X" "Super" "scroller:cyclewidth" "next")
|
||||
(key "X" "Super+Shift" "scroller:cycleheight" "next")
|
||||
(key "Z" "Super" "scroller:cyclewidth" "previous")
|
||||
(key "Z" "Super+Shift" "scroller:cycleheight" "previous")
|
||||
];
|
||||
|
||||
# Laptop lid switches
|
||||
# https://wiki.hyprland.org/Configuring/Binds/#switches
|
||||
#?? hyprctl devices
|
||||
#// (key "switch:off:Lid Switch" null "dpms" "on") # Open
|
||||
#// (key "switch:on:Lid Switch" null "dpms" "off") # Close
|
||||
];
|
||||
# Lockscreen binds
|
||||
bindl = [
|
||||
(key "Delete" "Ctrl" "exec" "${hyprctl} reload")
|
||||
(key "Delete" "Ctrl+Alt" "exec" "${loginctl} terminate-user ''") # Current user sessions
|
||||
(key "Delete" "Super" "exec" inhibit)
|
||||
(key "L" "Super" "exec" "${hyprlock} --immediate & ${sleep} 1 && ${hyprctl} dispatch dpms off")
|
||||
|
||||
# Mouse binds
|
||||
bindm = [
|
||||
(key "mouse:272" "Super" "movewindow" null) # LMB
|
||||
(key "mouse:273" "Super" "resizewindow" null) # RMB
|
||||
];
|
||||
# Laptop lid switches
|
||||
# https://wiki.hyprland.org/Configuring/Binds/#switches
|
||||
#?? hyprctl devices
|
||||
#// (key "switch:off:Lid Switch" null "dpms" "on") # Open
|
||||
#// (key "switch:on:Lid Switch" null "dpms" "off") # Close
|
||||
];
|
||||
|
||||
# Release binds
|
||||
bindr = [
|
||||
(key "Alt_L" "Super+Alt" "togglespecialworkspace" "wallpaper")
|
||||
(key "Alt_L" "Super+Alt+Shift" "movetoworkspacesilent" "special:wallpaper")
|
||||
(key "Control_L" "Super+Ctrl" "scroller:admitwindow" null)
|
||||
(key "Control_L" "Super+Ctrl+Shift" "scroller:expelwindow" null)
|
||||
(key "Shift_L" "Super+Ctrl+Shift" "scroller:setmode" "row")
|
||||
(key "Shift_L" "Super+Shift" "scroller:setmode" "column")
|
||||
(key "Super_L" "Super" "exec" config.custom.menus.show)
|
||||
(key "Super_L" "Super+Alt" "exec" config.custom.menus.vault.show)
|
||||
(key "Super_L" "Super+Ctrl+Shift" "exec" config.custom.menus.network.show)
|
||||
(key "Super_L" "Super+Shift" "exec" config.custom.menus.search.show)
|
||||
];
|
||||
};
|
||||
};
|
||||
# Mouse binds
|
||||
bindm = [
|
||||
(key "mouse:272" "Super" "movewindow" null) # LMB
|
||||
(key "mouse:273" "Super" "resizewindow" null) # RMB
|
||||
];
|
||||
|
||||
# Release binds
|
||||
bindr = [
|
||||
(key "Alt_L" "Super+Alt" "togglespecialworkspace" "wallpaper")
|
||||
(key "Alt_L" "Super+Alt+Shift" "movetoworkspacesilent" "special:wallpaper")
|
||||
(key "Control_L" "Super+Ctrl" "scroller:admitwindow" null)
|
||||
(key "Control_L" "Super+Ctrl+Shift" "scroller:expelwindow" null)
|
||||
|
||||
# BUG: Causes Hyprland to crash when floating the scroller:pin window
|
||||
(key "Shift_L" "Super+Shift" "scroller:pin" null)
|
||||
|
||||
(key "Super_L" "Super" "exec" config.custom.menus.default.show)
|
||||
(key "Super_L" "Super+Alt" "exec" config.custom.menus.vault.show)
|
||||
(key "Super_L" "Super+Ctrl" "exec" config.custom.menus.calculator.show)
|
||||
(key "Super_L" "Super+Ctrl+Shift" "exec" config.custom.menus.network.show)
|
||||
(key "Super_L" "Super+Shift" "exec" config.custom.menus.search.show)
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -13,19 +13,25 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
custom.desktops = mkIf config.custom.full {
|
||||
hyprland = {
|
||||
binds.enable = true;
|
||||
keywords.enable = true;
|
||||
monitors.enable = true;
|
||||
plugins.enable = true;
|
||||
rules.enable = true;
|
||||
variables.enable = true;
|
||||
custom = {
|
||||
desktops = mkIf config.custom.full {
|
||||
hyprland = {
|
||||
binds.enable = true;
|
||||
keywords.enable = true;
|
||||
monitors.enable = true;
|
||||
plugins.enable = true;
|
||||
rules.enable = true;
|
||||
variables.enable = true;
|
||||
};
|
||||
|
||||
gnome = {
|
||||
enable = true;
|
||||
minimal = true;
|
||||
};
|
||||
};
|
||||
|
||||
gnome = {
|
||||
enable = true;
|
||||
minimal = true;
|
||||
programs = {
|
||||
uwsm.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -34,12 +40,20 @@ in {
|
|||
programs.hyprland = {
|
||||
enable = true;
|
||||
package = hm.wayland.windowManager.hyprland.finalPackage;
|
||||
|
||||
# BUG: Some apps launched via exec cause session to end, wrap in uwsm to isolate scope
|
||||
# https://github.com/Vladimir-csp/uwsm/issues/45
|
||||
#?? uwsm app -- COMMAND
|
||||
withUWSM = true;
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
||||
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-gnome
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
|
||||
home-manager.sharedModules = [
|
||||
|
|
|
@ -9,13 +9,18 @@ with lib; let
|
|||
hm = config.home-manager.users.${config.custom.username};
|
||||
|
||||
audio = hm.home.file.".local/bin/audio".source;
|
||||
gnome-text-editor = getExe pkgs.gnome-text-editor;
|
||||
grep = getExe pkgs.gnugrep;
|
||||
left = hm.home.file.".local/bin/left".source;
|
||||
loupe = getExe pkgs.loupe;
|
||||
modprobe = getExe' pkgs.kmod "modprobe";
|
||||
nautilus = getExe pkgs.nautilus;
|
||||
sway-audio-idle-inhibit = getExe pkgs.sway-audio-idle-inhibit;
|
||||
uwsm = getExe pkgs.uwsm;
|
||||
virsh = getExe' config.virtualisation.libvirtd.package "virsh";
|
||||
wallpaper = hm.home.file.".local/bin/wallpaper".source;
|
||||
|
||||
command = command: "${uwsm} app -- ${command}";
|
||||
in {
|
||||
options.custom.desktops.hyprland.keywords = {
|
||||
enable = mkOption {default = false;};
|
||||
|
@ -45,7 +50,7 @@ in {
|
|||
left_handed = true;
|
||||
middle_button_emulation = true;
|
||||
natural_scroll = true;
|
||||
sensitivity = -0.6;
|
||||
sensitivity = -0.7;
|
||||
})
|
||||
|
||||
(devices ["logitech-m570"] {
|
||||
|
@ -82,31 +87,30 @@ in {
|
|||
hm.home.sessionVariables
|
||||
)
|
||||
++ [
|
||||
"EDITOR, gnome-text-editor"
|
||||
"EDITOR, ${gnome-text-editor}"
|
||||
];
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Keywords/#executing
|
||||
exec = [
|
||||
"${left} --init --scroll kensington-orbit-wireless-tb-mouse" # Enforce left-pawed state
|
||||
(command "${left} --init --scroll kensington-orbit-wireless-tb-mouse") # Enforce left-pawed state
|
||||
];
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Keywords/#executing
|
||||
exec-once =
|
||||
[
|
||||
sway-audio-idle-inhibit # Inhibit idle while audio is playing
|
||||
"${audio} --init" # Enforce audio profile state
|
||||
config.custom.menus.clipboard.clear-silent # Clear clipboard history
|
||||
(command sway-audio-idle-inhibit) # Inhibit idle while audio is playing
|
||||
(command "${audio} --init") # Enforce audio profile state
|
||||
(command config.custom.menus.clipboard.clear-silent) # Clear clipboard history
|
||||
|
||||
# HACK: Launch hidden GTK windows to reduce startup time
|
||||
"[workspace special:hidden silent] ${loupe}"
|
||||
"[workspace special:hidden silent] ${nautilus}"
|
||||
"[workspace special:hidden silent] ${command loupe}"
|
||||
"[workspace special:hidden silent] ${command nautilus}"
|
||||
]
|
||||
++ optionals config.custom.wallpaper [
|
||||
"wallpaper"
|
||||
(command wallpaper)
|
||||
]
|
||||
# HACK: Delay driver initialization to work around reset issues
|
||||
++ optionals config.custom.settings.vm.passthrough.blacklist [
|
||||
"${virsh} list | ${grep} ${config.custom.settings.vm.passthrough.guest} || sudo ${modprobe} ${config.custom.settings.vm.passthrough.driver}"
|
||||
# HACK: Delay driver initialization to work around reset issues
|
||||
(command "${virsh} list | ${grep} ${config.custom.settings.vm.passthrough.guest} || sudo ${modprobe} ${config.custom.settings.vm.passthrough.driver}")
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -6,8 +6,13 @@
|
|||
}:
|
||||
with lib; let
|
||||
cfg = config.custom.desktops.hyprland.plugins;
|
||||
hm = config.home-manager.users.${config.custom.username};
|
||||
|
||||
hyprctl = getExe' config.programs.hyprland.package "hyprctl";
|
||||
minimize = hm.home.file.".local/bin/minimize".source;
|
||||
uwsm = getExe pkgs.uwsm;
|
||||
|
||||
command = command: "${uwsm} app -- ${command}";
|
||||
in {
|
||||
options.custom.desktops.hyprland.plugins = {
|
||||
enable = mkOption {default = false;};
|
||||
|
@ -47,19 +52,27 @@ in {
|
|||
# https://github.com/hyprwm/hyprland-plugins/tree/main/hyprbars#buttons-config
|
||||
#?? hyprbars-button = COLOR, SIZE, ICON, EXEC
|
||||
hyprbars-button = [
|
||||
"rgb(dc322f), 16,, ${hyprctl} dispatch killactive" # Close
|
||||
"rgb(d33682), 16,, ${hyprctl} dispatch fullscreen 1" # Maximize
|
||||
"rgb(6c71c4), 16,, minimize" # Minimize
|
||||
"rgb(dc322f), 16,, ${command "${hyprctl} dispatch killactive"}" # Close
|
||||
"rgb(d33682), 16,, ${command "${hyprctl} dispatch fullscreen 1"}" # Maximize
|
||||
"rgb(6c71c4), 16,, ${command minimize}" # Minimize
|
||||
];
|
||||
};
|
||||
|
||||
# https://github.com/dawsers/hyprscroller?tab=readme-ov-file#options
|
||||
scroller = mkIf cfg.hyprscroller {
|
||||
"col.selection_border" = "rgb(d33682)";
|
||||
#// center_row_if_space_available = true;
|
||||
column_default_width = "onethird";
|
||||
#// column_widths = "onethird onehalf twothirds one";
|
||||
#// window_heights = "onethird onehalf twothirds one";
|
||||
center_row_if_space_available = true;
|
||||
|
||||
column_default_width =
|
||||
if config.custom.ultrawide
|
||||
then "threeeighths"
|
||||
else "onethird";
|
||||
|
||||
column_widths =
|
||||
if config.custom.ultrawide
|
||||
then "onefourth threeeighths onehalf fiveeighths threequarters one"
|
||||
else "onethird onehalf twothirds one";
|
||||
|
||||
cyclesize_wrap = false;
|
||||
focus_wrap = false;
|
||||
};
|
||||
|
|
|
@ -9,15 +9,17 @@ with lib; let
|
|||
hm = config.home-manager.users.${config.custom.username};
|
||||
|
||||
_1password = getExe config.programs._1password-gui.package;
|
||||
gamescope = getExe config.programs.gamescope.package;
|
||||
ghostty = getExe hm.programs.ghostty.package;
|
||||
launch = hm.home.file.".local/bin/launch".source;
|
||||
libreoffice = getExe config.custom.programs.libreoffice.package;
|
||||
loupe = getExe pkgs.loupe;
|
||||
steam = getExe config.programs.steam.package;
|
||||
uwsm = getExe pkgs.uwsm;
|
||||
virt-manager = getExe pkgs.virt-manager;
|
||||
waydroid = getExe pkgs.waydroid;
|
||||
youtube-music = getExe pkgs.youtube-music;
|
||||
|
||||
command = command: "${uwsm} app -- ${command}";
|
||||
in {
|
||||
options.custom.desktops.hyprland.rules = {
|
||||
enable = mkOption {default = false;};
|
||||
|
@ -30,19 +32,21 @@ in {
|
|||
# https://wiki.hyprland.org/Configuring/Workspace-Rules
|
||||
#?? workspace = WORKSPACE, RULES
|
||||
workspace = [
|
||||
"special:android, on-created-empty:${launch} --workspace special:android --empty ${waydroid} app launch com.YoStarEN.Arknights"
|
||||
"special:game, on-created-empty:${steam}"
|
||||
"special:music, on-created-empty:${youtube-music}"
|
||||
"special:office, on-created-empty:${launch} --workspace special:office --empty --tile -- ${libreoffice}"
|
||||
"special:password, on-created-empty:${launch} --workspace special:password --empty ${_1password}"
|
||||
"special:terminal, on-created-empty:${ghostty}"
|
||||
"special:vm, on-created-empty:${launch} --workspace special:vm --empty ${virt-manager}"
|
||||
"special:wallpaper, on-created-empty:${loupe} /tmp/wallpaper.png"
|
||||
"special:android, on-created-empty:${command "${launch} --workspace special:android --empty ${waydroid} app launch com.YoStarEN.Arknights"}"
|
||||
"special:game, on-created-empty:${command steam}"
|
||||
"special:music, on-created-empty:${command youtube-music}"
|
||||
"special:office, on-created-empty:${command "${launch} --workspace special:office --empty --tile -- ${libreoffice}"}"
|
||||
"special:password, on-created-empty:${command "${launch} --workspace special:password --empty ${_1password}"}"
|
||||
"special:terminal, on-created-empty:${command ghostty}"
|
||||
"special:vm, on-created-empty:${command "${launch} --workspace special:vm --empty ${virt-manager}"}"
|
||||
"special:wallpaper, on-created-empty:${command "${loupe} /tmp/wallpaper.png"}"
|
||||
];
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Window-Rules
|
||||
#?? windowrulev2 = RULE, WINDOW
|
||||
windowrulev2 = with config.custom; let
|
||||
gaps_in = gap / 4;
|
||||
|
||||
# HACK: Attempts to account for hypr-specific scale, gaps, borders, and bar padding
|
||||
### Static geometry rules
|
||||
tr = num: toString (builtins.floor num); # Convert truncated float to string
|
||||
|
@ -50,6 +54,7 @@ in {
|
|||
# Bottom center
|
||||
android = rec {
|
||||
x = tr (width / scale / 2 - (toInt w) / 2);
|
||||
|
||||
y = tr (height
|
||||
/ scale
|
||||
- (toInt h)
|
||||
|
@ -60,27 +65,30 @@ in {
|
|||
then - border # Cause unknown
|
||||
else 0
|
||||
));
|
||||
|
||||
w = tr (
|
||||
width
|
||||
/ scale
|
||||
* (
|
||||
if ultrawide
|
||||
then 0.5 # 50%
|
||||
else 1
|
||||
then 3.0 / 8.0 # threeeighths
|
||||
else 1.0 # one
|
||||
)
|
||||
+ (
|
||||
if ultrawide
|
||||
then - gap / 2 * 2 # Center layout padding between windows
|
||||
then - gaps_in * 2
|
||||
else - gap * 2
|
||||
)
|
||||
- border * 2
|
||||
);
|
||||
h = tr (height / scale * 0.5); # 50%
|
||||
|
||||
h = tr (height / scale * 0.5);
|
||||
};
|
||||
|
||||
# Bottom center
|
||||
clipboard = rec {
|
||||
x = tr (width / scale / 2 - (toInt w) / 2);
|
||||
|
||||
y = tr (height
|
||||
/ scale
|
||||
- (toInt h)
|
||||
|
@ -91,13 +99,15 @@ in {
|
|||
then - border # Cause unknown
|
||||
else 0
|
||||
));
|
||||
|
||||
w = "600";
|
||||
h = tr (height / scale * 0.75); # 75%
|
||||
h = tr (height / scale * 0.75);
|
||||
};
|
||||
|
||||
# Bottom center
|
||||
dropdown = rec {
|
||||
x = tr (width / scale / 2 - (toInt w) / 2);
|
||||
|
||||
y = tr (height
|
||||
/ scale
|
||||
- (toInt h)
|
||||
|
@ -108,27 +118,29 @@ in {
|
|||
then - border # Cause unknown
|
||||
else 0
|
||||
));
|
||||
|
||||
w = tr (
|
||||
width
|
||||
/ scale
|
||||
* (
|
||||
if ultrawide
|
||||
then 0.5 # 50%
|
||||
else 1
|
||||
then 3.0 / 8.0 # threeeighths
|
||||
else 1.0 # one
|
||||
)
|
||||
+ (
|
||||
if ultrawide
|
||||
then - gap / 2 * 2 # Center layout padding between windows
|
||||
then - gaps_in * 2
|
||||
else - gap * 2
|
||||
)
|
||||
- border * 2
|
||||
);
|
||||
|
||||
h = tr (height
|
||||
/ scale
|
||||
* (
|
||||
if ultrawide
|
||||
then 0.2 # 20%
|
||||
else 0.3 # 30%
|
||||
then 0.2
|
||||
else 0.3
|
||||
));
|
||||
};
|
||||
|
||||
|
@ -136,7 +148,20 @@ in {
|
|||
pip = rec {
|
||||
x = tr (width / scale - (toInt w) - gap - border);
|
||||
y = tr (gap + border);
|
||||
w = tr (width / scale * 0.25 - gap - gap / 2 - border * 2); # 25%
|
||||
|
||||
w = tr (
|
||||
width
|
||||
/ scale
|
||||
* (
|
||||
if ultrawide
|
||||
then (1 - 3.0 / 8.0) / 2 # threeeighths / 2
|
||||
else 1.0 / 3.0 # onethird
|
||||
)
|
||||
- gap
|
||||
- gaps_in
|
||||
- border * 2
|
||||
);
|
||||
|
||||
h = tr ((toInt w) * 9 / 16 + 1); # 16:9 aspect ratio
|
||||
};
|
||||
|
||||
|
@ -169,11 +194,12 @@ in {
|
|||
focus = expr: rules: merge "focus" expr rules;
|
||||
fullscreen = expr: rules: merge "fullscreen" expr rules;
|
||||
pinned = expr: rules: merge "pinned" expr rules;
|
||||
tag = expr: rules: merge "tag" expr rules;
|
||||
title = expr: rules: merge "title" "^${expr}$" rules;
|
||||
|
||||
### Pseudo-tags
|
||||
# Wrap generated rules in Nix categories
|
||||
tag = {
|
||||
t = {
|
||||
android = rules: [
|
||||
(class "[Ww]aydroid.*" rules)
|
||||
];
|
||||
|
@ -191,7 +217,7 @@ in {
|
|||
];
|
||||
|
||||
dropdown = rules: [
|
||||
(class "dropdown" rules)
|
||||
(class ".*dropdown" rules)
|
||||
];
|
||||
|
||||
editor = rules: [
|
||||
|
@ -216,6 +242,7 @@ in {
|
|||
];
|
||||
|
||||
music = rules: [
|
||||
(class "com\\.github\\.th_ch\\.youtube_music" rules)
|
||||
(class "Spotify" rules)
|
||||
(class "YouTube Music" rules)
|
||||
(title "Spotify Premium" rules)
|
||||
|
@ -241,6 +268,7 @@ in {
|
|||
(class "discord" rules)
|
||||
(class "Element" rules)
|
||||
(class "org\\.telegram\\.desktop" rules)
|
||||
(class "signal" rules)
|
||||
];
|
||||
|
||||
steam = rules: [
|
||||
|
@ -265,83 +293,47 @@ in {
|
|||
in
|
||||
flatten [
|
||||
### Defaults
|
||||
(class ".*" ["float" "suppressevent maximize"])
|
||||
(floating false ["noshadow" "plugin:hyprbars:nobar"])
|
||||
(floating true ["noborder"])
|
||||
(focus false ["plugin:hyprbars:bar_color rgb(073642)" "plugin:hyprbars:title_color rgb(586e75)"])
|
||||
(fullscreen true ["idleinhibit focus"])
|
||||
(pinned true ["bordercolor rgb(073642) rgb(073642)"])
|
||||
(pinned true ["bordercolor rgb(fdf6e3) rgb(fdf6e300)" "noborder 0" "noshadow"])
|
||||
|
||||
(tag.android ["idleinhibit always" "move ${android.x} ${android.y}" "size ${android.w} ${android.h}" "workspace special:android silent" "plugin:hyprbars:nobar"])
|
||||
(tag.browser ["tile" "workspace 1"])
|
||||
(tag.clipboard ["move ${clipboard.x} ${clipboard.y}" "pin" "size ${clipboard.w} ${clipboard.h}" "stayfocused" "plugin:hyprbars:nobar"])
|
||||
(tag.dropdown ["move ${dropdown.x} ${dropdown.y}" "pin" "size ${dropdown.w} ${dropdown.h}" "plugin:hyprbars:nobar"])
|
||||
(tag.editor ["tile"])
|
||||
(tag.files ["center"])
|
||||
(tag.game ["focusonactivate" "idleinhibit always" "noborder" "noshadow" "renderunfocused" "workspace name:game" "plugin:hyprbars:nobar"])
|
||||
(tag.media ["center" "keepaspectratio" "size <90% <90%"])
|
||||
(tag.music ["tile" "workspace special:music silent"])
|
||||
(tag.office ["tile" "workspace special:office silent"])
|
||||
(tag.password ["center" "tile" "workspace special:password silent" "plugin:hyprbars:nobar"])
|
||||
(tag.pip ["keepaspectratio" "move ${pip.x} ${pip.y}" "noinitialfocus" "pin" "size ${pip.w} ${pip.h}" "plugin:hyprbars:nobar"])
|
||||
(tag.social ["tile"])
|
||||
(tag.steam ["suppressevent activate activatefocus" "workspace special:steam silent" "plugin:hyprbars:nobar"])
|
||||
(tag.terminal ["tile"])
|
||||
(tag.vm ["workspace special:vm silent"])
|
||||
(tag "scroller:pinned" ["bordercolor rgb(fdf6e3) rgb(fdf6e300)"])
|
||||
|
||||
(t.android ["float" "idleinhibit always" "move ${android.x} ${android.y}" "size ${android.w} ${android.h}" "workspace special:android silent" "plugin:hyprbars:nobar"])
|
||||
(t.browser ["workspace 1"])
|
||||
(t.clipboard ["float" "move ${clipboard.x} ${clipboard.y}" "pin" "size ${clipboard.w} ${clipboard.h}" "stayfocused" "plugin:hyprbars:nobar"])
|
||||
(t.dropdown ["float" "move ${dropdown.x} ${dropdown.y}" "pin" "size ${dropdown.w} ${dropdown.h}" "plugin:hyprbars:nobar"])
|
||||
(t.game ["focusonactivate" "idleinhibit always" "noborder" "noshadow" "renderunfocused" "workspace name:game" "plugin:hyprbars:nobar"])
|
||||
(t.media ["center" "float" "keepaspectratio" "size <90% <90%"])
|
||||
(t.music ["workspace special:music silent"])
|
||||
(t.office ["workspace special:office silent" "plugin:scroller:group office"])
|
||||
(t.password ["workspace special:password silent" "plugin:hyprbars:nobar"])
|
||||
(t.pip ["float" "keepaspectratio" "move ${pip.x} ${pip.y}" "noinitialfocus" "pin" "size ${pip.w} ${pip.h}" "plugin:hyprbars:nobar"])
|
||||
(t.social ["plugin:scroller:group social" "plugin:scroller:columnwidth onequarter" "plugin:scroller:windowheight onehalf"])
|
||||
(t.steam ["suppressevent activate activatefocus" "workspace special:steam silent" "plugin:hyprbars:nobar"])
|
||||
(t.terminal ["plugin:scroller:group terminal"])
|
||||
(t.vm ["workspace special:vm silent" "plugin:scroller:group vm"])
|
||||
|
||||
### Overrides
|
||||
(class "dev\\.benz\\.walker" ["noanim" "noshadow" "pin" "stayfocused" "plugin:hyprbars:nobar"]) # Imitate layer
|
||||
(class "org\\.gnome\\.NautilusPreviewer" ["stayfocused" "plugin:hyprbars:nobar"]) # Sushi
|
||||
(class "signal" ["tile"]) # Initial window in social group
|
||||
(class "org\\.gnome\\.NautilusPreviewer" ["float" "stayfocused" "plugin:hyprbars:nobar"]) # Sushi
|
||||
(class "steam_app_1473350" ["workspace 0"]) # (the) Gnorp Apologue
|
||||
(class "Tap Wizard 2\\.x86_64" ["workspace 0"])
|
||||
(class "Xdg-desktop-portal-gtk" ["noborder" "noshadow" "plugin:hyprbars:nobar"])
|
||||
|
||||
(title "File Upload" ["center" "float" "size 1000 625"])
|
||||
(title "Open" ["center" "float" "size 1000 625"])
|
||||
(title "Save As" ["center" "float" "size 1000 625"])
|
||||
|
||||
#!! Expressions are not wrapped in ^$
|
||||
(fields {
|
||||
class = "^com\\.github\\.wwmm\\.easyeffects$";
|
||||
title = "^Easy Effects$"; # Main window
|
||||
} ["center" "float" "size 50% 50%"])
|
||||
(fields {
|
||||
class = "^discord$";
|
||||
title = "^Discord Updater$"; # Update dialog
|
||||
} ["float" "nofocus" "plugin:hyprbars:nobar"])
|
||||
(fields {
|
||||
class = "^lutris$";
|
||||
title = "^Lutris$"; # Main window
|
||||
} ["center" "float" "size 1000 500"])
|
||||
(fields {
|
||||
class = "^org\\.gnome\\.Loupe$";
|
||||
title = "^wallpaper.png$";
|
||||
} ["tile" "workspace special:wallpaper silent"])
|
||||
(fields {
|
||||
class = "^org\\.gnome\\.Nautilus$";
|
||||
title = "^Home$"; # Main window
|
||||
} ["size 1000 625"])
|
||||
(fields {
|
||||
class = "^org\\.gnome\\.Nautilus$";
|
||||
title = "^New Folder$";
|
||||
} ["plugin:hyprbars:nobar"])
|
||||
(fields {
|
||||
class = "^org\\.remmina\\.Remmina$";
|
||||
title = "^Remmina.*$"; # Main windows
|
||||
} ["center" "float" "size 1000 500"])
|
||||
} ["workspace special:wallpaper silent"])
|
||||
(fields {
|
||||
class = "^steam$";
|
||||
title = "^notificationtoasts$"; # Steam notifications
|
||||
} ["float" "nofocus" "pin"])
|
||||
(fields {
|
||||
class = "^steam$";
|
||||
title = "^Steam$"; # Main window
|
||||
} ["tile"])
|
||||
(fields {
|
||||
class = "^virt-manager$";
|
||||
title = "^.+on QEMU/KVM$"; # VM window
|
||||
} ["tile"])
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -15,13 +15,21 @@ in {
|
|||
{
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
# https://wiki.hyprland.org/Configuring/Animations/
|
||||
#?? animation = NAME, ONOFF, SPEED, CURVE, [STYLE]
|
||||
#?? animation = NAME, ONOFF, SPEED, CURVE, STYLE
|
||||
animation = [
|
||||
"global, 1, 4, default"
|
||||
"specialWorkspace, 1, 4, default, fade"
|
||||
"windows, 1, 4, default, slide"
|
||||
"workspaces, 1, 4, default, slidevert"
|
||||
"layers, 0"
|
||||
"global, 1, 3, easeOutCubic"
|
||||
"specialWorkspace, 1, 3, easeOutCubic, fade"
|
||||
"windows, 1, 3, easeOutCubic, slide"
|
||||
"workspaces, 1, 3, easeOutCubic, slidevert"
|
||||
];
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Animations/#curves
|
||||
# https://easings.net/
|
||||
#?? bezier = NAME, X0, Y0, X1, Y1
|
||||
bezier = [
|
||||
"easeInOutCubic, 0.65, 0, 0.35, 1"
|
||||
"easeOutCubic, 0.33, 1, 0.68, 1"
|
||||
"easeOutSine, 0.61, 1, 0.88, 1"
|
||||
];
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#binds
|
||||
|
@ -68,9 +76,9 @@ in {
|
|||
# https://wiki.hyprland.org/Configuring/Variables/#general
|
||||
general = {
|
||||
"col.active_border" = "rgb(d33682)";
|
||||
"col.inactive_border" = "rgba(00000000)";
|
||||
"col.inactive_border" = "rgba(d3368200)";
|
||||
"col.nogroup_border_active" = "rgb(dc322f)";
|
||||
"col.nogroup_border" = "rgba(00000000)";
|
||||
"col.nogroup_border" = "rgba(dc322f00)";
|
||||
#// allow_tearing = true;
|
||||
border_size = config.custom.border;
|
||||
extend_border_grab_area = 5;
|
||||
|
@ -95,18 +103,18 @@ in {
|
|||
# https://wiki.hyprland.org/Configuring/Variables/#group
|
||||
group = {
|
||||
"col.border_active" = "rgb(6c71c4)";
|
||||
"col.border_inactive" = "rgba(00000000)";
|
||||
"col.border_inactive" = "rgba(6c71c400)";
|
||||
"col.border_locked_active" = "rgb(cb4b16)";
|
||||
"col.border_locked_inactive" = "rgba(00000000)";
|
||||
"col.border_locked_inactive" = "rgba(cb4b1600)";
|
||||
#// auto_group = false;
|
||||
#// insert_after_current = false;
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#groupbar
|
||||
groupbar = {
|
||||
"col.active" = "rgb(6c71c4)";
|
||||
"col.inactive" = "rgba(00000000)";
|
||||
"col.inactive" = "rgba(6c71c400)";
|
||||
"col.locked_active" = "rgb(cb4b16)";
|
||||
"col.locked_inactive" = "rgba(00000000)";
|
||||
"col.locked_inactive" = "rgba(cb4b1600)";
|
||||
|
||||
font_size =
|
||||
if config.custom.hidpi
|
||||
|
@ -131,7 +139,7 @@ in {
|
|||
mouse_refocus = false; # Required to focus last window on close
|
||||
|
||||
repeat_delay = 250;
|
||||
repeat_rate = 30;
|
||||
repeat_rate = 40;
|
||||
sensitivity = 0.5;
|
||||
scroll_factor = 1.25;
|
||||
#// special_fallthrough = true; # Focus windows under special workspace
|
||||
|
|
|
@ -136,7 +136,7 @@ in {
|
|||
(key "N" "Mod" (spawn networkmanager_dmenu))
|
||||
(key "O" "Mod" (spawn [loupe "/tmp/wallpaper.png"]))
|
||||
(key "P" "Ctrl+Alt" (spawn [pkill "bitwarden"]))
|
||||
(key "P" "Mod" (spawn [bash "-c" config.custom.menus.vault.show]))
|
||||
(key "P" "Mod" (spawn config.custom.menus.vault.show))
|
||||
(key "P" "Mod+Shift" (spawn bitwarden))
|
||||
(key "Q" "Mod" close-window)
|
||||
(key "R" "Mod" focus-window-or-workspace-down)
|
||||
|
@ -156,9 +156,9 @@ in {
|
|||
(key "T" "Mod" (spawn ghostty))
|
||||
(key "Tab" "Mod" switch-focus-between-floating-and-tiling)
|
||||
(key "Up" "Mod" (spawn [swayosd-client "--brightness" "raise"]))
|
||||
(key "V" "Mod" (spawn [bash "-c" config.custom.menus.clipboard.show]))
|
||||
(key "V" "Mod" (spawn config.custom.menus.clipboard.show))
|
||||
(key "V" "Mod+Ctrl" (spawn vm))
|
||||
(key "V" "Mod+Shift" (spawn [bash "-c" config.custom.menus.clipboard.clear]))
|
||||
(key "V" "Mod+Shift" (spawn config.custom.menus.clipboard.clear))
|
||||
(key "W" "Mod" focus-window-or-workspace-up)
|
||||
(key "W" "Mod+Shift" move-window-up-or-to-workspace-up)
|
||||
(key "WheelScrollDown" "Mod" focus-window-or-workspace-down)
|
||||
|
@ -183,9 +183,9 @@ in {
|
|||
# TODO: Uncomment when fixed
|
||||
#// (key "Shift_L" "Mod" focus-workspace-previous)
|
||||
# TODO: Use "Super_L" when fixed
|
||||
(key "Space" "Mod" (spawn [bash "-c" config.custom.menus.show]))
|
||||
(key "Space" "Mod+Ctrl" (spawn [bash "-c" config.custom.menus.calculator.show]))
|
||||
(key "Space" "Mod+Shift" (spawn [bash "-c" config.custom.menus.search.show]))
|
||||
(key "Space" "Mod" (spawn config.custom.menus.default.show))
|
||||
(key "Space" "Mod+Ctrl" (spawn config.custom.menus.calculator.show))
|
||||
(key "Space" "Mod+Shift" (spawn config.custom.menus.search.show))
|
||||
|
||||
# Media keys
|
||||
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
|
||||
|
|
|
@ -30,7 +30,7 @@ in {
|
|||
# https://github.com/sodiboo/niri-flake/blob/main/docs.md#programsnirisettingsinputkeyboardrepeat-delay
|
||||
keyboard = {
|
||||
repeat-delay = 250;
|
||||
repeat-rate = 30;
|
||||
repeat-rate = 40;
|
||||
};
|
||||
|
||||
# BUG: Applies to trackball device, switch to "flat" when per-device configuration is supported
|
||||
|
|
|
@ -8,7 +8,7 @@ with lib; let
|
|||
in {
|
||||
options.custom.menus = {
|
||||
enable = mkOption {default = config.custom.full;};
|
||||
show = mkOption {default = "";};
|
||||
default.show = mkOption {default = "";};
|
||||
calculator.show = mkOption {default = "";};
|
||||
|
||||
clipboard = {
|
||||
|
|
|
@ -8,6 +8,7 @@ with lib; let
|
|||
cfg = config.custom.menus.rofi;
|
||||
hm = config.home-manager.users.${config.custom.username};
|
||||
|
||||
bash = getExe pkgs.bash;
|
||||
cliphist = getExe hm.services.cliphist.package;
|
||||
echo = getExe' pkgs.coreutils "echo";
|
||||
networkmanager_dmenu = getExe pkgs.networkmanager_dmenu;
|
||||
|
@ -24,30 +25,21 @@ in {
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
custom = mkIf (config.custom.menu == "rofi") {
|
||||
menus = let
|
||||
quit = "${pkill} --exact rofi";
|
||||
in {
|
||||
show = "${quit} || ${rofi} -show drun -show-icons";
|
||||
|
||||
calculator.show = concatStringsSep " " [
|
||||
"${quit} || ${rofi}"
|
||||
"-show calc"
|
||||
"-no-history"
|
||||
"-calc-error-color '#dc322f'"
|
||||
''-calc-command "${echo} -n '{result}' | ${wl-copy}"''
|
||||
];
|
||||
menus = mapAttrsRecursive (path: value: pkgs.writeShellScript (concatStringsSep "-" (["menus"] ++ path)) value) {
|
||||
default.show = "${pkill} --exact rofi || ${rofi} -show drun -show-icons";
|
||||
calculator.show = ''${pkill} --exact rofi || ${rofi} -show calc -no-history -calc-error-color '#dc322f' -calc-command "${echo} -n '{result}' | ${wl-copy}"'';
|
||||
|
||||
clipboard = {
|
||||
show = "${quit} || ${rofi} -show clipboard -show-icons";
|
||||
show = "${pkill} --exact rofi || ${rofi} -show clipboard -show-icons";
|
||||
clear = "${cliphist} wipe && ${notify-send} '> cliphist' 'Clipboard cleared' --urgency low";
|
||||
clear-silent = "${cliphist} wipe";
|
||||
};
|
||||
|
||||
dmenu.show = "${quit} || ${rofi} -dmenu";
|
||||
emoji.show = "${quit} || ${rofimoji} --prompt ";
|
||||
network.show = "${quit} || ${networkmanager_dmenu}";
|
||||
dmenu.show = "${pkill} --exact rofi || ${rofi} -dmenu";
|
||||
emoji.show = "${pkill} --exact rofi || ${rofimoji} --prompt ";
|
||||
network.show = "${pkill} --exact rofi || ${networkmanager_dmenu}";
|
||||
search.show = "";
|
||||
vault.show = "${quit} || ${rofi-rbw} --prompt ";
|
||||
vault.show = "${pkill} --exact rofi || ${rofi-rbw} --prompt ";
|
||||
};
|
||||
|
||||
services = {
|
||||
|
|
|
@ -19,9 +19,9 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
custom = {
|
||||
menus = mkIf (config.custom.menu == "walker") {
|
||||
show = walker;
|
||||
custom = mkIf (config.custom.menu == "walker") {
|
||||
menus = mapAttrsRecursive (path: value: pkgs.writeShellScript (concatStringsSep "-" (["menus"] ++ path)) value) {
|
||||
default.show = walker;
|
||||
|
||||
clipboard = {
|
||||
show = "${walker} --modules clipboard";
|
||||
|
|
|
@ -132,6 +132,29 @@ in {
|
|||
gsw = "git switch";
|
||||
gy = "git cherrypick";
|
||||
|
||||
hy = "hyprctl";
|
||||
hyc = "hyprctl clients";
|
||||
hycj = "hyprctl -j clients";
|
||||
hyd = "hyprctl dispatch";
|
||||
hydj = "hyprctl -j dispatch";
|
||||
hydv = "hyprctl devices";
|
||||
hydvj = "hyprctl -j devices";
|
||||
hyj = "hyprctl -j";
|
||||
hyk = "hyprctl keyword";
|
||||
hykj = "hyprctl -j keyword";
|
||||
hyl = "hyprctl rollinglog";
|
||||
hylj = "hyprctl -j rollinglog";
|
||||
hym = "hyprctl monitors";
|
||||
hymj = "hyprctl -j monitors";
|
||||
hyo = "hyprctl output";
|
||||
hyoj = "hyprctl -j output";
|
||||
hyr = "hyprctl reload";
|
||||
hyrj = "hyprctl -j reload";
|
||||
hys = "hyprctl setprop";
|
||||
hysj = "hyprctl -j setprop";
|
||||
hyv = "hyprctl version";
|
||||
hyvj = "hyprctl -j version";
|
||||
|
||||
jc = "journalctl";
|
||||
jcei = "journalctl --pager-end --identifier";
|
||||
jcfi = "journalctl --follow --identifier";
|
||||
|
@ -171,15 +194,37 @@ in {
|
|||
nsn = "nix shell nixpkgs#%";
|
||||
nt = "nix store";
|
||||
|
||||
no = "nixos";
|
||||
nob = "nixos build";
|
||||
nobb = "nixos build boot";
|
||||
nobs = "nixos build switch";
|
||||
nobt = "nixos build test";
|
||||
nod = "nixos diff";
|
||||
nog = "nixos generate";
|
||||
nol = "nixos list";
|
||||
nor = "nixos repl";
|
||||
ni = "niri";
|
||||
nim = "niri msg";
|
||||
nima = "niri msg action";
|
||||
nimaj = "niri msg --json action";
|
||||
nimfo = "niri msg focused-output";
|
||||
nimfoj = "niri msg --json focused-output";
|
||||
nimfw = "niri msg focused-window";
|
||||
nimfwj = "niri msg --json focused-window";
|
||||
nimj = "niri msg --json";
|
||||
niml = "niri msg layers";
|
||||
nimlj = "niri msg --json layers";
|
||||
nimo = "niri msg output";
|
||||
nimoj = "niri msg --json output";
|
||||
nimos = "niri msg outputs";
|
||||
nimosj = "niri msg --json outputs";
|
||||
nimv = "niri msg version";
|
||||
nimvj = "niri msg --json version";
|
||||
nimw = "niri msg windows";
|
||||
nimwj = "niri msg --json windows";
|
||||
nimwk = "niri msg workspaces";
|
||||
nimwkj = "niri msg --json workspaces";
|
||||
|
||||
os = "nixos";
|
||||
osb = "nixos build";
|
||||
osbb = "nixos build boot";
|
||||
osbs = "nixos build switch";
|
||||
osbt = "nixos build test";
|
||||
osd = "nixos diff";
|
||||
osg = "nixos generate";
|
||||
osl = "nixos list";
|
||||
osr = "nixos repl";
|
||||
|
||||
sc = "systemctl";
|
||||
scp = "sudo systemctl poweroff";
|
||||
|
@ -244,8 +289,8 @@ in {
|
|||
wst = "waydroid session stop";
|
||||
wu = "sudo waydroid upgrade";
|
||||
|
||||
zt = "sudo zerotier-cli";
|
||||
ztip = "sudo zerotier-cli get $(sudo zerotier-cli -j listnetworks | jq -r .[-1].id) ip";
|
||||
z = "sudo zerotier-cli";
|
||||
zi = "sudo zerotier-cli get $(sudo zerotier-cli -j listnetworks | jq -r .[-1].id) ip";
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
|
|
|
@ -10,33 +10,37 @@ with lib; let
|
|||
|
||||
rofi = getExe hm.programs.rofi.package;
|
||||
in {
|
||||
options.custom.programs.networkmanager-dmenu.enable = mkOption {default = false;};
|
||||
options.custom.programs.networkmanager-dmenu = {
|
||||
enable = mkOption {default = false;};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# https://github.com/firecat53/networkmanager-dmenu
|
||||
environment.systemPackages = [pkgs.networkmanager_dmenu];
|
||||
|
||||
home-manager.users.${config.custom.username} = {
|
||||
# https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example
|
||||
#!! Option not available, files written directly
|
||||
xdg.configFile."networkmanager-dmenu/config.ini".text = let
|
||||
menu =
|
||||
if config.custom.menu == "rofi"
|
||||
then "${rofi} -dmenu -p "
|
||||
else "";
|
||||
in ''
|
||||
[dmenu]
|
||||
compact = true
|
||||
dmenu_command = ${menu}
|
||||
list_saved = true
|
||||
active_chars =
|
||||
highlight = true
|
||||
wifi_icons =
|
||||
format = {icon} {name}
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
# https://github.com/firecat53/networkmanager-dmenu/blob/main/config.ini.example
|
||||
xdg.configFile = {
|
||||
"networkmanager-dmenu/config.ini".text = let
|
||||
menu =
|
||||
if config.custom.menu == "rofi"
|
||||
then "${rofi} -dmenu -p "
|
||||
else "";
|
||||
in ''
|
||||
[dmenu]
|
||||
compact = true
|
||||
dmenu_command = ${menu}
|
||||
active_chars =
|
||||
highlight = true
|
||||
wifi_icons =
|
||||
format = {icon} {name}
|
||||
|
||||
[dmenu_passphrase]
|
||||
obscure = true
|
||||
'';
|
||||
};
|
||||
[dmenu_passphrase]
|
||||
obscure = true
|
||||
'';
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
17
options/custom/programs/uwsm.nix
Normal file
17
options/custom/programs/uwsm.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.custom.programs.uwsm;
|
||||
in {
|
||||
options.custom.programs.uwsm = {
|
||||
enable = mkOption {default = false;};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# https://github.com/Vladimir-csp/uwsm
|
||||
programs.uwsm.enable = true;
|
||||
};
|
||||
}
|
|
@ -47,7 +47,7 @@ if [[ "$current_workspace" == "$workspace" ]]; then
|
|||
# HACK: Move to current workspace before pinning, otherwise some windows freeze
|
||||
# https://github.com/hyprwm/Hyprland/issues/7609
|
||||
# https://github.com/hyprwm/Hyprland/issues/7191
|
||||
hyprctl dispatch movetoworkspacesilent "0,$type:$expression"
|
||||
#// hyprctl dispatch movetoworkspacesilent "0,$type:$expression"
|
||||
|
||||
hyprctl dispatch pin "$type:$expression" # Pin
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue