delete demo and add func for dmenu

This commit is contained in:
elwld 2022-08-12 18:30:54 +05:00
parent 7e8430488f
commit ff3c194f1d
4 changed files with 27 additions and 4 deletions

View File

@ -3,8 +3,6 @@
WallPyPer - is small utility, work via
[foo-Wallpaper-Feh-Gif ](https://github.com/thomas10-10/foo-Wallpaper-Feh-Gif) and [feh](https://github.com/derf/feh).
[](demo.gif)
WallPyPer can work with images and gifs.
## Tutorial

BIN
demo.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 MiB

View File

@ -8,7 +8,20 @@ def main():
else:
if len(sys.argv) == 1: setTheme()
elif len(sys.argv) == 2 and sys.argv[1] in ("quit", "stop"): killLastSession(); sys.exit(0)
elif len(sys.argv) == 3 and sys.argv[1] == "set": setTheme(sys.argv[2])
elif len(sys.argv) >= 2 and sys.argv[1] == "set":
if len(sys.argv) == 2:
try:
import dmenu
themes = getThemes()
print(themes)
theme = dmenu.show(themes, prompt='Themes:')
setTheme(theme)
except ModuleNotFoundError:
printHelpInfo()
elif len(sys.argv) == 3:
setTheme(sys.argv[2])
else: printHelpInfo()
else: printHelpInfo()
if __name__ == '__main__':

View File

@ -103,4 +103,16 @@ def setTheme(themeName = None):
else:
printHelpInfo()
sys.exit(0)
sys.exit(0)
def getThemes():
config = getConfig()
themes = []
for e in config:
if type(config[e]) == dict:
themes.append(e)
return themes