Skip to content

Instantly share code, notes, and snippets.

@professorjamesmoriarty
Created September 27, 2015 13:47
Show Gist options
  • Save professorjamesmoriarty/2d4fcea1f587750b7bfc to your computer and use it in GitHub Desktop.
Save professorjamesmoriarty/2d4fcea1f587750b7bfc to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# AUTHOR: shaggy
# FILE: songlengthtest.sh
# ROLE: TODO (some explanation)
# CREATED: 2015-09-27 06:31:51
# MODIFIED: 2015-09-27 06:47:40
mus() {
size=$(mpc current -f "[[%artist% - ]%title%]" | awk '{ print length($0); }')
if [ "$size" -gt 30 ]; then
echo -n $(mpc current -f "[[%artist% - ]%title%]"| cut -c1-50)...
else
echo -n $(mpc current -f "[[%artist% - ]%title%]")
fi
}
mus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment