added quick launch script, edited paths

This commit is contained in:
Maxim Stewart 2020-04-25 02:22:56 -05:00
parent dfe7b2bb63
commit 868b075bd5
3 changed files with 58 additions and 43 deletions

View File

@ -27,8 +27,9 @@ class Main(Context):
while True:
self.clear()
if not self.menuData:
path = "/usr/share/applications/"
self.menuData = self.getDesktopFilesInfo(path)
HOME = os.path.expanduser('~') + "/.local/share/applications/"
paths = ["/usr/share/applications/", HOME]
self.menuData = self.getDesktopFilesInfo(paths)
group = self.call_method("mainMenu")["group"]
query = ""
@ -51,7 +52,7 @@ class Main(Context):
return method(data) if data else method()
def getDesktopFilesInfo(self, path):
def getDesktopFilesInfo(self, paths):
menuObjs = {
"Accessories": [],
"Multimedia": [],
@ -66,7 +67,7 @@ class Main(Context):
"Other": []
}
for path in paths:
for f in listdir(path):
fPath = path + f
flags = ["mimeinfo.cache", "defaults.list"]
@ -106,7 +107,8 @@ class Main(Context):
menuObjs[group].append( {"title": title, "groups": groups,
"comment": comment, "exec": mainExec,
"tryExec": tryExec, "fileName": f} )
"tryExec": tryExec, "fileName": f
})
return menuObjs

View File

@ -16,8 +16,8 @@ from .mixins import StylesMixin
GROUPS = ["[ Search ]", "Accessories", "Multimedia", "Graphics", "Game",
"Office", "Development", "Internet", "Settings",
"System", "Wine", "Other", "[ Exit ]"]
"Office", "Development", "Internet", "Settings", "System",
"Wine", "Other", "[ Exit ]"]
class Context(StylesMixin):

13
src/shellmen Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# set -o xtrace ## To debug scripts
# set -o errexit ## To exit on error
# set -o errunset ## To exit if a variable is referenced but not set
function main() {
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
cd "${SCRIPTPATH}"
python3 .
}
main $@;