3

I recently installed an update to Guake that sets the tab names to <user>@<computer-name>/path/to/current/directory/.

This is rather annyoing when a single tab takes up all the space because of extreme nesting, for example in a Java project (parent-module/sub-module/src/main/java/no/whirlwin/sample_app/domain/wares/interfaces).

Earlier the names were something like tab:0, tab:1 or so, which was perfect.

Now I have to manually rename each and every new tab I open, which is a pain in the a...wk.

Other than downgrading to an earlier version, is it possible to change the default tab names?

whirlwin
  • 551
  • 1
  • 5
  • 12

6 Answers6

5

Looks like you need to turn use_vte_titles off (set to false) in the gconf schema for guake. Otherwise you can hack custom strings or behaviour in by changing the on_terminal_title_changed function or code higher up the call stack, since it is not called consistently. It can be found in the main guake file.

lynxlynxlynx
  • 3,313
  • 16
  • 23
4

It's not a problem of Guake, it is how your terminal title is setup. The new version of Guake respects terminal title from the shell. I bet that you are also getting same long title in Gnome Terminal. Check how to configure terminal title from your shell: http://www.faqs.org/docs/Linux-mini/Xterm-Title.html

Aleksandar
  • 41
  • 1
4

In retrospect, I found that the easiest way is by running:

gconftool-2 --set /apps/guake/general/use_vte_titles --type boolean false

from the command line.

whirlwin
  • 551
  • 1
  • 5
  • 12
4

Or edit like this:

$ vim `which guake`

find the 1000 line and change this:

    self.tabs.get_children()[page].set_label(vte.get_window_title())

on this:

    if self.tabs.get_children()[page].get_label().find('!') != 0:
        self.tabs.get_children()[page].set_label(vte.get_window_title())
    else:
        return

And now you can rename your tabs permanently by adding '!' before name, like:

!PROD
!backend
!PENTAGON ROOTED
1

Following up on Alexandar's reply: The following two questions show how to configure a "very short" prompt shortener, which will be also respected by Guake:

https://stackoverflow.com/q/3497885/946850

Abbreviated current directory in shell prompt?

I use a "not so short" shortener for myself, my .bashrc contains the following:

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='PS1X=$(pwd | sed -r "s-^$HOME/--;s-^$HOME-~-;s-^(.[^/]*)/.*/-\1/.../-")'
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}"'$PS1X'"\a\]$PS1"
    ;;
*)
    ;;
esac

Only the first and the last path component is shown, like the following:

$HOME -> ~

$HOME/some/deep/sub/dir -> some/.../dir

/usr/local/deeply/inside/there -> /usr/.../there

krlmlr
  • 947
  • 9
  • 20
0

Looking at this line in the source code, I noticed there's another config entry that can be helpful: max-tab-name-length. I used dconf-editor to set it to 32, and it saved my sanity.

https://github.com/Guake/guake/blob/18a79ea8e4c1d53d357211e8e3d05509b9927cd1/guake/utils.py#L119