diff options
author | Pierre-Albéric TROUPLIN <palb-github@troupl.in> | 2021-02-16 11:38:57 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-02-16 11:45:10 +0100 |
commit | a3d45c3280ac38227c30dbc7620d1c45ef3c2426 (patch) | |
tree | ed4d21367a711e87cf511e3ce265b89df2d164cc | |
parent | 42cbaf278cc96218e38662ba5cb84c7023968bc8 (diff) |
Prevent inactive-windows-transparency.py to crash on lockscreen
-rwxr-xr-x | contrib/inactive-windows-transparency.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/inactive-windows-transparency.py b/contrib/inactive-windows-transparency.py index 77b1f221..b81134dd 100755 --- a/contrib/inactive-windows-transparency.py +++ b/contrib/inactive-windows-transparency.py @@ -15,8 +15,13 @@ def on_window_focus(inactive_opacity, ipc, event): global prev_focused global prev_workspace + focused_workspace = ipc.get_tree().find_focused() + + if focused_workspace == None: + return + focused = event.container - workspace = ipc.get_tree().find_focused().workspace().num + workspace = focused_workspace.workspace().num if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859 focused.command("opacity 1") |