Add i3 container marking modi script

This commit is contained in:
Adam Goldsmith 2023-01-02 13:13:51 -05:00
parent 3bde1292fc
commit 19d9d02b47
2 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,5 @@
configuration {
modi: "drun,run,sworkspace:~/.config/rofi/i3_switch_workspace.py,mworkspace:~/.config/rofi/i3_move_to_workspace.py,window,monitor:~/.config/rofi/i3_monitor_layout.sh";
modi: "drun,run,sworkspace:~/.config/rofi/i3_switch_workspace.py,mworkspace:~/.config/rofi/i3_move_to_workspace.py,window,monitor:~/.config/rofi/i3_monitor_layout.sh,mark:~/.config/rofi/i3_mark_container.py";
show-icons: true;
sidebar-mode: true;
}

View File

@ -0,0 +1,13 @@
#!/usr/bin/env python3
import sys
import i3ipc
i3 = i3ipc.Connection()
if len(sys.argv) == 1:
focused = i3.get_tree().find_focused()
print("\n".join(focused.marks))
else:
i3.command(f"mark --toggle --add {sys.argv[1]}")