Created
September 27, 2015 13:47
-
-
Save professorjamesmoriarty/2d4fcea1f587750b7bfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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