Complete functionality: --login

This commit is contained in:
Ferit Yiğit BALABAN 2022-06-12 17:37:54 +03:00
parent e4944e5841
commit 76244b679e

View File

@ -67,6 +67,8 @@ async def open_subprocess(cmd: str):
async def change_wallpaper(mode: int, cringe = False): async def change_wallpaper(mode: int, cringe = False):
if not os.path.exists(PATH_RESC_WALLPS):
get_wallpapers():
region = f"{mode}{1 if cringe else 0}" region = f"{mode}{1 if cringe else 0}"
with open(PATH_RESC_WALLPS, 'r') as f: with open(PATH_RESC_WALLPS, 'r') as f:
file = f.read() file = f.read()
@ -162,7 +164,6 @@ def main():
sys.argv.remove(sys.argv[0]) sys.argv.remove(sys.argv[0])
sys.argv.reverse() sys.argv.reverse()
expand_vars() expand_vars()
asyncio.run(change_wallpaper(0, cringe = True))
if len(sys.argv) == 1: if len(sys.argv) == 1:
if sys.argv[0] == "--login": if sys.argv[0] == "--login":
log("modeset2 started with \"--login\"") log("modeset2 started with \"--login\"")
@ -174,9 +175,12 @@ def main():
else: else:
set_brightness(0, 40) set_brightness(0, 40)
set_brightness(1, 100) set_brightness(1, 100)
asyncio.run(change_wallpaper(mode))
elif sys.argv[0] == "--lock": elif sys.argv[0] == "--lock":
log("modeset2 started with \"--lock\"") log("modeset2 started with \"--lock\"")
print("Lock") asyncio.run(set_volume(0, save_state = True))
asyncio.run(set_brightness(0, 0, save_state = True))
asyncio.run(set_brightness(1, 0, save_state = True))
elif sys.argv[0] == "--unlock": elif sys.argv[0] == "--unlock":
log("modeset2 started with \"--unlock\"") log("modeset2 started with \"--unlock\"")
print("Unlock") print("Unlock")