diff options
author | Victor Häggqvist <[email protected]> | 2014-09-02 11:27:50 +0200 |
---|---|---|
committer | Victor Häggqvist <[email protected]> | 2014-09-02 11:27:50 +0200 |
commit | bcbd5bb12b3a1f89948d21a7a9bc0f056db73f38 (patch) | |
tree | f95b967cd8dec52fadba96c85cf03a635bb272f3 /xboomx/bin/xboomx |
--status
Diffstat (limited to 'xboomx/bin/xboomx')
-rwxr-xr-x | xboomx/bin/xboomx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/xboomx/bin/xboomx b/xboomx/bin/xboomx new file mode 100755 index 0000000..2b4d266 --- /dev/null +++ b/xboomx/bin/xboomx @@ -0,0 +1,37 @@ +#!/usr/bin/python +import fileinput + +import subprocess +from xboomx.config import config +import xboomx.db +import sys + + +if len(sys.argv) > 1 and sys.argv[1] == "--stats": + db = xboomx.db.open_shelve('') + + items = [] + + keys = db.keys() + + for x in keys: + items.append([x, db.get(x, "")]) + + db.close() + + # sort items + items.sort(key=lambda x: x[1], reverse=True) + + # print items + print "Application\tLaunches" + for item in items: + if len(item[0]) < 8: + print item[0]+"\t\t"+str(item[1]) + else: + print item[0]+"\t"+str(item[1]) + + exit(0) + +DMENU_LAUNCHER = 'dmenu ' + config.get("dmenu_params", "") + +subprocess.call("xboomx_path.py | xboomx_sort.py | " + DMENU_LAUNCHER + "| xboomx_update.py | xargs -I {} sh -c \'exec {} &\'", shell=True) |