ironbar: Add attempt at using volume module

This was my attempt at using the volume module, however I'd rather not
have to deal with using the small sliders that are extremely difficult
to see with the GTK theme I'm using.

I tried changing the colors with color, background, and border-color,
however I wasn't able to achieve the appearance I wanted, and disabling
the built-in popup results in a buggy left-clicking experience.
This commit is contained in:
Donovan Glover 2024-07-15 19:45:26 -04:00
parent b5fff96a91
commit b3cfdaab9a
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 8 additions and 32 deletions

View File

@ -212,7 +212,7 @@ in
"${super}, S, swapactiveworkspaces, 0 1"
"${super}_SHIFT, S, movetoworkspace, special"
"${super}_SHIFT, A, exec, killall activate-linux || activate-linux -s 1.15 -x 412 -y 120 -c 1-1-1-0.05"
"${super}, O, exec, killall .ironbar-wrapper inotifywait pactl || ironbar"
"${super}, O, exec, killall .ironbar-wrapper inotifywait || ironbar"
"${super}_SHIFT, O, exec, eww close overlay || eww open overlay"
''${super}, comma, exec, playerctl -p mpv position "5-" && ${notifySend} "Minus 5 seconds" "$(playerctl -p mpv position)"''
''${super}, period, exec, playerctl -p mpv position "5+" && ${notifySend} "Plus 5 seconds" "$(playerctl -p mpv position)"''

View File

@ -7,8 +7,6 @@ let
inherit (builtins) toJSON;
mullvadScript = "ironbar/mullvad.fish";
volumeScript = "ironbar/volume.fish";
volumeGet = "ironbar/volume-get.fish";
in
{
home.packages = [ ironbar ];
@ -51,11 +49,11 @@ in
type = "tray";
}
{
type = "script";
cmd = "~/.config/${volumeScript}";
type = "volume";
format = "{icon} {percentage}%";
on_click_left = "swayosd-client --output-volume raise";
on_click_right = "swayosd-client --output-volume lower";
mode = "watch";
disable_popup = true;
}
{
type = "upower";
@ -98,6 +96,10 @@ in
padding-right: 0.5em;
}
.volume:hover {
background: inherit;
}
.upower {
padding-left: 0.2em;
padding-right: 0.2em;
@ -233,30 +235,4 @@ in
end
'';
};
xdg.configFile.${volumeScript} = {
executable = true;
text = /* fish */ ''
#!/usr/bin/env fish
function get_volume
set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1)
echo "$(math "$VOLUME * 100")%"
end
~/.config/${volumeGet}
pactl subscribe | grep --line-buffered -e "" | xargs -L 1 ~/.config/${volumeGet}
'';
};
xdg.configFile.${volumeGet} = {
executable = true;
text = /* fish */ ''
#!/usr/bin/env fish
set VOLUME (wpctl get-volume @DEFAULT_AUDIO_SINK@ | choose 1)
echo "$(math "$VOLUME * 100")%"
'';
};
}