summaryrefslogtreecommitdiff
path: root/lf/image
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2021-07-07 15:21:45 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2021-07-07 15:21:45 -0500
commit3764b268dbeaa95a8d4b2da8d4433eab75ad8478 (patch)
tree7c0db4481dfa7c4369f3db355056703cbe442072 /lf/image
downloaddotconfig-3764b268dbeaa95a8d4b2da8d4433eab75ad8478.tar.xz
dotconfig-3764b268dbeaa95a8d4b2da8d4433eab75ad8478.zip
dotfiles
Diffstat (limited to 'lf/image')
-rw-r--r--lf/image18
1 files changed, 18 insertions, 0 deletions
diff --git a/lf/image b/lf/image
new file mode 100644
index 0000000..77ddb5b
--- /dev/null
+++ b/lf/image
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+readonly ID_PREVIEW="preview"
+main() {
+ case "$1" in
+ "clear")
+ declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") \
+ > "$FIFO_UEBERZUG"
+ ;;
+ "draw")
+ declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW" \
+ [x]="$3" [y]="$4" [max_width]="$5" [max_height]="$6" \
+ [path]="$2") > "$FIFO_UEBERZUG"
+ ;;
+ "*") echo "Unknown command: '$1', '$2'" ;;
+ esac
+}
+main "$@"
+