summaryrefslogtreecommitdiff
path: root/.config/lf/brodie/image
diff options
context:
space:
mode:
authorVikas Kushwaha <dev@vikas.rocks>2024-11-21 13:30:52 +0530
committerVikas Kushwaha <dev@vikas.rocks>2024-11-21 13:30:52 +0530
commit5c916d69d457101326803eb076a746060e3618cf (patch)
treed6fce3256eede1c1bf78fb6a1be75b9cc4b84cee /.config/lf/brodie/image
Moved from github
Diffstat (limited to '.config/lf/brodie/image')
-rw-r--r--.config/lf/brodie/image18
1 files changed, 18 insertions, 0 deletions
diff --git a/.config/lf/brodie/image b/.config/lf/brodie/image
new file mode 100644
index 0000000..77ddb5b
--- /dev/null
+++ b/.config/lf/brodie/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 "$@"
+