diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-10-30 10:23:49 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-10-30 10:37:58 +0100 |
commit | f2bbfe83b4b23e87d8a049a2d698c6576a5bcd8c (patch) | |
tree | 0734cabcfe51036a011e46cd83ae7ac15c5dfa95 /shell |
Initial commit
Diffstat (limited to 'shell')
-rwxr-xr-x | shell/qm-file-manager.sh | 32 |
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 + |