Add Hyprlock and refactor Hyprland bindings

- Add hyprlock module and package plus hyprlock.conf XDG config
- Rework bindings: introduce mkMenu, gui/term helpers and grouped
  menus (apps, dev, gaming, utility, system) and wire them into the
  main popup; change session lock to hyprlock
- Simplify gaming-apps.nix: use pkgs, reorder packages and add
  wineWow64Packages.staging, steam-run and appimage-run
This commit is contained in:
kptltd00m
2026-06-28 15:36:40 +02:00
parent 51d333d289
commit bcfe305813
4 changed files with 310 additions and 80 deletions
+9 -9
View File
@@ -1,16 +1,15 @@
{ {
pkgs, pkgs,
pkgs-stable,
... ...
}: { }: {
home.packages = (with pkgs-stable; [ home.packages = (with pkgs; [
# ───────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────
# Game launchers # Game launchers
# ───────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────
lutris # Universal launcher for Wine, emulators, and native games lutris # Universal launcher for Wine, emulators, and native games
#prismlauncher # Minecraft launcher with Fabric/Forge/Quilt support #prismlauncher # Minecraft launcher with Fabric/Forge/Quilt support
# ───────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────
# Performance & overlays # Performance & overlays
@@ -28,18 +27,19 @@
protonup-qt # Install and update GE-Proton, Wine-GE, Luxtorpeda, etc. protonup-qt # Install and update GE-Proton, Wine-GE, Luxtorpeda, etc.
winetricks # Install Windows runtimes into Wine prefixes winetricks # Install Windows runtimes into Wine prefixes
protontricks # Winetricks for Steam Proton prefixes protontricks # Winetricks for Steam Proton prefixes
wineWow64Packages.staging # Wine (32/64-bit) with staging patches
# ───────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────
# Vulkan layers # Vulkan layers
# ───────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────
vkbasalt # Vulkan post-processing (CAS sharpening, FXAA, etc.) vkbasalt # Vulkan post-processing (CAS sharpening, FXAA, etc.)
])
++ (with pkgs; [ # ─────────────────────────────────────────────────────────────
wineWow64Packages.staging # Wine (32/64-bit) with staging patches # Runner layers
# ─────────────────────────────────────────────────────────────
steam-run # Run generic Linux binaries inside Steam's runtime steam-run # Run generic Linux binaries inside Steam's runtime
appimage-run # Execute AppImages on NixOS appimage-run # Execute AppImages on NixOS
]); ]);
} }
+241 -71
View File
@@ -2,29 +2,226 @@
pkgs, pkgs,
lib, lib,
config, config,
pkgs-nur-hadi,
... ...
}: let }:
let
colors = config.lib.stylix.colors; colors = config.lib.stylix.colors;
mkMenu = menu: let mkMenu = menu:
configFile = pkgs.writeText "config.yaml" ( let
lib.generators.toYAML {} { configFile = pkgs.writeText "config.yaml" (
anchor = "bottom-right"; lib.generators.toYAML { } {
border = "#${colors.base0D}80"; anchor = "bottom-right";
background = "#${colors.base01}EE"; border = "#${colors.base0D}80";
color = "#${colors.base05}"; background = "#${colors.base01}EE";
margin_right = 15; color = "#${colors.base05}";
margin_bottom = 15; margin_right = 15;
rows_per_column = 5; margin_bottom = 15;
rows_per_column = 5;
inherit menu; inherit menu;
} }
); );
in in
pkgs.writeShellScriptBin "menu" '' pkgs.writeShellScriptBin "menu" ''
exec ${lib.getExe pkgs.wlr-which-key} ${configFile} exec ${lib.getExe pkgs.wlr-which-key} ${configFile}
''; '';
in {
gui = exe: "uwsm app -- ${exe}";
term = exe: "uwsm app -- ${pkgs.ghostty}/bin/ghostty -e ${exe}";
appsMenu = mkMenu [
{
key = "f";
desc = "Firefox";
cmd = gui "${pkgs.firefox}/bin/firefox";
}
{
key = "o";
desc = "Obsidian";
cmd = gui "${pkgs.obsidian}/bin/obsidian";
}
{
key = "t";
desc = "TickTick";
cmd = gui "${pkgs.ticktick}/bin/ticktick";
}
{
key = "n";
desc = "OnlyOffice";
cmd = gui "${pkgs.onlyoffice-desktopeditors}/bin/onlyoffice-desktopeditors";
}
{
key = "v";
desc = "Vesktop";
cmd = gui "${pkgs.vesktop}/bin/vesktop";
}
{
key = "l";
desc = "VLC";
cmd = gui "${pkgs.vlc}/bin/vlc";
}
];
devMenu = mkMenu [
{
key = "z";
desc = "Zed";
cmd = gui "${pkgs.zed-editor}/bin/zed";
}
{
key = "c";
desc = "VSCodium";
cmd = gui "${pkgs.vscodium}/bin/codium";
}
{
key = "g";
desc = "Ghostty";
cmd = gui "${pkgs.ghostty}/bin/ghostty";
}
{
key = "f";
desc = "Fastfetch";
cmd = term "${pkgs.fastfetch}/bin/fastfetch";
}
{
key = "d";
desc = "Dysk";
cmd = term "${pkgs.dysk}/bin/dysk";
}
{
key = "w";
desc = "Wikiman";
cmd = term "${pkgs.wikiman}/bin/wikiman";
}
{
key = "s";
desc = "STTR";
cmd = term "${pkgs.sttr}/bin/sttr";
}
];
gamingMenu = mkMenu [
{
key = "l";
desc = "Lutris";
cmd = gui "${pkgs.lutris}/bin/lutris";
}
{
key = "p";
desc = "ProtonUp-Qt";
cmd = gui "${pkgs.protonup-qt}/bin/protonup-qt";
}
{
key = "g";
desc = "GOverlay";
cmd = gui "${pkgs.goverlay}/bin/goverlay";
}
];
utilityMenu = mkMenu [
{
key = "B";
desc = "Blueman";
cmd = gui "${pkgs.blueman}/bin/blueman-manager";
}
{
key = "x";
desc = "Bluetoothctl";
cmd = term "${pkgs.bluez}/bin/bluetoothctl";
}
{
key = "w";
desc = "WiFi TUI";
cmd = term "${pkgs.wifitui}/bin/wifitui";
}
{
key = "m";
desc = "Wiremix";
cmd = term "${pkgs.wiremix}/bin/wiremix";
}
{
key = "u";
desc = "USBGuard TUI";
cmd = term "${pkgs-nur-hadi.usbguard-tui}/bin/usbguard-tui";
}
{
key = "c";
desc = "Caligula";
cmd = term "${pkgs.caligula}/bin/caligula";
}
{
key = "h";
desc = "Browsh";
cmd = term "${pkgs.browsh}/bin/browsh";
}
{
key = "p";
desc = "Peaclock";
cmd = term "${pkgs.peaclock}/bin/peaclock";
}
{
key = "o";
desc = "Cbonsai";
cmd = term "${pkgs.cbonsai}/bin/cbonsai";
}
{
key = "i";
desc = "Pipes";
cmd = term "${pkgs.pipes}/bin/pipes";
}
{
key = "t";
desc = "Tealdeer";
cmd = term "${pkgs.tealdeer}/bin/tldr";
}
{
key = "s";
desc = "Hyprlock";
cmd = gui "${pkgs.hyprlock}/bin/hyprlock";
}
];
systemMenu = mkMenu [
{
key = "l";
desc = "Lock";
cmd = "hyprlock";
}
{
key = "w";
desc = "Restart Waybar";
cmd = "pkill -x waybar; waybar";
}
{
key = "r";
desc = "Restart Walker";
cmd = "systemctl --user restart walker.service";
}
{
key = "e";
desc = "Restart Elephant";
cmd = "systemctl --user restart elephant.service";
}
{
key = "s";
desc = "Suspend";
cmd = "systemctl suspend";
}
{
key = "p";
desc = "Power Off";
cmd = "systemctl poweroff";
}
{
key = "b";
desc = "Reboot";
cmd = "systemctl reboot";
}
];
in
{
wayland.windowManager.hyprland.settings = { wayland.windowManager.hyprland.settings = {
"$mod" = "SUPER"; "$mod" = "SUPER";
"$shiftMod" = "SUPER_SHIFT"; "$shiftMod" = "SUPER_SHIFT";
@@ -37,53 +234,28 @@ in {
+ lib.getExe (mkMenu [ + lib.getExe (mkMenu [
{ {
key = "a"; key = "a";
desc = "Proton Authenticator"; desc = "Apps";
cmd = "env WEBKIT_DISABLE_COMPOSITING_MODE=1 ${pkgs.proton-authenticator}/bin/proton-authenticator"; cmd = lib.getExe appsMenu;
} }
{ {
key = "p"; key = "d";
desc = "Proton Pass"; desc = "Dev";
cmd = "${pkgs.proton-pass}/bin/proton-pass"; cmd = lib.getExe devMenu;
} }
{ {
key = "v"; key = "g";
desc = "Proton VPN"; desc = "Gaming";
cmd = "${pkgs.proton-vpn}/bin/protonvpn-app"; cmd = lib.getExe gamingMenu;
} }
{ {
key = "c"; key = "u";
desc = "Proton Calendar"; desc = "Utilities";
cmd = "${config.programs.librewolf.package}/bin/helium 'https://calendar.proton.me/'"; cmd = lib.getExe utilityMenu;
}
{
key = "m";
desc = "Proton Mail";
cmd = "${config.programs.librewolf.package}/bin/helium 'https://mail.proton.me/'";
}
{
key = "o";
desc = "Obsidian";
cmd = "${pkgs.obsidian}/bin/obsidian";
} }
{ {
key = "s"; key = "s";
desc = "Signal"; desc = "System";
cmd = "${pkgs.signal-desktop}/bin/signal-desktop"; cmd = lib.getExe systemMenu;
}
{
key = "t";
desc = "TickTick";
cmd = "${pkgs.ticktick}/bin/ticktick";
}
{
key = "b";
desc = "Helium";
cmd = "${config.programs.librewolf.package}/bin/helium";
}
{
key = "i";
desc = "Helium (Incognito)";
cmd = "${config.programs.librewolf.package}/bin/helium --incognito";
} }
]) ])
) )
@@ -97,7 +269,7 @@ in {
{ {
key = "l"; key = "l";
desc = "Lock"; desc = "Lock";
cmd = "loginctl lock-session"; cmd = "hyprlock";
} }
{ {
key = "s"; key = "s";
@@ -172,23 +344,21 @@ in {
]; ];
bindl = [ bindl = [
# Brightness # Brightness
", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} set 5%+" ", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} set 5%+"
", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} set 5%-" ", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} set 5%-"
# Media
", XF86AudioPlay, exec, ${lib.getExe pkgs.playerctl} play-pause"
", XF86AudioPause, exec, ${lib.getExe pkgs.playerctl} play-pause"
", XF86AudioNext, exec, ${lib.getExe pkgs.playerctl} next"
", XF86AudioPrev, exec, ${lib.getExe pkgs.playerctl} previous"
", XF86AudioStop, exec, ${lib.getExe pkgs.playerctl} stop"
# Sound
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
# Media
", XF86AudioPlay, exec, ${lib.getExe pkgs.playerctl} play-pause"
", XF86AudioPause, exec, ${lib.getExe pkgs.playerctl} play-pause"
", XF86AudioNext, exec, ${lib.getExe pkgs.playerctl} next"
", XF86AudioPrev, exec, ${lib.getExe pkgs.playerctl} previous"
", XF86AudioStop, exec, ${lib.getExe pkgs.playerctl} stop"
# Sound
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioRaiseVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"
", XF86AudioLowerVolume, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0; wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
];
}; };
} }
+2
View File
@@ -19,6 +19,7 @@ in {
./animations.nix ./animations.nix
./bindings.nix ./bindings.nix
./polkitagent.nix ./polkitagent.nix
./hyprlock.nix
./keyboard-backlight.nix # CHANGEME: This is for omen laptop only ./keyboard-backlight.nix # CHANGEME: This is for omen laptop only
]; ];
@@ -31,6 +32,7 @@ in {
libxcb libxcb
hyprland-qtutils hyprland-qtutils
adw-gtk3 adw-gtk3
hyprlock
hyprshot hyprshot
hyprpicker hyprpicker
swappy swappy
+58
View File
@@ -0,0 +1,58 @@
{config, ...}: let
c = config.lib.stylix.colors;
fontSans = config.stylix.fonts.sansSerif.name;
in {
xdg.configFile."hypr/hyprlock.conf".text = ''
general {
hide_cursor = true
grace = 0
}
background {
monitor =
color = rgba(${c."base00-rgb-r"}, ${c."base00-rgb-g"}, ${c."base00-rgb-b"}, 0.90)
blur_passes = 2
blur_size = 8
noise = 0.01
}
label {
monitor =
text = cmd[update:1000] date +"%A, %d %B %Y"
color = rgba(${c."base05-rgb-r"}, ${c."base05-rgb-g"}, ${c."base05-rgb-b"}, 1.0)
font_size = 30
font_family = "${fontSans}"
position = 0, 140
halign = center
valign = center
}
label {
monitor =
text = cmd[update:1000] date +"%H:%M"
color = rgba(${c."base0D-rgb-r"}, ${c."base0D-rgb-g"}, ${c."base0D-rgb-b"}, 1.0)
font_size = 54
font_family = "${fontSans}"
position = 0, 60
halign = center
valign = center
}
input-field {
monitor =
size = 320, 52
outline_thickness = 2
outer_color = rgba(${c."base03-rgb-r"}, ${c."base03-rgb-g"}, ${c."base03-rgb-b"}, 0.60)
inner_color = rgba(${c."base01-rgb-r"}, ${c."base01-rgb-g"}, ${c."base01-rgb-b"}, 0.92)
font_color = rgba(${c."base05-rgb-r"}, ${c."base05-rgb-g"}, ${c."base05-rgb-b"}, 1.0)
fail_color = rgba(${c."base08-rgb-r"}, ${c."base08-rgb-g"}, ${c."base08-rgb-b"}, 1.0)
check_color = rgba(${c."base0B-rgb-r"}, ${c."base0B-rgb-g"}, ${c."base0B-rgb-b"}, 1.0)
dots_spacing = 0.3
dots_center = true
hide_input = false
position = 0, -20
halign = center
valign = center
}
'';
}