mark.
con_id::
Compares the i3-internal container ID, which you can get via the IPC
- interface. Handy for scripting.
+ interface. Handy for scripting. Use the special value +\_\_focused__+
+ to match only the currently focused window.
The criteria +class+, +instance+, +role+, +title+, +workspace+ and +mark+ are
actually regular expressions (PCRE). See +pcresyntax(3)+ or +perldoc perlre+ for
}
if (strcmp(ctype, "con_id") == 0) {
+ if (strcmp(cvalue, "__focused__") == 0) {
+ match->con_id = focused;
+ return;
+ }
+
char *end;
long parsed = strtol(cvalue, &end, 10);
if (parsed == LONG_MIN ||
cmd 'unmark';
+###############################################################################
+# Verify that "unmark" can be matched on the focused window.
+###############################################################################
+
+$ws = fresh_workspace;
+$con = open_window;
+cmd 'mark --add A';
+cmd 'mark --add B';
+open_window;
+cmd 'mark --add C';
+cmd 'mark --add D';
+
+is_deeply(sort(get_marks()), [ 'A', 'B', 'C', 'D' ], 'all marks exist');
+
+cmd '[con_id=__focused__] unmark';
+
+is_deeply(sort(get_marks()), [ 'A', 'B' ], 'marks on the unfocused window still exist');
+is_deeply(get_mark_for_window_on_workspace($ws, $con), [ 'A', 'B' ], 'matching on con_id=__focused__ works for unmark');
+
+cmd 'unmark';
+
###############################################################################
done_testing;