aboutsummaryrefslogtreecommitdiff
path: root/JsonMenu_Scripts/ls.json.sh
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-06-30 22:19:27 -0400
committerKen Moore <moorekou@gmail.com>2016-06-30 22:19:27 -0400
commitfda22def5e685517433f686307ea00e90b6ec070 (patch)
tree481b0aa4a67cd8cfe39698ef9722fc4d1e038727 /JsonMenu_Scripts/ls.json.sh
parentSetup lumina-fileinfo that that it can be used to create brand-new applicatio... (diff)
parentEnsure that the quick command run routine will never hang the system for more... (diff)
downloadlumina-fda22def5e685517433f686307ea00e90b6ec070.tar.gz
lumina-fda22def5e685517433f686307ea00e90b6ec070.tar.bz2
lumina-fda22def5e685517433f686307ea00e90b6ec070.zip
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'JsonMenu_Scripts/ls.json.sh')
-rwxr-xr-xJsonMenu_Scripts/ls.json.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/JsonMenu_Scripts/ls.json.sh b/JsonMenu_Scripts/ls.json.sh
new file mode 100755
index 00000000..626912cb
--- /dev/null
+++ b/JsonMenu_Scripts/ls.json.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+DIR=${1}
+if [ "$1" == "" ] ; then
+ DIR=`pwd`
+fi
+
+ls "${DIR}" > /tmp/.tmp.lines.$$
+while read name
+do
+ if [ -n "${OUT}" ] ; then
+ OUT="${OUT},"
+ fi
+ if [ -d "${DIR}/${name}" ] ; then
+ OUT="${OUT} \"${name}\" : { \"type\" : \"jsonmenu\", \"exec\" : \"${0} \\\"${DIR}/${name}\\\"\", \"icon\":\"folder\"}"
+ else
+ OUT="${OUT} \"${name}\" : { \"type\" : \"item\", \"icon\":\"unknown\", \"action\" : \"xdg-open \\\"${DIR}/${name}\\\"\"}"
+ fi
+done < /tmp/.tmp.lines.$$
+rm /tmp/.tmp.lines.$$
+echo "{ ${OUT} }"
bgstack15