Skip to content

Commit

Permalink
Update get_windows.py
Browse files Browse the repository at this point in the history
Fix an IndexError happening when going on homescreen on GNOME desktop causing the entire program to crash.
  • Loading branch information
augustin64 authored Aug 24, 2022
1 parent b530d77 commit 6b30c7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Watcher/get_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def active_window():
if len(actv_id) == 4:
active_window = ""
else:
active_window = os.popen("xprop -id $(xdotool getwindowfocus) | grep CLASS ").read()[19:-1].replace('''"''', "").split(", ")[1]
active_window = os.popen("xprop -id $(xdotool getwindowfocus) | grep CLASS ").read()
if active_window != "":
active_window = active_window[19:-1].replace('''"''', "").split(", ")[1]

if "XGetWindowProperty[_NET_ACTIVE_WINDOW] failed" in active_window:
active_window = ""
Expand Down

0 comments on commit 6b30c7f

Please sign in to comment.