chore(xmobar): truncated mpris2 output and updated scripts

This commit is contained in:
Afonso Franco 2024-09-12 21:42:04 +01:00
parent 10288c1356
commit d83b2600ec
Signed by: afonso
SSH key fingerprint: SHA256:gkVPzsQQJzqi21ntQBV6pXTx4bYI53rFGI4XtvCpwd4
5 changed files with 19 additions and 7 deletions

View file

@ -0,0 +1,12 @@
#!/bin/bash
# Get the MPRIS information
mpris_info=$(playerctl --player=playerctld metadata --format '{{ artist }} - {{ title }}')
# Truncate the output to 15 characters, adding trailing dots if needed
truncated_info=$(printf '%.35s' "$mpris_info")
if [ ${#mpris_info} -gt 35 ]; then
truncated_info="${truncated_info}..."
fi
echo "$truncated_info"