The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
3

Setting container names

asked 2014-07-05 16:19:54 +0000

Rojo gravatar image

As an example, when a container is nested inside a container in tabbed or stacked mode, its title is displayed as i3: V[title1 title2 ...]

Is it possible to change that name? I would be happy enough with changing the "i3" part to some custom text with some command. I would find this useful because it would allow for a clear hierarchical (tree-like) organization of tabs,

edit retag flag offensive close merge delete

Comments

+1, because this actually is an excellent question, and I did not find some feature request for it. Maybe just file a report at bugs.i3wm.org.

joepd gravatar imagejoepd ( 2014-07-05 23:26:27 +0000 )edit

Have you looked for the "mark" builtin? I've not tried it yet so I don't really know if it works that way.

tigrezno gravatar imagetigrezno ( 2014-07-07 18:16:30 +0000 )edit

@tigrezno thanks for the suggestion. I haven't tried it in depth, but I just tried mark'ing a container with a name, and the "i3" label didn't change.

Rojo gravatar imageRojo ( 2014-07-07 22:43:00 +0000 )edit

I guess that would be an acceptable feature request: To display a mark in the title. I know I would love it.

joepd gravatar imagejoepd ( 2014-07-10 19:56:28 +0000 )edit

+1 would really like this feature. Find e.g. H[H[xterm xterm] not a very useful title for my workflow, and figuring out where I have relevant programs running. Would love to be able to control manually.

rehan gravatar imagerehan ( 2015-01-25 09:45:24 +0000 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-04-14 14:29:53 +0000

Alois Mahdal gravatar image

updated 2015-04-14 14:30:27 +0000

Not an answer, but as a dity workaround, I'm using this:

  1. I create a process with custom name,
  2. start a container,
  3. keep the sleeper as first.

The hack is based on the fact that i3 uses process name--not window title--as item in the list.

For example, when working on a bug 123:

  1. I call my script below as mkprocn BUG123, which creates "sleeper" process called BUG123 (just as if the executable was called that way),
  2. I create a sub-container, keeping the sleeper as first child
  3. I move all relevant windows there.

I end up with something like i3: T[BUG123 title1 title2 ...].

Disadvantage is that I have to keep the process running, but with tabbed layout this is not much of a deal.


The script (use at your own risk).

#!/bin/bash
# mkprocn

name="FOO"
action="__fork__"

usage() {
    echo "usage: $(basename $0) NAME" >&2;
    exit 2
}

while true; do case "$1" in
    __*__)  action="$1";    break ;;
    "")  break                    ;;
    -*)  usage                    ;;
    *)   name="$1"; shift 1       ;;
esac done

case "$action" in
    __sleep__)
        sleep 10000000000;
        ;;
    __fork__)
        $0 "$name" __exec__ &
        ;;
    __exec__)
        exec -a "$name" urxvt -title "$name" -e "$0" __sleep__; break ;;
    *)
        usage
        ;;
esac

You might want to

  • replace the urxvt syntax with some other terminal,
  • replace -e "$0" __sleep__ with something useful like -e vim notes-$name.txt,
  • add decorations to the name to make it more visible.
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-07-05 16:19:54 +0000

Seen: 2,749 times

Last updated: Apr 14