pinwheel: Ensure waybar scripts use packages with store paths

This commit is contained in:
Alexander Heldt
2024-07-17 10:50:44 +02:00
parent 4d17eb2bf6
commit 522b8318be

View File

@@ -25,7 +25,7 @@ let
''; '';
notifications-status = pkgs.writeShellScript "notifications-status" '' notifications-status = pkgs.writeShellScript "notifications-status" ''
if ${pkgs.dunst}/bin/dunstctl is-paused | grep -q "false"; then if ${pkgs.dunst}/bin/dunstctl is-paused | ${pkgs.gnugrep}/bin/grep -q "false"; then
echo "<span font='14'></span>" echo "<span font='14'></span>"
else else
DISABLED= DISABLED=
@@ -42,7 +42,7 @@ let
STATUS_CONNECTED="Connected" STATUS_CONNECTED="Connected"
status() { status() {
STATUS=$(${pkgs.mullvad}/bin/mullvad status | awk 'NR==1{print $1}') STATUS=$(${pkgs.mullvad}/bin/mullvad status | ${pkgs.gawk}/bin/awk 'NR==1{print $1}')
echo $STATUS echo $STATUS
} }
@@ -53,7 +53,7 @@ let
$STATUS_CONNECTING) $STATUS_CONNECTING)
echo '{ "text": "", "tooltip": "Connecting", "class": "disconnected" }' ;; echo '{ "text": "", "tooltip": "Connecting", "class": "disconnected" }' ;;
$STATUS_CONNECTED) $STATUS_CONNECTED)
TOOLTIP=$(${pkgs.mullvad}/bin/mullvad status | awk 'NR==1') TOOLTIP=$(${pkgs.mullvad}/bin/mullvad status | ${pkgs.gawk}/bin/awk 'NR==1')
echo "{ \"text\": \"\", \"tooltip\":\"$TOOLTIP\" }" ;; echo "{ \"text\": \"\", \"tooltip\":\"$TOOLTIP\" }" ;;
$STATUS_DISCONNECTING) $STATUS_DISCONNECTING)
echo '{ "text": "", "tooltip": "Disconnecting", "class": "disconnected" }' ;; echo '{ "text": "", "tooltip": "Disconnecting", "class": "disconnected" }' ;;
@@ -67,9 +67,9 @@ let
case "$CURRENT_STATUS" in case "$CURRENT_STATUS" in
$STATUS_DISCONNECTED) $STATUS_DISCONNECTED)
${pkgs.mullvad}/bin/mullvad connect --wait > /dev/null && notify-send "Connected to VPN";; ${pkgs.mullvad}/bin/mullvad connect --wait > /dev/null && ${pkgs.libnotify}/bin/notify-send "Connected to VPN";;
$STATUS_CONNECTED) $STATUS_CONNECTED)
${pkgs.mullvad}/bin/mullvad disconnect --wait > /dev/null && notify-send "Disconnected from VPN";; ${pkgs.mullvad}/bin/mullvad disconnect --wait > /dev/null && ${pkgs.libnotify}/bin/notify-send "Disconnected from VPN";;
esac esac
} }
@@ -90,16 +90,16 @@ let
''; '';
toggle-bt-power = pkgs.writeShellScript "toggle-bt-power" '' toggle-bt-power = pkgs.writeShellScript "toggle-bt-power" ''
POWERED_ON=$(bluetoothctl show | grep "Powered: yes") POWERED_ON=$(${pkgs.bluez}/bin/bluetoothctl show | ${pkgs.gnugrep}/bin/grep "Powered: yes")
if [ -z "$POWERED_ON" ]; then if [ -z "$POWERED_ON" ]; then
bluetoothctl power on >> /dev/null ${pkgs.bluez}/bin/bluetoothctl power on >> /dev/null
else else
bluetoothctl power off >> /dev/null ${pkgs.bluez}/bin/bluetoothctl power off >> /dev/null
fi fi
''; '';
container-status = pkgs.writeShellScript "container-status" '' container-status = pkgs.writeShellScript "container-status" ''
RUNNING=$(docker ps -q | wc -l) RUNNING=$(${pkgs.docker}/bin/docker ps -q | ${pkgs.coreutils}/bin/wc -l)
if [ "$RUNNING" -gt 0 ]; then if [ "$RUNNING" -gt 0 ]; then
echo "{ \"text\": \"\", \"tooltip\": \"containers running: $RUNNING\", \"class\": \"running\" }" echo "{ \"text\": \"\", \"tooltip\": \"containers running: $RUNNING\", \"class\": \"running\" }"
fi fi