aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-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
+