Guake: list of open tabs

Created on 12 Mar 2017  路  12Comments  路  Source: Guake/guake

Is it possible to get list of open tabs in guake (preferably with names)? I am thinking on the lines of scripting saving and restoring guake session across system restart.

All 12 comments

Get list and current commands yes it is possible. You can set the state at startup using a script (you can execute a script upon start, just add guake -n commands in it)

Thanks for response. Yes, i know i can execute the script at startup. My question is can I save the state of existing open tabs? So that i can restore it later? Which boils down to how can I get the list of open directory in each guake tab?

it is in theory possible, but right away you'll have to wait for guake 3

looking forward to it. Thanks

Hi @Stibbons, any NEWS about this? I'm looking forward to keep my sessions too!

hum, guake is on the bottom of my priority for the moment. I hope to be able to work again on it asap

@Stibbons thanks anyway, I think I saw the script required to accomplish what I wanted on the tooltip help. Thanks for this awesome tool!

@matheo can you share the script. i can also make use of it, till this feature is available in guake.

@imranashraf ATM I don't need a sophisticated script, just open some default tabs for some specific folders, not like continuing the session from the last point. So here's the script to create some default tabs:

#!/bin/bash
sleep 3

# rename the initial tab for home scripting
guake -r "home"

# new tab 1
guake -n "/absolute/path/to/first/folder"
guake -r "tab name 1"

# new tab 2
guake -n "/absolute/path/to/second/folder"
guake -r "tab name 2"

Be care because the path doesn't follow symlinks, the path must be absolute.
Enjoy!

@matheo thanks for sharing. yes for opening session I have a similar script with lines like this:
guake -n k -r "repos" --execute-command='cd /data/repositories'

What I dont know is how to get the list of the tabs (name of tabs + paths open in each tab). Any idea how to achieve that?

You can hack the code to add a "guake -L" command for instance. if you go this path, you can (maybe) start hacking directly the code to add the "load/save tab" feature in guake directly... :)

I have no idea if this is useful but I also wanted to list all the tabs however didn't want to edit the source code at all so I wrote a little bash script to get all tab names. It is definitely not ideal but gets the job done.

#!/bin/bash
TAB_ARRAY=()
i="0"
while [ "$(guake -s $i 2>&1)" = "" ]
do
    TAB_ARRAY+=($(guake -l))
    i=$[$i+1]
done

echo ${TAB_ARRAY[@]}
Was this page helpful?
0 / 5 - 0 ratings