18

I am using this script with gnome terminal:

#!/bin/sh
gnome-terminal --tab --title="1" --command="ssh 1" \
--tab --title="2" --command="ssh 2" \
--tab --title="3" --command="ssh 3" \
--tab --title="4" --command="ssh 4"
exit 0

How can I do the same things by script but on a Guake terminal?

derHugo
  • 3,306
  • 5
  • 30
  • 49
TbMa
  • 515
  • 2
  • 5
  • 8

5 Answers5

8

Did you read guake --help?

Usage: guake.py [options]

Options:
  -h, --help            show this help message and exit
  -t, --toggle-visibility
                        ?ndert die Sichtbarkeit des Terminal-Fensters.
  -p, --preferences     Zeigt die Einstellungen von Guake
  -a, --about           Zeigt Guake's Programminformationen
  -n NEW_TAB, --new-tab=NEW_TAB
                        Tab hinzuf?gen
  -s SELECT_TAB, --select-tab=SELECT_TAB
                        Tab ausw?hlen
  -g, --selected-tab    Return the selectd tab index.
  -e COMMAND, --execute-command=COMMAND
                        Eigenen Befehl im ausgew?hlten Tab ausf?hren
  -r RENAME_TAB, --rename-tab=RENAME_TAB
                        Gew?hlten Tab umbenennen
  -q, --quit            Sagt Guake das es verschwinden soll :o(
dAnjou
  • 1,995
  • 1
  • 17
  • 25
  • 8
    While helpful, it doesn't answer the question. Would be helpful to others if a more thorough answer was given. – Zachary Schuessler May 07 '13 at 14:38
  • Thanks for posting this, clearly should have just looked at the help but needed to know how another application could toggle visibility - `guake -t` is just the trick! – M1ke Jun 04 '14 at 08:38
7

It works like this: guake -n guake -e 'ssh 1' guake -r 'name_of_tab'

This will open a new tab, execute the command (ssh 1, in this case) and rename the newly created tab to "name_of_tab".

  • this seems to work, but I don't understand the use of multiple `quake` tokens in the command... – Tom Dec 28 '18 at 19:02
6

Try this:

#!/bin/sh
guake -n "whatever" -r "1" -e "ssh 1"
guake -n "whatever" -r "2" -e "ssh 2"
guake -n "whatever" -r "3" -e "ssh 3"
guake -n "whatever" -r "4" -e "ssh 4"
exit 0

(It turns out that neither guake -n "1" -e "ssh" nor guake -n "1" -s "1" -e "ssh 1" works, only renaming the tabs does the job)

pomsky
  • 67,112
  • 21
  • 233
  • 243
Tomasz Zieliński
  • 567
  • 1
  • 5
  • 11
1
#!/usr/bin/env bash
guake --rename-current-tab="tab0" --execute-command="ls" & 
sleep 1 && guake --new-tab="my/path" --rename-current-tab="tab1" --execute-command="ls" &
sleep 2 && guake --new-tab="my/path" --rename-current-tab="tab2" --execute-command="ls" &
exit 0

Guake starts one process and a follow up Guake calls are sending instructions to the running process.

Therefore executing the above runs all 3 lines in one go as each one goes into background immediately (ends with &).
(1) start guake and rename default tab;
(2) 1 sec later we send command to open new tab, rename it, run command;
(3) +1 sec later send commands for 3 tab

The key here is to increase sleep after each call, otherwise commands can arrive at random timing and weird stuff will happen

Ssonic
  • 11
  • 1
0

I created my own script to achieve the same behaviour (with different commands) based on Panayiotis Orphanides answer; and here it is adapted to your needs:

#!/bin/sh
guake -n guake -e 'ssh 1' guake -r '1'
guake -n guake -e 'ssh 2' guake -r '2'
guake -n guake -e 'ssh 3' guake -r '3'
guake -n guake -e 'ssh 4' guake -r '4'
exit 0

I can't think of a better way, but I would appreciate any comments

derHugo
  • 3,306
  • 5
  • 30
  • 49
vabada
  • 291
  • 5
  • 18