diff options
author | 2020-01-09 10:50:52 -0800 | |
---|---|---|
committer | 2020-01-15 18:01:35 +0100 | |
commit | 0c1733273cbbd3c8105c926840e593c345af415f (patch) | |
tree | b3d41808538bcfe6f0e1fd82e0549661142ae8d8 /contrib/inactive-windows-transparency.py | |
parent | view: remove workspace pid mapping for assigns (diff) | |
download | sway-0c1733273cbbd3c8105c926840e593c345af415f.tar.gz sway-0c1733273cbbd3c8105c926840e593c345af415f.tar.zst sway-0c1733273cbbd3c8105c926840e593c345af415f.zip |
Use transparency arg in the window focus event
Diffstat (limited to 'contrib/inactive-windows-transparency.py')
-rwxr-xr-x | contrib/inactive-windows-transparency.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/inactive-windows-transparency.py b/contrib/inactive-windows-transparency.py index 15e2a91b..77b1f221 100755 --- a/contrib/inactive-windows-transparency.py +++ b/contrib/inactive-windows-transparency.py | |||
@@ -9,9 +9,9 @@ import argparse | |||
9 | import i3ipc | 9 | import i3ipc |
10 | import signal | 10 | import signal |
11 | import sys | 11 | import sys |
12 | from functools import partial | ||
12 | 13 | ||
13 | 14 | def on_window_focus(inactive_opacity, ipc, event): | |
14 | def on_window_focus(ipc, event): | ||
15 | global prev_focused | 15 | global prev_focused |
16 | global prev_workspace | 16 | global prev_workspace |
17 | 17 | ||
@@ -21,7 +21,7 @@ def on_window_focus(ipc, event): | |||
21 | if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859 | 21 | if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859 |
22 | focused.command("opacity 1") | 22 | focused.command("opacity 1") |
23 | if workspace == prev_workspace: | 23 | if workspace == prev_workspace: |
24 | prev_focused.command("opacity " + transparency_val) | 24 | prev_focused.command("opacity " + inactive_opacity) |
25 | prev_focused = focused | 25 | prev_focused = focused |
26 | prev_workspace = workspace | 26 | prev_workspace = workspace |
27 | 27 | ||
@@ -60,5 +60,5 @@ if __name__ == "__main__": | |||
60 | window.command("opacity " + args.opacity) | 60 | window.command("opacity " + args.opacity) |
61 | for sig in [signal.SIGINT, signal.SIGTERM]: | 61 | for sig in [signal.SIGINT, signal.SIGTERM]: |
62 | signal.signal(sig, lambda signal, frame: remove_opacity(ipc)) | 62 | signal.signal(sig, lambda signal, frame: remove_opacity(ipc)) |
63 | ipc.on("window::focus", on_window_focus) | 63 | ipc.on("window::focus", partial(on_window_focus, args.opacity)) |
64 | ipc.main() | 64 | ipc.main() \ No newline at end of file |