-
-
Save Hammer2900/92dad6c7931591e85ec0178712af79d7 to your computer and use it in GitHub Desktop.
Hide or show titles in i3wm windows depending on if the Workspace has more than one window. Requires [i3ipc-python](https://github.com/acrisci/i3ipc-python) to be installed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import i3ipc | |
# Create the Connection object that can be used to send commands and subscribe | |
# to events. | |
i3 = i3ipc.Connection() | |
def change_titles(windows): | |
if len(windows) > 1: | |
command = 'border normal' | |
else: | |
command = 'border pixel 1' | |
for window in windows: | |
window.command(command) | |
def on_window(self, e): | |
focused = i3.get_tree().find_focused() | |
change_titles(focused.workspace().leaves()) | |
# Subscribe to events | |
i3.on('window', on_window) | |
# Start the main loop and wait for events to come in. | |
i3.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment