about summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/akordy19
-rwxr-xr-xbin/xcf-to-pdf23
2 files changed, 42 insertions, 0 deletions
diff --git a/bin/akordy b/bin/akordy
new file mode 100755
index 0000000..74c13a5
--- /dev/null
+++ b/bin/akordy
@@ -0,0 +1,19 @@
+#!/bin/sh
+## Skrypt wypisuje wszystkie akordy z plików txt w ./piosenki
+
+cat piosenki/*.txt | \
+
+ # Wyświetl tylko napis po znaku '|'
+  awk -F "|" '/|/ { print $2 }' | \
+
+  # Usuń linie zawierające 'kapo'
+  grep -v 'kapo' | \
+
+  # Zamień spacje na entery => każdy akord na osobnej linii
+  tr ' ' '\n' | \
+
+  # Usuń puste linie
+  grep '.' | \
+
+  sort | \
+  uniq
diff --git a/bin/xcf-to-pdf b/bin/xcf-to-pdf
new file mode 100755
index 0000000..34da9c8
--- /dev/null
+++ b/bin/xcf-to-pdf
@@ -0,0 +1,23 @@
+#!/bin/sh
+{
+cat <<EOF
+(define (convert-xcf-to-pdf filename outfile)
+  (let* (
+     (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
+     (drawable (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE)))
+     )
+    (file-pdf-save RUN-NONINTERACTIVE image drawable outfile outfile TRUE TRUE TRUE)
+    (gimp-image-delete image) ; ... or the memory will explode
+    )
+)
+
+(gimp-message-set-handler 1) ; Messages to standard output
+EOF
+
+for i in $*; do
+  echo "(gimp-message \"$i\")"
+  echo "(convert-xcf-to-pdf \"$i\" \"${i%%.xcf}.pdf\")"
+done
+
+echo "(gimp-quit 0)"
+} | gimp -i -b -