aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/menu-scripts/ls.json.sh
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-07-01 14:19:38 -0400
committerKen Moore <moorekou@gmail.com>2016-07-01 14:19:38 -0400
commitdfb6ebabee46028d3ec25bd72d0affaa1dac70e2 (patch)
treeb5a6a4d8391d61f20c120dc4443203b86742d7bb /src-qt5/core/menu-scripts/ls.json.sh
parentEnsure that the quick command run routine will never hang the system for more... (diff)
downloadlumina-dfb6ebabee46028d3ec25bd72d0affaa1dac70e2.tar.gz
lumina-dfb6ebabee46028d3ec25bd72d0affaa1dac70e2.tar.bz2
lumina-dfb6ebabee46028d3ec25bd72d0affaa1dac70e2.zip
Add the new JSON menu generation scripts to the "core" files installed (since they are basically another type of plugin).
Diffstat (limited to 'src-qt5/core/menu-scripts/ls.json.sh')
-rwxr-xr-xsrc-qt5/core/menu-scripts/ls.json.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/src-qt5/core/menu-scripts/ls.json.sh b/src-qt5/core/menu-scripts/ls.json.sh
new file mode 100755
index 00000000..626912cb
--- /dev/null
+++ b/src-qt5/core/menu-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