Files
Eww_Widgets/eww/sidebar/scripts/gettitle
T
2023-04-24 15:41:27 +05:45

14 lines
281 B
Bash
Executable File

#!/bin/bash
title=$(playerctl metadata --format '{{ title }}')
count=$(echo -n "$title" | wc -c)
if [ -z "$title" ]; then
echo "Nothing Playing...";
else
if [ "$count" -le 18 ]; then
echo $title
else
echo $(playerctl metadata --format '{{ title }}' | cut -c-18)...
fi
fi