Terminal - Way to automatically load a predefined command

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
Questions1010
Level 1
Level 1
Posts: 25
Joined: Mon Apr 30, 2018 11:40 am

Terminal - Way to automatically load a predefined command

Post by Questions1010 »

I am looking for a way to be able to create an icon in the "Launcher' toolbar for a custom instance of Terminal.
I was wondering if there is a way to add to (edit) the launcher button in the "Command:" field which currently shows "gnome-terminal"
to be able to automatically load specific text into the terminal command field <username>:~$
where every time you launch this button for the terminal it loads up a terminal with specified text already typed out for you.

Example:
1.) Hit custom terminal launcher button
2.) Opens terminal window
3.) Terminal commandline reads <username>:~$ <specifed text command>

I don't want it to excute the command because I need to be able to type a suffix onto the end of the specified text.
Also I would like that when the command is executed by hitting enter, that when the command is complete that it reloads that same specified text again which is <username>:~$ <specifed text command> from the example above.

Hopefully this makes sense and can be done.
Thank You for any help offered.
Questions1010
Level 1
Level 1
Posts: 25
Joined: Mon Apr 30, 2018 11:40 am

Re: Terminal - Way to automatically load a predefined command

Post by Questions1010 »

If you go into Terminal menu bar and select
Edit - Preferences
Then select "Profiles" and select the "Command" tab at top
there are some options such as
"run a custom command instead" and "when command exits"
that seem like they might have to do with what I am looking for but not sure what to enter in the field?
hayden
Level 2
Level 2
Posts: 78
Joined: Thu Apr 07, 2011 7:59 am
Location: Texas, USA

Re: Terminal - Way to automatically load a predefined command

Post by hayden »

you could a write a script that opens a termimal and waits or "reads" your text input and when you hit enter it runs the command with your text as a parameter.
Post Reply

Return to “Software & Applications”