aboutsummaryrefslogtreecommitdiff
path: root/shell/qm-file-manager.sh
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-10-30 10:23:49 +0100
committerdec05eba <dec05eba@protonmail.com>2023-10-30 10:37:58 +0100
commitf2bbfe83b4b23e87d8a049a2d698c6576a5bcd8c (patch)
tree0734cabcfe51036a011e46cd83ae7ac15c5dfa95 /shell/qm-file-manager.sh
Initial commit
Diffstat (limited to 'shell/qm-file-manager.sh')
-rwxr-xr-xshell/qm-file-manager.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/shell/qm-file-manager.sh b/shell/qm-file-manager.sh
new file mode 100755
index 0000000..c5e6474
--- /dev/null
+++ b/shell/qm-file-manager.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+get() {
+ echo "title $1"
+ echo "add_tab"
+
+ if [ "$1" != "/" ]; then
+ echo "title Go to parent directory"
+ echo "url .."
+ echo "thumbnail_url folder.png"
+ echo "thumbnail_size 32x32"
+ echo "add_body_item"
+ fi
+
+ for f in "$1/"*; do
+ echo "title $f"
+ echo "url $f"
+ if [ -d "$f" ]; then
+ echo "thumbnail_url folder.png"
+ else
+ echo "thumbnail_url file.png"
+ fi
+ echo "thumbnail_size 32x32"
+ echo "add_body_item"
+ done
+}
+
+case "$ACTION" in
+ "get") get "$URL";;
+ *) echo "error unexpected action $ACTION"; exit 1;;
+esac
+