Skip to content

Instantly share code, notes, and snippets.

@Hammer2900
Forked from JohnRipper/template.py
Created August 25, 2021 09:52
Show Gist options
  • Save Hammer2900/c5c454e776b4ca560c8ecb43d5155617 to your computer and use it in GitHub Desktop.
Save Hammer2900/c5c454e776b4ca560c8ecb43d5155617 to your computer and use it in GitHub Desktop.
template for i3ipc extensions
#!/usr/bin/env python3
import i3ipc
from i3ipc import Event
from i3ipc.events import IpcBaseEvent, Event
i3 = i3ipc.Connection()
# callback for when workspace focus changes
def on_workspace(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_output(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_mode(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_barconfig_update(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_binding(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_shutdown(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_tick(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_input(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_workspace_focus(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_workspace_init(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_workspace_empty(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_workspace_urgent(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_workspace_reload(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_workspace_rename(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_workspace_restored(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_workspace_move(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window_new(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window_close(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window_focus(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window_title(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window_fullscreen_mode(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window_move(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window_floating(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window_urgent(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_window_mark(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_shutdown_restart(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_shutdown_exit(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_input_added(i3, e:IpcBaseEvent):
print(e.__dict__)
def on_input_removed(i3, e:IpcBaseEvent):
print(e.__dict__)
i3.on('workspace', on_workspace)
i3.on('output', on_output)
i3.on('mode', on_mode)
i3.on('window', on_window)
i3.on('barconfig_update', on_barconfig_update)
i3.on('binding', on_binding)
i3.on('shutdown', on_shutdown)
i3.on('tick', on_tick)
i3.on('input', on_input)
i3.on('workspace::focus', on_workspace_focus)
i3.on('workspace::init', on_workspace_init)
i3.on('workspace::empty', on_workspace_empty)
i3.on('workspace::urgent', on_workspace_urgent)
i3.on('workspace::reload', on_workspace_reload)
i3.on('workspace::rename', on_workspace_rename)
i3.on('workspace::restored', on_workspace_restored)
i3.on('workspace::move', on_workspace_move)
i3.on('window::new', on_window_new)
i3.on('window::close', on_window_close)
i3.on('window::focus', on_window_focus)
i3.on('window::title', on_window_title)
i3.on('window::fullscreen_mode', on_window_fullscreen_mode)
i3.on('window::move', on_window_move)
i3.on('window::floating', on_window_floating)
i3.on('window::urgent', on_window_urgent)
i3.on('window::mark', on_window_mark)
i3.on('shutdown::restart', on_shutdown_restart)
i3.on('shutdown::exit', on_shutdown_exit)
i3.on('input::added', on_input_added)
i3.on('input::removed', on_input_removed)
i3.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment