Update volshow script to use sockets

This commit is contained in:
2023-10-28 20:16:53 +02:00
parent 6295099bd9
commit 409ce9a05c
2 changed files with 14 additions and 8 deletions

View File

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