You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
507 B

import i3ipc
ipc = i3ipc.Connection()
prev_focused = None
for window in ipc.get_tree():
if window.focused:
prev_focused = window
window.command('opacity 0.8')
def on_window_focus(ipc, focused):
global prev_focused
if focused.container.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859
focused.container.command('opacity 1')
prev_focused.command('opacity 0.8')
prev_focused = focused.container
ipc.on("window::focus", on_window_focus)