updated quickshell

This commit is contained in:
2026-08-31 21:20:26 -07:00
parent e09304b0b6
commit 47c0c9c719
25 changed files with 763 additions and 219 deletions

View File

@@ -1,10 +1,58 @@
{ pkgs, lib, ... }:
{ pkgs, lib, config, ... }:
let
mkLua = lib.generators.mkLuaInline;
in
{
wayland.windowManager.hyprland = {
# -------------------------------------------------------------------------
# Per-host monitor configuration.
#
# Hosts declare their displays once, in hosts/<host>/default.nix, via:
# home-manager.users.anish.volt.monitors = [ { ... } ];
# and the setting flows into Hyprland here. The default (empty output +
# preferred mode) works on any machine with any display.
# -------------------------------------------------------------------------
options.volt.monitors = lib.mkOption {
description = "Hyprland monitor rules for this host";
type = lib.types.listOf (lib.types.submodule {
options = {
output = lib.mkOption {
type = lib.types.str;
default = "";
description = "Output name or desc: match. Empty string matches every output.";
};
mode = lib.mkOption {
type = lib.types.str;
default = "preferred";
description = "Resolution@refresh, e.g. \"3840x2160@164.99Hz\" or \"preferred\".";
};
position = lib.mkOption {
type = lib.types.str;
default = "auto";
};
scale = lib.mkOption {
type = lib.types.either lib.types.number lib.types.str;
default = "auto";
};
vrr = lib.mkOption {
type = lib.types.nullOr (lib.types.either lib.types.number lib.types.str);
default = null;
description = "Optional per-monitor VRR setting (0/1/on-demand).";
};
};
});
default = [
{ output = ""; mode = "preferred"; position = "auto"; scale = "auto"; }
];
};
config = {
wayland.windowManager.hyprland.settings.monitor = map (m:
{ inherit (m) output mode position scale; }
// (lib.optionalAttrs (m.vrr != null) { inherit (m) vrr; })
) config.volt.monitors;
wayland.windowManager.hyprland = {
enable = true;
configType = "lua";
package = null; # Hyprland package is managed system-wide via NixOS programs.hyprland
@@ -18,45 +66,16 @@ in
browser = { _var = "brave"; };
# -----------------------------------------------------------------------
# 2. Monitors (hl.monitor)
# 2. Monitors (hl.monitor) - declared per-host via volt.monitors
# (see hosts/<host>/default.nix); defaults to any display @ preferred.
# -----------------------------------------------------------------------
monitor = [
{
output = "eDP-2";
mode = "3840x2160@144";
position = "0x0";
scale = 2;
}
{
output = "desc:Dell Inc. DELL U3419W 28DQ5T2";
mode = "3440x1440@60";
position = "0x-1440";
scale = 1;
}
{
output = "desc:Samsung Electric Company Odyssey Ark H1AK500000";
mode = "3840x2160@144";
position = "3840x0";
scale = 1;
}
{
output = "";
mode = "preferred";
position = "auto";
scale = "auto";
}
];
# -----------------------------------------------------------------------
# 3. Environment Variables (hl.env)
# -----------------------------------------------------------------------
env = [
{ _args = [ "XCURSOR_SIZE" "24" ]; }
{ _args = [ "LIBVA_DRIVE_NAME" "nvidia" ]; }
{ _args = [ "XDG_SESSION_TYPE" "wayland" ]; }
{ _args = [ "GBM_BACKEND" "nvidia-drm" ]; }
{ _args = [ "WLR_NO_HARDWARE_CURSORS" "1" ]; }
{ _args = [ "WLR_DRM_DEVICES" "/dev/dri/card1:/dev/dri/card0" ]; }
];
# -----------------------------------------------------------------------
@@ -76,6 +95,9 @@ in
cursor = {
inactive_timeout = 3;
# Hardware cursors ON (explicit). Note: this replaces the old
# WLR_NO_HARDWARE_CURSORS=1, which forced software rendering.
no_hardware_cursors = false;
};
general = {
@@ -83,11 +105,12 @@ in
gaps_out = 10;
border_size = 2;
col = {
# Silicon Volt: electric lime gradient on focus, glass gray at rest
active_border = {
colors = [ "rgba(33ccffee)" "rgba(00ff99ee)" ];
colors = [ "rgba(cffc00ee)" "rgba(e3ff66ee)" ];
angle = 45;
};
inactive_border = "rgba(595959aa)";
inactive_border = "rgba(ffffff14)";
};
layout = "dwindle";
};
@@ -95,19 +118,19 @@ in
group = {
groupbar = {
font_size = 14;
font_family = "SF Pro Display";
font_family = "JetBrainsMono Nerd Font";
col = {
active = "rgba(33ccff00)";
inactive = "rgba(59595900)";
active = "rgba(cffc0022)";
inactive = "rgba(ffffff08)";
};
};
col = {
border_active = {
colors = [ "rgba(33ccffee)" "rgba(00ff99ee)" ];
colors = [ "rgba(cffc00ee)" "rgba(e3ff66ee)" ];
angle = 45;
};
border_inactive = "rgba(595959aa)";
border_inactive = "rgba(ffffff14)";
};
};
@@ -117,19 +140,25 @@ in
};
decoration = {
rounding = 10;
rounding = 4;
# Subtle glass blur to match the brutalist-glass aesthetic
blur = {
enabled = false;
size = 3;
passes = 1;
enabled = true;
size = 4;
passes = 2;
new_optimizations = true;
ignore_opacity = true;
contrast = 1.1;
brightness = 0.9;
vibrancy = 0.1;
};
shadow = {
enabled = false;
range = 4;
enabled = true;
range = 12;
render_power = 3;
color = "rgba(1a1a1aee)";
color = "rgba(00000066)";
};
};
@@ -180,6 +209,9 @@ in
(mkLua ''function()
hl.exec_cmd("quickshell")
hl.exec_cmd("hyprpaper")
hl.exec_cmd("mako")
hl.exec_cmd("wl-paste --type text --watch cliphist store")
hl.exec_cmd("wl-paste --type image --watch cliphist store")
hl.exec_cmd("${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent")
end'')
];
@@ -196,7 +228,7 @@ in
{ _args = [ (mkLua "mainMod .. \" + SPACE\"") (mkLua "hl.dsp.exec_cmd(\"quickshell ipc call spotlight toggle || rofi -show combi -show-icons\")") ]; }
{ _args = [ (mkLua "mainMod .. \" + N\"") (mkLua "hl.dsp.exec_cmd(\"quickshell ipc call controlCenter toggle || swaync-client -t -sw\")") ]; }
{ _args = [ (mkLua "mainMod .. \" + V\"") (mkLua "hl.dsp.window.float({ action = \"toggle\" })") ]; }
{ _args = [ (mkLua "mainMod .. \" + R\"") (mkLua "hl.dsp.exec_cmd(\"quickshell ipc call spotlight toggle || rofi -show combi -show-icons\")") ]; }
{ _args = [ (mkLua "mainMod .. \" + R\"") (mkLua "hl.dsp.exec_cmd(\"rofi -show combi\")") ]; }
{ _args = [ (mkLua "mainMod .. \" + G\"") (mkLua "hl.dsp.group.toggle()") ]; }
{ _args = [ (mkLua "mainMod .. \" + F\"") (mkLua "hl.dsp.window.fullscreen({ fullscreen = 0 })") ]; }
@@ -274,30 +306,30 @@ in
{
_args = [
"XF86MonBrightnessUp"
(mkLua "hl.dsp.exec_cmd(\"brightnessctl -d acpi_video0 set 5%+\")")
(mkLua "hl.dsp.exec_cmd(\"brightnessctl set 5%+\")")
{ repeating = true; locked = true; }
];
}
{
_args = [
"XF86MonBrightnessDown"
(mkLua "hl.dsp.exec_cmd(\"brightnessctl -d acpi_video0 set 5%-\")")
(mkLua "hl.dsp.exec_cmd(\"brightnessctl set 5%-\")")
{ repeating = true; locked = true; }
];
}
# Lid switch
# Lid switch - generically detects the embedded (eDP*) panel on any laptop
{
_args = [
"switch:off:Lid Switch"
(mkLua "hl.dsp.exec_cmd(\"hyprctl keyword monitor \\\"eDP-2,3840x2160@144,0x0,2\\\"\")")
(mkLua "hl.dsp.exec_cmd(\"m=$(hyprctl monitors | awk '$1==\\\"Monitor\\\"{print $2; exit}'); [ -n \\\"$m\\\" ] && hyprctl keyword monitor \\\"$m, preferred, auto, auto\\\"\")")
{ locked = true; }
];
}
{
_args = [
"switch:on:Lid Switch"
(mkLua "hl.dsp.exec_cmd(\"hyprctl keyword monitor \\\"eDP-2, disable\\\"\")")
(mkLua "hl.dsp.exec_cmd(\"m=$(hyprctl monitors | awk '$1==\\\"Monitor\\\"{print $2; exit}'); [ -n \\\"$m\\\" ] && hyprctl keyword monitor \\\"$m, disable\\\"\")")
{ locked = true; }
];
}
@@ -364,5 +396,6 @@ in
}
];
};
};
};
}