summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-08-30 12:31:05 +0200
committerRasmus Steinke <rasi@xssn.at>2015-08-30 12:31:05 +0200
commit761e33cbe906f33551c29fcc2a1b963b9a2a2b23 (patch)
treee6efcef1b8ea44f0c73229d5b02c1d44965bc817 /clerk
parentc51c7af7c8b4ce8a7dcd5dba1867019f75f50949 (diff)
downloadperl-app-clerk-761e33cbe906f33551c29fcc2a1b963b9a2a2b23.tar.gz
perl-app-clerk-761e33cbe906f33551c29fcc2a1b963b9a2a2b23.tar.xz
use an em-dash to mimize clashes with ascii dashes
Diffstat (limited to 'clerk')
-rwxr-xr-xclerk24
1 files changed, 12 insertions, 12 deletions
diff --git a/clerk b/clerk
index 33fc95e..9103f2b 100755
--- a/clerk
+++ b/clerk
@@ -84,7 +84,7 @@ updateCache () {
notify-send "clerk" "updating cache files"
cd $HOME/.config/clerk
rm -f *.cache
- mpc --format '[%mtime%\t%albumartist%|%artist%] - (%date%) - %album%' \
+ mpc --format '[%mtime%\t%albumartist%|%artist%] — (%date%) — %album%' \
search filename '' \
| grep -v '^ — ' \
| grep -v ' — $' \
@@ -93,19 +93,19 @@ updateCache () {
| sort -u \
| sort -nr \
| awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}' \
- | awk -F ' - ' '{ print $1 "\t" $2 " - " $3 }' \
+ | awk -F ' — ' '{ print $1 "\t" $2 " — " $3 }' \
| sed 's,^\([^\t]*\t[^\t]\{40\}\)[^\t]*,\1,' | column -o $'\t' -s $'\t' -t | uniq > $HOME/.config/clerk/latest.cache
- mpc --format '[%albumartist%|%artist%]\t(%date%) - %album%' \
+ mpc --format '[%albumartist%|%artist%]\t(%date%) — %album%' \
search filename '' \
- | grep -v '^ - ' \
- | grep -v ' - $' \
+ | grep -v '^ — ' \
+ | grep -v ' — $' \
| sort \
| uniq \
| column -o $'\t' -s $'\t' -t > $HOME/.config/clerk/albums.cache
mpc --format '[[%title%\t[(by %artist%[ on %album%])]]|[%file%]]\t%file%' \
search filename '' \
- | grep -v '^ - ' \
- | grep -v ' - $' \
+ | grep -v '^ — ' \
+ | grep -v ' — $' \
| uniq \
| sed 's,^\([^\t]\{40\}\)[^\t]*,\1…,' | column -o $'\t' -s $'\t' -t \
> $HOME/.config/clerk/tracks.cache
@@ -1005,8 +1005,8 @@ TRACK_TEMP=$((echo -e "0 Return to Browse Menu\n---"; cat $HOME/.config/clerk/l
else
artist=$(echo -en "$TRACK" | awk -F '\t' '{ print $1 }' | sed -e 's/[[:space:]]*$//')
group2=$(echo -en "$TRACK" | awk -F '\t' '{ print $2 }' | sed -e 's/[[:space:]]*$//')
- album=$(echo "$group2" | awk -F " - " '{print $2}')
- date=$(echo "$group2" | awk -F " - " '{print $1}' | awk '{print substr($0, 2, length($0) - 2)}')
+ album=$(echo "$group2" | awk -F " — " '{print $2}')
+ date=$(echo "$group2" | awk -F " — " '{print $1}' | awk '{print substr($0, 2, length($0) - 2)}')
echo -e "${TRACK}\nartist: ${artist}\nalbum: ${album}\ndate: ${date}"
@@ -1077,10 +1077,10 @@ TRACK_TEMP=$((echo -e "0 Return to Browse Menu\n---"; cat $HOME/.config/clerk/a
unset line
AddAlbumTags
else
- artist=$(echo -en "$TRACK" | awk -F "\t" '{print $1}' | sed -e 's/[[:space:]]*$//')
+ artist=$(echo -en "$TRACK" | awk -F '\t' '{print $1}' | sed -e 's/[[:space:]]*$//')
group2=$(echo -en "$TRACK" | awk -F '\t' '{print $2}'| sed -e 's/[[:space:]]*$//')
- album=$(echo "$group2" | awk -F " - " '{print $2}')
- date=$(echo "$group2" | awk -F " - " '{print $1}' | awk '{print substr($0, 2, length($0) - 2)}')
+ album=$(echo "$group2" | awk -F " — " '{print $2}')
+ date=$(echo "$group2" | awk -F " — " '{print $1}' | awk '{print substr($0, 2, length($0) - 2)}')
echo -e "artist: ${artist}\ndate: ${date}\nalbum: ${album}"
if [[ $val -eq 11 ]]; then