chore(xmobar): truncated mpris2 output and updated scripts
This commit is contained in:
parent
10288c1356
commit
d83b2600ec
5 changed files with 19 additions and 7 deletions
12
.config/xmobar/scripts/mpris2.sh
Executable file
12
.config/xmobar/scripts/mpris2.sh
Executable 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"
|
Loading…
Add table
Add a link
Reference in a new issue