delete demo and add func for dmenu
This commit is contained in:
parent
7e8430488f
commit
ff3c194f1d
@ -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
|
||||
|
@ -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__':
|
||||
|
@ -104,3 +104,15 @@ def setTheme(themeName = None):
|
||||
else:
|
||||
printHelpInfo()
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def getThemes():
|
||||
config = getConfig()
|
||||
|
||||
themes = []
|
||||
|
||||
for e in config:
|
||||
if type(config[e]) == dict:
|
||||
themes.append(e)
|
||||
|
||||
return themes
|
Loading…
Reference in New Issue
Block a user