diff --git a/dot_local/bin/executable_media-status b/dot_local/bin/executable_media-status new file mode 100644 index 0000000..8e89b0b --- /dev/null +++ b/dot_local/bin/executable_media-status @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +if ! [[ -x "$(command -v playerctl)" ]]; then + echo "install playerctl" + exit 1 +fi + +while read -r LINE; do + if [[ $LINE == "No players found" ]]; then + ICON="" + OUTPUT="" + else + STATE=$(echo "$LINE" | cut -d " " -f1) + OUTPUT=$(echo "$LINE" | cut -d " " -f2-) + if [[ $STATE == "Paused" ]]; then + ICON="" + else + ICON="" + fi + fi + + echo "$ICON" "${OUTPUT}" +done < <(playerctl metadata -f '{{status}} {{artist}} - {{title}}' -F) diff --git a/dot_local/bin/executable_mullvad-status b/dot_local/bin/executable_mullvad-status index 3c6d254..5f3a2e9 100644 --- a/dot_local/bin/executable_mullvad-status +++ b/dot_local/bin/executable_mullvad-status @@ -9,7 +9,7 @@ fi while read -r LINE; do if echo "$LINE" | grep -q 'Connected'; then # regex grep the relay, e.g. se7 for sweden-7 - OUTPUT=$(echo "$LINE" | grep -oE "\w{2}\d+") + OUTPUT=$(echo "$LINE" | grep -oP "\w{2}\d+") ICON=" " else ICON=" "