From 19d9d02b4729a28e1650e1bab09ac65f97a02e50 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 2 Jan 2023 13:13:51 -0500 Subject: [PATCH] Add i3 container marking modi script --- .config/rofi/config.rasi | 2 +- .config/rofi/i3_mark_container.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 .config/rofi/i3_mark_container.py diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi index 2acecab..10587b0 100644 --- a/.config/rofi/config.rasi +++ b/.config/rofi/config.rasi @@ -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; } diff --git a/.config/rofi/i3_mark_container.py b/.config/rofi/i3_mark_container.py new file mode 100755 index 0000000..7e7bb4c --- /dev/null +++ b/.config/rofi/i3_mark_container.py @@ -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]}")