diff --git a/.local/bin/scripts/checkaccess b/.local/bin/scripts/checkaccess new file mode 100755 index 0000000..6ca0092 --- /dev/null +++ b/.local/bin/scripts/checkaccess @@ -0,0 +1,9 @@ +#!/bin/sh +# Checks whether the current user has rights to the respective file, +# even if it does not exist. +# First parameter defines which rights are required and is passed to "test". +dir="$2" +while ! test -e "$dir" +do dir="$(dirname "$dir")" +done +test $1 "$dir" diff --git a/.local/bin/scripts/chordpro-watch b/.local/bin/scripts/chordpro-watch new file mode 100755 index 0000000..5ff7768 --- /dev/null +++ b/.local/bin/scripts/chordpro-watch @@ -0,0 +1,2 @@ +#!/bin/sh +ls *.cho | entr -c chordpro "$@" /_ diff --git a/.local/bin/scripts/kver b/.local/bin/scripts/kver new file mode 100755 index 0000000..a737f57 --- /dev/null +++ b/.local/bin/scripts/kver @@ -0,0 +1,6 @@ +#!/bin/sh +# Prints the latest Gradle and Kotlin versions +highlight "Kotlin" +curl https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/maven-metadata.xml 2>/dev/null | grep 'version>' | grep -iv '\(m\|rc\)' | sed 's/.*>\(.*\)<.*/\1/' | tail -6 +highlight "Gradle" +curl https://services.gradle.org/distributions/ 2>/dev/null | grep 'name.*all.*sha' | grep -v rc | head -6 | cut -d- -f2