#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'Victor Häggqvist, Yuriy Netesov' __copyright__ = 'Copyright 2014-2015, Victor Häggqvist' __credits__ = ['Victor Häggqvist', 'Yuriy Netesov'] __license__ = 'GPL-2.0' __maintainer__ = 'Victor Häggqvist ' import subprocess from xboomx.config import config from xboomx.sqlitemgr import get_session, PathItem import sys def main(): if len(sys.argv) > 1 and sys.argv[1] == "--stats": session = get_session() items = session.query(PathItem).order_by(PathItem.count.desc()) print('Application\tLaunches') for item in items: if item.count < 3: continue if len(item.name) < 8: print('%s\t\t%s' % (item.name, item.count)) else: print('%s\t%s' % (item.name, item.count)) 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) if __name__ == '__main__': main()