aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-05-02 16:29:33 +0530
committerAkshay Nair <phenax5@gmail.com>2025-05-02 16:29:56 +0530
commite9d92cabeed8c9f54c748cddfdc5336fa44fc5bc (patch)
tree9e3b578bc773e65d199446332dccb9baf691d8f3 /scripts
parentb9b036c7eb19dce1b4a996915dcfdfda18b2c6ca (diff)
downloadnixos-config-e9d92cabeed8c9f54c748cddfdc5336fa44fc5bc.tar.gz
nixos-config-e9d92cabeed8c9f54c748cddfdc5336fa44fc5bc.zip
Switch to mopidy
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/commands/:music-web5
-rwxr-xr-xscripts/music/player.sh4
2 files changed, 8 insertions, 1 deletions
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 "...";
}