From f6c11e863841aaca0b7d9049f189d58e0312a672 Mon Sep 17 00:00:00 2001 From: Kesefon Date: Tue, 21 Jun 2022 00:02:53 +0200 Subject: [PATCH 1/2] Improve Linux support --- main.pyw | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/main.pyw b/main.pyw index 30bd8d1..2f0ccc3 100644 --- a/main.pyw +++ b/main.pyw @@ -1,10 +1,13 @@ -import pyautogui as autogui import json import tkinter as tk import os import subprocess import platform +if (platform.system() == "Windows"): + # autogui is only used on windows (right now) and adds scrot as a dependency on linux + import pyautogui as autogui + class ZoomData: def __init__(self, meetingId, abbreviation, professor, pwd): @@ -30,7 +33,7 @@ def createCourseTitle(course): def getPlatfromCommand(x, zoomData): switcher = { 'Windows':"%APPDATA%\Zoom\\bin\Zoom.exe --url=\"zoommtg://zoom.us/join?action=join&confno=" + zoomData.meetingId + "\"", - 'Linux':"zoom --url=\"zoommtg://zoom.us/join?action=join&confno=" + zoomData.meetingId + "\"", + 'Linux':"zoom \"zoommtg://zoom.us/join?action=join&confno=" + zoomData.meetingId + "\"", } val = switcher.get(x) if val == None: @@ -41,10 +44,12 @@ def joinMeeting(zoomData): subprocess.Popen(getPlatfromCommand(platform.system(), zoomData), shell=True) # enter passcode - enter_meeting_passcode = autogui.locateCenterOnScreen('img/enter-meeting-passcode.png', confidence=0.7) - while enter_meeting_passcode == None: + # currently only works on Windows + if (platform.system() == "Windows"): enter_meeting_passcode = autogui.locateCenterOnScreen('img/enter-meeting-passcode.png', confidence=0.7) - autogui.write(zoomData.pwd) + while enter_meeting_passcode == None: + enter_meeting_passcode = autogui.locateCenterOnScreen('img/enter-meeting-passcode.png', confidence=0.7) + autogui.write(zoomData.pwd) zoomDataEntries = getZoomDataEntries() From 60646dc4b6f156395c49da94313938f683114798 Mon Sep 17 00:00:00 2001 From: Kesefon Date: Tue, 21 Jun 2022 00:22:35 +0200 Subject: [PATCH 2/2] Add shebang --- main.pyw | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 main.pyw diff --git a/main.pyw b/main.pyw old mode 100644 new mode 100755 index 2f0ccc3..867d443 --- a/main.pyw +++ b/main.pyw @@ -1,3 +1,4 @@ +#!/bin/env python import json import tkinter as tk import os