LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can I set terminals' default directory to each different ones? (https://www.linuxquestions.org/questions/linux-newbie-8/can-i-set-terminals-default-directory-to-each-different-ones-4175468139/)

mshlinux 07-02-2013 05:37 AM

Can I set terminals' default directory to each different ones?
 
I have 3 terminals on my Debian wheezy.
they are Gnome Terminal, Terminator and Guake.

Can I set their default directory to each different ones.
Eg:
I want to set Gnome Terminal's default directory to ~/Desktop ,
Terminator default directory to ~/Download and
Guake's default directory to ~/mybin .

how can I do it?

shivaa 07-02-2013 05:56 AM

Do you mean that when you open a different type of terminal, you should get a different directory by default? Well, opening a different directory depends upon the logged in user, not on type of terminal. Let's say that if you have logged in as 'foo' user, then by default it will open '/home/foo' directory or the directory you've set as home directory for 'foo' user irrespective of terminal type.

Madhu Desai 07-02-2013 06:09 AM

Dont know about Terminator and Guake. But on gnome-terminal, you can do following in its Properties->Command
Code:

gnome-terminal --working-directory=/path-to-dir
Where /path-to-dir, should be accessable to the logging in user.

More:
Code:

$ gnome-terminal --help
$ gnome-terminal --help-terminal
$ gnome-terminal --help-window-options
$ gnome-terminal --help-terminal-options


David the H. 07-03-2013 01:30 PM

Most, if not all, gui console programs have some option available for specifying the default starting directory. The more feature-rich ones like konsole even have options for multiple profiles that can be individually configured.

Start digging into the options and documentation for the programs you're using.

jpollard 07-03-2013 01:34 PM

And even if they don't you can still do it by using a wrapper script to set the working directory before exec of the application.

Something simple like:
Code:

#!/bin/sh

cd $1
shift  # to discard the first parameter (the new working directory)
exec $* # use any remaining parameters as the application to run + parameters



All times are GMT -5. The time now is 01:12 AM.