Initial commit
This commit is contained in:
19
dot_config/hypr/scripts/player-status.sh
Normal file
19
dot_config/hypr/scripts/player-status.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
artist_offset=25
|
||||
title_offset=40
|
||||
|
||||
artist=$(playerctl metadata artist)
|
||||
title=$(playerctl metadata title)
|
||||
|
||||
if [ ${#title} != 0 ]; then
|
||||
if [ ${#artist} -gt $artist_offset ]; then
|
||||
artist=$(echo $artist | cut -c1-$artist_offset)
|
||||
artist=$(echo $artist'...')
|
||||
fi
|
||||
if [ ${#title} -gt $title_offset ]; then
|
||||
title=$(echo $title | cut -c1-$title_offset)
|
||||
title=$(echo $title'...')
|
||||
fi
|
||||
echo $artist - $title
|
||||
fi
|
||||
Reference in New Issue
Block a user