blob: 95a43de158db4e36e136ecd658bf0d4769c9fb6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/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 <[email protected]>'
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()
|