aboutsummaryrefslogtreecommitdiff
path: root/bin/wms
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-02-20 12:11:51 -0300
committerEuAndreh <eu@euandre.org>2023-02-20 12:12:03 -0300
commitc49a432e10da90f4b5e24b0c5acb4019fc32e137 (patch)
tree7b06af41708cf2932a46948211d8495d63cc0f11 /bin/wms
parentbin/wms: Use player(1) over accessing the cache file (diff)
downloaddotfiles-c49a432e10da90f4b5e24b0c5acb4019fc32e137.tar.gz
dotfiles-c49a432e10da90f4b5e24b0c5acb4019fc32e137.tar.xz
Use "player synopsis" for MPRIS status string
Diffstat (limited to 'bin/wms')
-rwxr-xr-xbin/wms24
1 files changed, 0 insertions, 24 deletions
diff --git a/bin/wms b/bin/wms
index 6710e8f..a9a5784 100755
--- a/bin/wms
+++ b/bin/wms
@@ -19,7 +19,6 @@ help() {
- uuid
- date
- clear-notification
- - mpris
Helper script to launch CLI commands, without having complex
@@ -78,23 +77,6 @@ copy_and_notify() {
"$STR" "$LABEL copied to clipboard"
}
-format_player_name() {
- if echo "$1" | grep -Eq '^firefox\.instance.*'; then
- echo 'firefox'
- else
- echo "$PLAYER"
- fi
-}
-
-format_player_title() {
- TITLE="$(playerctl --player="$PLAYER" metadata xesam:title)"
- if [ "${#TITLE}" -gt 82 ]; then
- printf '%s...\n' "$(echo "$TITLE" | head -c 80)"
- else
- echo "$TITLE"
- fi
-}
-
case "$ACTION" in
uuid)
copy_and_notify "$(uuid)" 'UUID'
@@ -105,12 +87,6 @@ case "$ACTION" in
clear-notification)
dunstctl close
;;
- mpris)
- PLAYER="$(player current)"
- PLAYER_NAME="$(format_player_name "$PLAYER")"
- PLAYER_TITLE="$(format_player_title "$PLAYER")"
- printf '%s: %s\n' "$PLAYER_NAME" "$PLAYER_TITLE"
- ;;
*)
printf 'Bad ACTION: %s.\n\n' "$ACTION" >&2
usage >&2