From 284da9f58a42c606d87e99b38fb4a94697d5dc0e Mon Sep 17 00:00:00 2001 From: KoenDR06 Date: Mon, 19 Jan 2026 19:04:05 +0100 Subject: [PATCH] sound menu --- dots/.config/fuzzel/fuzzel.ini.nix | 9 ++++----- dots/.config/waybar/style.css.nix | 7 +++---- dots/.config/wofi/style.css.nix | 11 +++++------ machines/artemis/modules.nix | 5 ++++- machines/terra/modules.nix | 5 ++++- misc/power-menu.sh | 2 +- misc/sound-menu.sh | 14 ++++++++++++++ modules/catppuccin/default.nix | 2 +- modules/wm/hyprland/default.nix | 5 ++--- modules/wm/hyprland/keybindings.nix | 10 ++++++++++ 10 files changed, 48 insertions(+), 22 deletions(-) create mode 100755 misc/sound-menu.sh diff --git a/dots/.config/fuzzel/fuzzel.ini.nix b/dots/.config/fuzzel/fuzzel.ini.nix index b45a3c0..e5b6efb 100644 --- a/dots/.config/fuzzel/fuzzel.ini.nix +++ b/dots/.config/fuzzel/fuzzel.ini.nix @@ -7,7 +7,6 @@ cfg = config.horseman.dots.fuzzel; username = config.horseman.username; colors = config.horseman.catppuccin.colors; - accent = config.horseman.catppuccin.accent; in { options = { horseman.dots.fuzzel = { @@ -20,15 +19,15 @@ in { [colors] background=${catppuccin.toHexNoHash colors.base}dd text=${catppuccin.toHexNoHash colors.text}ff - prompt=${catppuccin.toHexNoHash colors.subtext1}ff + prompt=${catppuccin.toHexNoHash colors.accent}ff placeholder=${catppuccin.toHexNoHash colors.overlay1}ff input=${catppuccin.toHexNoHash colors.text}ff - match=${catppuccin.toHexNoHash colors.${accent}}ff + match=${catppuccin.toHexNoHash colors.accent}ff selection=${catppuccin.toHexNoHash colors.surface2}ff selection-text=${catppuccin.toHexNoHash colors.text}ff - selection-match=${catppuccin.toHexNoHash colors.${accent}}ff + selection-match=${catppuccin.toHexNoHash colors.accent}ff counter=${catppuccin.toHexNoHash colors.overlay1}ff - border=${catppuccin.toHexNoHash colors.${accent}}ff + border=${catppuccin.toHexNoHash colors.accent}ff [main] font=CaskaydiaCoveNerdFont:weight=semilight diff --git a/dots/.config/waybar/style.css.nix b/dots/.config/waybar/style.css.nix index c2c7d82..ccf18e8 100644 --- a/dots/.config/waybar/style.css.nix +++ b/dots/.config/waybar/style.css.nix @@ -7,7 +7,6 @@ cfg = config.horseman.dots.waybar; username = config.horseman.username; colors = config.horseman.catppuccin.colors; - accent = config.horseman.catppuccin.accent; in { options = { horseman.dots.waybar = { @@ -26,7 +25,7 @@ in { } .modules-left, .modules-center, .modules-right { - border: 2px solid ${catppuccin.toHex colors.${accent}}; + border: 2px solid ${catppuccin.toHex colors.accent}; border-radius: 10px; margin: 5px; background: ${catppuccin.toHex colors.base}; @@ -40,7 +39,7 @@ in { color: ${catppuccin.toHex colors.red}; } #power * { - color: ${catppuccin.toHex colors.${accent}}; + color: ${catppuccin.toHex colors.accent}; transition: 0.2s color ease; font-size: 26px; } @@ -62,7 +61,7 @@ in { } #workspaces > * { - color: ${catppuccin.toHex colors.${accent}}; + color: ${catppuccin.toHex colors.accent}; } diff --git a/dots/.config/wofi/style.css.nix b/dots/.config/wofi/style.css.nix index f010423..3457fd5 100644 --- a/dots/.config/wofi/style.css.nix +++ b/dots/.config/wofi/style.css.nix @@ -7,7 +7,6 @@ cfg = config.horseman.dots.wofi; username = config.horseman.username; colors = config.horseman.catppuccin.colors; - accent = config.horseman.catppuccin.accent; in { options = { horseman.dots.wofi = { @@ -26,7 +25,7 @@ in { window { margin: 0px; padding: 10px; - border: 3px solid ${catppuccin.toHex colors.${accent}}; + border: 3px solid ${catppuccin.toHex colors.accent}; border-radius: 10px; background-color: ${catppuccin.toRGBA colors.base 0.99}; /* animation: slideIn 0.5s ease-in-out both; */ @@ -83,7 +82,7 @@ in { #input { margin: 5px 20px; padding: 10px; - border: 2px solid ${catppuccin.toHex colors.${accent}}; + border: 2px solid ${catppuccin.toHex colors.accent}; border-radius: 10px; color: ${catppuccin.toHex colors.text}; background-color: ${catppuccin.toHex colors.base}; @@ -113,7 +112,7 @@ in { #entry arrow { border: none; - color: ${catppuccin.toHex colors.${accent}}; + color: ${catppuccin.toHex colors.accent}; } /* Selected Entry */ @@ -123,7 +122,7 @@ in { } #entry:selected { - border: 1px solid ${catppuccin.toHex colors.${accent}}; + border: 1px solid ${catppuccin.toHex colors.accent}; border-radius: 10px; } @@ -132,7 +131,7 @@ in { } #entry:drop(active) { - background-color: ${catppuccin.toHex colors.${accent}}!important; + background-color: ${catppuccin.toHex colors.accent}!important; } ''; }; diff --git a/machines/artemis/modules.nix b/machines/artemis/modules.nix index d1bad07..e4c0f29 100644 --- a/machines/artemis/modules.nix +++ b/machines/artemis/modules.nix @@ -21,7 +21,10 @@ config.horseman = { dots.kitty.fontSize = 13; - catppuccin.flavor = "mocha"; + catppuccin = { + flavor = "mocha"; + accent = "blue"; + }; users.default.enable = true; diff --git a/machines/terra/modules.nix b/machines/terra/modules.nix index 43c8e46..6601368 100644 --- a/machines/terra/modules.nix +++ b/machines/terra/modules.nix @@ -26,7 +26,10 @@ }; config.horseman = { - catppuccin.flavor = "mocha"; + catppuccin = { + flavor = "mocha"; + accent = "blue"; + }; users.default.enable = true; diff --git a/misc/power-menu.sh b/misc/power-menu.sh index 34f2f6b..3a8be49 100755 --- a/misc/power-menu.sh +++ b/misc/power-menu.sh @@ -5,7 +5,7 @@ default=15 lines=$((count > default ? default : count)) -a=$(printf ' Shut down\n Reboot\n Lock\n Log out' | fuzzel --dmenu --index --lines $lines --placeholder "Power action: " -I) +a=$(printf ' Shut down\n Reboot\n Lock\n Log out' | fuzzel --cache /dev/null --dmenu --index --lines $lines --placeholder "Power action: " -I) if [ -n "$a" ]; then ${cmds[a]} diff --git a/misc/sound-menu.sh b/misc/sound-menu.sh new file mode 100755 index 0000000..1676471 --- /dev/null +++ b/misc/sound-menu.sh @@ -0,0 +1,14 @@ +mapfile -t ids < <(wpctl status | sed -n '/Audio/,/Video/p' | sed -n '/├─ Sinks:/,/├─ Sources:/p' | tail -n +2 | head -n -2 | sed -r 's/^........//' | sed -r 's/\. .*//') + +mapfile -t sinks < <(wpctl status | sed -n '/Audio/,/Video/p' | sed -n '/├─ Sinks:/,/├─ Sources:/p' | tail -n +2 | head -n -2 | sed -r 's/^........//' | sed -r 's/[0-9]+\. //') + +count=${#ids[@]} +default=15 + +lines=$((count > default ? default : count)) + +a=$(printf '%s\n' "${sinks[@]}" | fuzzel --cache /dev/null --dmenu --index --lines $lines --placeholder "Switch audio source: " -I) + +if [ -n "$a" ]; then + wpctl set-default ${ids[a]} +fi diff --git a/modules/catppuccin/default.nix b/modules/catppuccin/default.nix index e6adb02..4e5af6c 100644 --- a/modules/catppuccin/default.nix +++ b/modules/catppuccin/default.nix @@ -597,5 +597,5 @@ in { }; }; - config.horseman.catppuccin.colors = lib.mkDefault flavors.${cfg.flavor}; + config.horseman.catppuccin.colors = lib.mkDefault (flavors.${cfg.flavor} // {accent = cfg.flavor.${cfg.accent};}); } diff --git a/modules/wm/hyprland/default.nix b/modules/wm/hyprland/default.nix index 59428ce..908eb2b 100644 --- a/modules/wm/hyprland/default.nix +++ b/modules/wm/hyprland/default.nix @@ -8,7 +8,6 @@ cfg = config.horseman.wm.hyprland; colors = config.horseman.catppuccin.colors; - accent = config.horseman.catppuccin.accent; in { imports = [ ./options.nix @@ -90,8 +89,8 @@ in { resizeOnBorder = true; allowTearing = false; - col.activeBorder = catppuccin.toRGB colors.${accent}; - col.inactiveBorder = catppuccin.toRGBA colors.${accent} 0.25; + col.activeBorder = catppuccin.toRGB colors.accent; + col.inactiveBorder = catppuccin.toRGBA colors.accent 0.25; layout = "dwindle"; }; diff --git a/modules/wm/hyprland/keybindings.nix b/modules/wm/hyprland/keybindings.nix index a91699c..0c2ec5c 100644 --- a/modules/wm/hyprland/keybindings.nix +++ b/modules/wm/hyprland/keybindings.nix @@ -54,6 +54,16 @@ in { in "pkill fuzzel || ${a}/bin/power-menu"; } + { + flags = []; + mods = ["SUPER"]; + key = "S"; + dispatcher = "exec"; + params = let + a = pkgs.writeShellScriptBin "sound-menu" (builtins.readFile ../../../misc/sound-menu.sh); + in "pkill fuzzel || ${a}/bin/sound-menu"; + } + { flags = []; mods = ["SUPER"];