diff --git a/tree/.config/hypr/hyprland.conf.tpl b/tree/.config/hypr/hyprland.conf.tpl index 4793789..433390b 100644 --- a/tree/.config/hypr/hyprland.conf.tpl +++ b/tree/.config/hypr/hyprland.conf.tpl @@ -131,7 +131,6 @@ device:epic-mouse-v1 { windowrule=float,title:Volume windowrule=size 300 100,title:Volume windowrule=move 100%-375 75,title:Volume -windowrule=noanim,title:Volume windowrule=rounding 35,title:Volume windowrule=nofocus,title:Volume diff --git a/tree/.local/bin/volshow b/tree/.local/bin/volshow index ed7ccb5..078af6e 100755 --- a/tree/.local/bin/volshow +++ b/tree/.local/bin/volshow @@ -1,9 +1,16 @@ #!/bin/sh +# Pops up a window showing the current volume -alacritty -t "Volume" \ - --class "volume_indicator" \ - --config-file "$HOME/.config/alacritty/silent.yml" \ - --command volume_indicator \ - --cols 30 \ - --rows 3 \ - --timeout 1000 +SOCKET="/tmp/volume_indicator" + +# If theres an existing volume_indicator running, prod the socket +# Otherwise, start a new volume_indicator instance. +nc -U "$SOCKET" 2>/dev/null || \ +ba alacritty -t "Volume" \ + --class "volume_indicator" \ + --config-file "$HOME/.config/alacritty/silent.yml" \ + --command volume_indicator \ + --cols 30 \ + --rows 3 \ + --socket "$SOCKET" \ + --timeout 2000