Skip to content

Commit

Permalink
.desktop file lister subscript
Browse files Browse the repository at this point in the history
  • Loading branch information
bill88t committed Aug 25, 2024
1 parent df5f8a3 commit be1de06
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions base/Beryllium/bin/stringproccessing/appmenul.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
vr("appl", be.api.fs.listdir("/usr/share/applications"))
vr("apps", {})

# Generates a dict with all the installed applications

# The dict keys are the application pretty names.
# The dict items are lists of the following format:
# [description, executable, run_mode]

# Description is free text
# Exectuable is a path
# run_mode can be "Python", "WM" or "Shell"
# Python means it will be run as a new python process
# WM means it will run under the current window manager
# Shell means it will be run as a shell command

vr("toml_s", None)
for pv[get_pid()]["i"] in range(len(vr("appl"))):
vr("toml_s", "/Beryllium/usr/share/applications/" + vr("appl")[vr("i")][0])
vr("apps")[cptoml.fetch("name", toml=vr("toml_s"))] = [
cptoml.fetch("desc", toml=vr("toml_s")),
cptoml.fetch("exec", toml=vr("toml_s")),
cptoml.fetch("run_mode", toml=vr("toml_s")).lower(),
]
vrd("toml_s")
vrd("appl")
vrp("ok")

0 comments on commit be1de06

Please sign in to comment.