diff --git a/contrib/inactive-windows-transparency.py b/contrib/inactive-windows-transparency.py index 6ecf6f9e9..a92588780 100755 --- a/contrib/inactive-windows-transparency.py +++ b/contrib/inactive-windows-transparency.py @@ -19,11 +19,19 @@ def on_window_focus(args, ipc, event): focused = event.container + # on_window_focus not called only when focused is changed, # but also when a window is moved if focused.id != prev_focused.id: - focused.command("opacity " + args.active_opacity) - prev_focused.command("opacity " + args.inactive_opacity) + if prev_focused.app_id in args.ignore: + prev_focused.command("opacity 1") + else: + prev_focused.command("opacity " + args.inactive_opacity) + + if focused.app_id in args.ignore: + focused.command("opacity 1") + else: + focused.command("opacity " + args.active_opacity) prev_focused = focused @@ -59,6 +67,13 @@ if __name__ == "__main__": default=default_active_opacity, help="value between 0 and 1 denoting opacity for active windows", ) + parser.add_argument( + "--ignore", + type=str, + default=[], + help="List of applications to be ignored.", + nargs="+" + ) args = parser.parse_args() ipc = i3ipc.Connection()