summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Jäger <gitcommit@henk.geekmail.org>2021-10-22 22:42:16 +0200
committerHendrik Jäger <gitcommit@henk.geekmail.org>2021-10-22 22:42:16 +0200
commit84d6383e7e10df0b7e3e5dfc839fe7c68657d133 (patch)
treefbc6f0f9df74c7c50f31b4906410f5b6ad38b8bb
parent97e0461b3938abc7cf0cff770a87c1f0c90ec507 (diff)
autoload functions part 2
-rw-r--r--.zsh_functions/henkspngpostproc24
-rw-r--r--.zsh_functions/henkspwgen1
-rw-r--r--.zsh_functions/movies_biggest3
-rw-r--r--.zsh_functions/movies_forgotten3
-rw-r--r--.zsh_functions/movies_newest3
-rw-r--r--.zsh_functions/movies_oldest3
-rw-r--r--.zsh_functions/movies_smallest3
-rw-r--r--.zsh_functions/mpvshuffledir4
-rw-r--r--.zsh_functions/new_hs_project3
-rw-r--r--.zsh_functions/pause_stardew7
-rw-r--r--.zsh_functions/vifind1
11 files changed, 55 insertions, 0 deletions
diff --git a/.zsh_functions/henkspngpostproc b/.zsh_functions/henkspngpostproc
new file mode 100644
index 0000000..8260b1e
--- /dev/null
+++ b/.zsh_functions/henkspngpostproc
@@ -0,0 +1,24 @@
+ local resize_by
+ local img
+ resize_by="$1"
+ shift
+ echo "Creating Directories …"
+ mkdir --parents resized/pngnqed/optipnged optimized
+ for img in $*
+ do
+ echo "Resizing image …"
+ convert -resize $resize_by% "$img" "resized/$img"
+ echo "Running pngnq …"
+ pngnq -s1 -f -d "resized/pngnqed" -e .png "resized/$img"
+ echo "Running optipng …"
+ optipng -force -out "resized/pngnqed/optipnged/$img" "resized/pngnqed/$img"
+ echo "Moving final image to directory 'optimized' …"
+ cp --verbose --interactive --target-directory=optimized/ "resized/pngnqed/optipnged/$img"
+ echo "Removing temporary images …"
+ #rm --verbose --interactive \
+ rm --verbose \
+ "resized/$img" \
+ "resized/pngnqed/$img" \
+ "resized/pngnqed/optipnged/$img"
+ done
+ rmdir --parents resized/pngnqed/optipnged
diff --git a/.zsh_functions/henkspwgen b/.zsh_functions/henkspwgen
new file mode 100644
index 0000000..584a706
--- /dev/null
+++ b/.zsh_functions/henkspwgen
@@ -0,0 +1 @@
+ echo $( (tr -cd '[:alnum:]' | head -c $1) < /dev/urandom)
diff --git a/.zsh_functions/movies_biggest b/.zsh_functions/movies_biggest
new file mode 100644
index 0000000..9170c0f
--- /dev/null
+++ b/.zsh_functions/movies_biggest
@@ -0,0 +1,3 @@
+ mpv ${=MPVOPTS} \
+ (#i)${1:-.}/**/*.(mpeg|webm|avi|flv|mkv|mpg|wmv|wva|mp4|wva|m4v|ogm|mp4|mov|divx)(OL) \
+ $@
diff --git a/.zsh_functions/movies_forgotten b/.zsh_functions/movies_forgotten
new file mode 100644
index 0000000..10703fa
--- /dev/null
+++ b/.zsh_functions/movies_forgotten
@@ -0,0 +1,3 @@
+ mpv ${=MPVOPTS} \
+ (#i)${1:-.}/**/*.(mpeg|webm|avi|flv|mkv|mpg|wmv|wva|mp4|wva|m4v|ogm|mp4|mov|divx)(Oa) \
+ $@
diff --git a/.zsh_functions/movies_newest b/.zsh_functions/movies_newest
new file mode 100644
index 0000000..482fba8
--- /dev/null
+++ b/.zsh_functions/movies_newest
@@ -0,0 +1,3 @@
+ mpv ${=MPVOPTS} \
+ (#i)${1:-.}/**/*.(mpeg|webm|avi|flv|mkv|mpg|wmv|wva|mp4|wva|m4v|ogm|mp4|mov|divx)(om) \
+ $@
diff --git a/.zsh_functions/movies_oldest b/.zsh_functions/movies_oldest
new file mode 100644
index 0000000..d912b00
--- /dev/null
+++ b/.zsh_functions/movies_oldest
@@ -0,0 +1,3 @@
+ mpv ${=MPVOPTS} \
+ (#i)${1:-.}/**/*.(mpeg|webm|avi|flv|mkv|mpg|wmv|wva|mp4|wva|m4v|ogm|mp4|mov|divx)(Om) \
+ $@
diff --git a/.zsh_functions/movies_smallest b/.zsh_functions/movies_smallest
new file mode 100644
index 0000000..711e1da
--- /dev/null
+++ b/.zsh_functions/movies_smallest
@@ -0,0 +1,3 @@
+ mpv ${=MPVOPTS} \
+ (#i)${1:-.}/**/*.(mpeg|webm|avi|flv|mkv|mpg|wmv|wva|mp4|wva|m4v|ogm|mp4|mov|divx)(oL) \
+ $@
diff --git a/.zsh_functions/mpvshuffledir b/.zsh_functions/mpvshuffledir
new file mode 100644
index 0000000..927c15b
--- /dev/null
+++ b/.zsh_functions/mpvshuffledir
@@ -0,0 +1,4 @@
+ mpv ${=MPVOPTS} \
+ --shuffle \
+ (#i)${1:-.}/**/*.(mpeg|webm|avi|flv|mkv|mpg|wmv|wva|mp4|wva|m4v|ogm|mp4|mov|divx) \
+ $@
diff --git a/.zsh_functions/new_hs_project b/.zsh_functions/new_hs_project
new file mode 100644
index 0000000..43086c3
--- /dev/null
+++ b/.zsh_functions/new_hs_project
@@ -0,0 +1,3 @@
+ stack new $1 simple
+ cd $1
+ git init
diff --git a/.zsh_functions/pause_stardew b/.zsh_functions/pause_stardew
new file mode 100644
index 0000000..3604dd0
--- /dev/null
+++ b/.zsh_functions/pause_stardew
@@ -0,0 +1,7 @@
+ while read bar
+ do
+ xdotool \
+ search --class 'StardewValley' \
+ windowactivate --sync \
+ type --delay 100 t/pause
+ done
diff --git a/.zsh_functions/vifind b/.zsh_functions/vifind
new file mode 100644
index 0000000..5bf6e9a
--- /dev/null
+++ b/.zsh_functions/vifind
@@ -0,0 +1 @@
+ vi $(find $@)