aboutsummaryrefslogtreecommitdiff
path: root/JsonMenu_Scripts/ls.json.sh
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-06-29 17:38:14 -0400
committerKen Moore <moorekou@gmail.com>2016-06-29 17:38:14 -0400
commitdb536f42f30514112944892f209520a2ac5a65c2 (patch)
treedd1528c5e22f655889eefba9d249bc75bffc755f /JsonMenu_Scripts/ls.json.sh
parentAdd a new type of menu plugin: jsonmenu (diff)
downloadlumina-db536f42f30514112944892f209520a2ac5a65c2.tar.gz
lumina-db536f42f30514112944892f209520a2ac5a65c2.tar.bz2
lumina-db536f42f30514112944892f209520a2ac5a65c2.zip
Create a directory for placing sample JSON menu generation scripts, and add one (incomplete yet) for listing the contents of the current directory (home dir ususally)
Diffstat (limited to 'JsonMenu_Scripts/ls.json.sh')
-rwxr-xr-xJsonMenu_Scripts/ls.json.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/JsonMenu_Scripts/ls.json.sh b/JsonMenu_Scripts/ls.json.sh
new file mode 100755
index 00000000..9a6ab847
--- /dev/null
+++ b/JsonMenu_Scripts/ls.json.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+cmd="ls $1"
+OUT=""
+for name in `${cmd}`; do
+ if [ "${OUT}" != "" ] ; then
+ OUT="${OUT},"
+ fi
+ OUT="${OUT} \"${name}\" : { \"type\" : \"item\", \"action\" : \"${name}\"}"
+done
+echo "{ ${OUT} }"
bgstack15