aboutsummaryrefslogtreecommitdiff
path: root/.local/share/bin/labels2lrc
diff options
context:
space:
mode:
Diffstat (limited to '.local/share/bin/labels2lrc')
-rwxr-xr-x.local/share/bin/labels2lrc13
1 files changed, 13 insertions, 0 deletions
diff --git a/.local/share/bin/labels2lrc b/.local/share/bin/labels2lrc
new file mode 100755
index 0000000..1491dae
--- /dev/null
+++ b/.local/share/bin/labels2lrc
@@ -0,0 +1,13 @@
+#!/bin/sh
+cat "$@" |\
+ awk '
+BEGIN { FS = "\t" }
+{
+ seconds = $1
+ minutes = int(seconds / 60)
+ seconds = seconds % 60
+ millis = (seconds * 100) % 100
+ printf("[%02d:%02d.%02d]%s\n", minutes, seconds, millis, $3)
+}
+'
+