From cbfda49e578cf18e7f5e605ca5e073fe0a1c0c17 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 12 Nov 2023 17:19:14 +0100 Subject: added appned2mpv --- bin/extra/append2mpv | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 bin/extra/append2mpv (limited to 'bin/extra') diff --git a/bin/extra/append2mpv b/bin/extra/append2mpv new file mode 100755 index 0000000..28c3916 --- /dev/null +++ b/bin/extra/append2mpv @@ -0,0 +1,30 @@ +#!/bin/sh +IPC="/tmp/mpvsocket" + +die () { >&2 printf '%s\n' "$@"; exit 1; } +append_to_mpv() +{ + file="$(readlink -f "$1")" + if [ ! -r "$file" ] + then + >&2 printf '%s\n' "'$file' not found" + return + fi + + echo '{ "command": ["loadfile", "'"$file"'", "append"] }' | + socat - "$IPC" +} + +[ -S "$IPC" ] || die "$IPC is not a socket or doesn't exist" +which socat > /dev/null || exit 1 + + +if [ -t 0 ] +then + append_to_mpv "$1" +else + while read -r file + do + append_to_mpv "$file" + done +fi -- cgit v1.2.3 From 2fd5995ff81e0b1792b5eab3a723d7321dec78cb Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 12 Nov 2023 17:19:48 +0100 Subject: added sgimg --- bin/extra/sgimg | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 bin/extra/sgimg (limited to 'bin/extra') diff --git a/bin/extra/sgimg b/bin/extra/sgimg new file mode 100755 index 0000000..7c1823c --- /dev/null +++ b/bin/extra/sgimg @@ -0,0 +1,6 @@ +#!/bin/sh + +imv "$(find ~/.local/share/gurk/ -type f -printf "%A@\t%p\n" | + sort -n | + tail -n 1 | + cut -f 2-)" -- cgit v1.2.3 From e2ee726c851eadeac489b3288f775af234ba4a7a Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 10 Dec 2023 15:23:29 +0100 Subject: fixed: only find images --- bin/extra/sgimg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/extra') diff --git a/bin/extra/sgimg b/bin/extra/sgimg index 7c1823c..acb8126 100755 --- a/bin/extra/sgimg +++ b/bin/extra/sgimg @@ -1,6 +1,6 @@ #!/bin/sh -imv "$(find ~/.local/share/gurk/ -type f -printf "%A@\t%p\n" | +imv "$(find ~/.local/share/gurk/ -type f \( -iname '*.png' -o -iname '*.jpg' \) -printf "%A@\t%p\n" | sort -n | tail -n 1 | cut -f 2-)" -- cgit v1.2.3 From 0d10205772b2745356969176de6f52510527e5a6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 4 Jan 2024 20:45:39 +0100 Subject: Add more scripts --- bin/extra/mariadb-adduser | 25 +++++++++++++++++++++++++ bin/extra/oclipp | 2 ++ 2 files changed, 27 insertions(+) create mode 100755 bin/extra/mariadb-adduser create mode 100755 bin/extra/oclipp (limited to 'bin/extra') diff --git a/bin/extra/mariadb-adduser b/bin/extra/mariadb-adduser new file mode 100755 index 0000000..d4e1b45 --- /dev/null +++ b/bin/extra/mariadb-adduser @@ -0,0 +1,25 @@ +#!/bin/sh +if [ "$(id -u)" -ne 0 ] +then + >&2 printf "Not root.\n" + exit 1 +fi + +printf 'name? ' +name="$(head -n 1)" +printf 'password? ' +password="$(head -n 1)" +printf 'database? ' +database="$(head -n 1)" + +( + cat <