From e9d92cabeed8c9f54c748cddfdc5336fa44fc5bc Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 2 May 2025 16:29:33 +0530 Subject: Switch to mopidy --- scripts/commands/:music-web | 5 +++++ scripts/music/player.sh | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 scripts/commands/:music-web (limited to 'scripts') diff --git a/scripts/commands/:music-web b/scripts/commands/:music-web new file mode 100755 index 0000000..a14afc8 --- /dev/null +++ b/scripts/commands/:music-web @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +xdg-open 'http://localhost:6680' + +# spotify diff --git a/scripts/music/player.sh b/scripts/music/player.sh index e7989e1..270d02f 100755 --- a/scripts/music/player.sh +++ b/scripts/music/player.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +MAX_CHARS=36 + player() { playerctl --player=mopidy "$@"; } # Get player state @@ -16,7 +18,7 @@ get_play_state() { # Get title - artist (song label) #get_label() { player metadata --format '{{title}} - {{artist}}' || echo '...'; } get_label() { - echo -n "$(mpc current | cut -c1-20)"; + echo -n "$(mpc current | cut -c1-"$MAX_CHARS")"; echo "..."; } -- cgit v1.3.1