38 lines
1.1 KiB
Python
Executable File
38 lines
1.1 KiB
Python
Executable File
#!/usr/bin/python3
|
|
|
|
from wallpyperFuncs import *
|
|
|
|
def main():
|
|
theme = ""
|
|
|
|
if len(sys.argv) == 2 and sys.argv[1] in ("help","--help","-h"):
|
|
printHelpInfo()
|
|
else:
|
|
if len(sys.argv) == 1: theme = None
|
|
elif len(sys.argv) == 2 and sys.argv[1] in ("quit", "stop"): killLastSession(); sys.exit(0)
|
|
elif len(sys.argv) >= 2 and sys.argv[1] == "set":
|
|
if len(sys.argv) == 2:
|
|
themes = getThemes()
|
|
try:
|
|
import dmenu
|
|
|
|
theme = dmenu.show(themes, prompt='Themes:')
|
|
except ModuleNotFoundError:
|
|
try:
|
|
from rofi import Rofi
|
|
|
|
r = Rofi()
|
|
theme = themes[r.select('Themes:', themes)[0]]
|
|
except ModuleNotFoundError:
|
|
printHelpInfo()
|
|
exit(0)
|
|
elif len(sys.argv) == 3:
|
|
theme = sys.argv[2]
|
|
else: printHelpInfo()
|
|
else: printHelpInfo()
|
|
|
|
setTheme(theme)
|
|
|
|
if __name__ == '__main__':
|
|
main()
|