sound menu

This commit is contained in:
KoenDR06 2026-01-19 19:04:05 +01:00
parent c5c233509c
commit 284da9f58a
10 changed files with 48 additions and 22 deletions

View file

@ -7,7 +7,6 @@
cfg = config.horseman.dots.fuzzel; cfg = config.horseman.dots.fuzzel;
username = config.horseman.username; username = config.horseman.username;
colors = config.horseman.catppuccin.colors; colors = config.horseman.catppuccin.colors;
accent = config.horseman.catppuccin.accent;
in { in {
options = { options = {
horseman.dots.fuzzel = { horseman.dots.fuzzel = {
@ -20,15 +19,15 @@ in {
[colors] [colors]
background=${catppuccin.toHexNoHash colors.base}dd background=${catppuccin.toHexNoHash colors.base}dd
text=${catppuccin.toHexNoHash colors.text}ff text=${catppuccin.toHexNoHash colors.text}ff
prompt=${catppuccin.toHexNoHash colors.subtext1}ff prompt=${catppuccin.toHexNoHash colors.accent}ff
placeholder=${catppuccin.toHexNoHash colors.overlay1}ff placeholder=${catppuccin.toHexNoHash colors.overlay1}ff
input=${catppuccin.toHexNoHash colors.text}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=${catppuccin.toHexNoHash colors.surface2}ff
selection-text=${catppuccin.toHexNoHash colors.text}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 counter=${catppuccin.toHexNoHash colors.overlay1}ff
border=${catppuccin.toHexNoHash colors.${accent}}ff border=${catppuccin.toHexNoHash colors.accent}ff
[main] [main]
font=CaskaydiaCoveNerdFont:weight=semilight font=CaskaydiaCoveNerdFont:weight=semilight

View file

@ -7,7 +7,6 @@
cfg = config.horseman.dots.waybar; cfg = config.horseman.dots.waybar;
username = config.horseman.username; username = config.horseman.username;
colors = config.horseman.catppuccin.colors; colors = config.horseman.catppuccin.colors;
accent = config.horseman.catppuccin.accent;
in { in {
options = { options = {
horseman.dots.waybar = { horseman.dots.waybar = {
@ -26,7 +25,7 @@ in {
} }
.modules-left, .modules-center, .modules-right { .modules-left, .modules-center, .modules-right {
border: 2px solid ${catppuccin.toHex colors.${accent}}; border: 2px solid ${catppuccin.toHex colors.accent};
border-radius: 10px; border-radius: 10px;
margin: 5px; margin: 5px;
background: ${catppuccin.toHex colors.base}; background: ${catppuccin.toHex colors.base};
@ -40,7 +39,7 @@ in {
color: ${catppuccin.toHex colors.red}; color: ${catppuccin.toHex colors.red};
} }
#power * { #power * {
color: ${catppuccin.toHex colors.${accent}}; color: ${catppuccin.toHex colors.accent};
transition: 0.2s color ease; transition: 0.2s color ease;
font-size: 26px; font-size: 26px;
} }
@ -62,7 +61,7 @@ in {
} }
#workspaces > * { #workspaces > * {
color: ${catppuccin.toHex colors.${accent}}; color: ${catppuccin.toHex colors.accent};
} }

View file

@ -7,7 +7,6 @@
cfg = config.horseman.dots.wofi; cfg = config.horseman.dots.wofi;
username = config.horseman.username; username = config.horseman.username;
colors = config.horseman.catppuccin.colors; colors = config.horseman.catppuccin.colors;
accent = config.horseman.catppuccin.accent;
in { in {
options = { options = {
horseman.dots.wofi = { horseman.dots.wofi = {
@ -26,7 +25,7 @@ in {
window { window {
margin: 0px; margin: 0px;
padding: 10px; padding: 10px;
border: 3px solid ${catppuccin.toHex colors.${accent}}; border: 3px solid ${catppuccin.toHex colors.accent};
border-radius: 10px; border-radius: 10px;
background-color: ${catppuccin.toRGBA colors.base 0.99}; background-color: ${catppuccin.toRGBA colors.base 0.99};
/* animation: slideIn 0.5s ease-in-out both; */ /* animation: slideIn 0.5s ease-in-out both; */
@ -83,7 +82,7 @@ in {
#input { #input {
margin: 5px 20px; margin: 5px 20px;
padding: 10px; padding: 10px;
border: 2px solid ${catppuccin.toHex colors.${accent}}; border: 2px solid ${catppuccin.toHex colors.accent};
border-radius: 10px; border-radius: 10px;
color: ${catppuccin.toHex colors.text}; color: ${catppuccin.toHex colors.text};
background-color: ${catppuccin.toHex colors.base}; background-color: ${catppuccin.toHex colors.base};
@ -113,7 +112,7 @@ in {
#entry arrow { #entry arrow {
border: none; border: none;
color: ${catppuccin.toHex colors.${accent}}; color: ${catppuccin.toHex colors.accent};
} }
/* Selected Entry */ /* Selected Entry */
@ -123,7 +122,7 @@ in {
} }
#entry:selected { #entry:selected {
border: 1px solid ${catppuccin.toHex colors.${accent}}; border: 1px solid ${catppuccin.toHex colors.accent};
border-radius: 10px; border-radius: 10px;
} }
@ -132,7 +131,7 @@ in {
} }
#entry:drop(active) { #entry:drop(active) {
background-color: ${catppuccin.toHex colors.${accent}}!important; background-color: ${catppuccin.toHex colors.accent}!important;
} }
''; '';
}; };

View file

@ -21,7 +21,10 @@
config.horseman = { config.horseman = {
dots.kitty.fontSize = 13; dots.kitty.fontSize = 13;
catppuccin.flavor = "mocha"; catppuccin = {
flavor = "mocha";
accent = "blue";
};
users.default.enable = true; users.default.enable = true;

View file

@ -26,7 +26,10 @@
}; };
config.horseman = { config.horseman = {
catppuccin.flavor = "mocha"; catppuccin = {
flavor = "mocha";
accent = "blue";
};
users.default.enable = true; users.default.enable = true;

View file

@ -5,7 +5,7 @@ default=15
lines=$((count > default ? default : count)) 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 if [ -n "$a" ]; then
${cmds[a]} ${cmds[a]}

14
misc/sound-menu.sh Executable file
View file

@ -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

View file

@ -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};});
} }

View file

@ -8,7 +8,6 @@
cfg = config.horseman.wm.hyprland; cfg = config.horseman.wm.hyprland;
colors = config.horseman.catppuccin.colors; colors = config.horseman.catppuccin.colors;
accent = config.horseman.catppuccin.accent;
in { in {
imports = [ imports = [
./options.nix ./options.nix
@ -90,8 +89,8 @@ in {
resizeOnBorder = true; resizeOnBorder = true;
allowTearing = false; allowTearing = false;
col.activeBorder = catppuccin.toRGB colors.${accent}; col.activeBorder = catppuccin.toRGB colors.accent;
col.inactiveBorder = catppuccin.toRGBA colors.${accent} 0.25; col.inactiveBorder = catppuccin.toRGBA colors.accent 0.25;
layout = "dwindle"; layout = "dwindle";
}; };

View file

@ -54,6 +54,16 @@ in {
in "pkill fuzzel || ${a}/bin/power-menu"; 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 = []; flags = [];
mods = ["SUPER"]; mods = ["SUPER"];