gnomerc script, except you don't need to know sh syntax (but neither can you use any sh programming construct). This has almost the same purpose and scope of the. The menu option System -> Preferences -> Startup Applications allows you to define what applications should be started when your graphical session starts (Ubuntu predefines quite some), and add or remove them to your taste. gnomerc script is finished therefore, if you want to autostart some long-running program, you need to append & to the program invocation, in order to detach it from the running shell. Note that the session does not start until the. To add a sudo user via the command line, you have to launch the terminal first. You can either do it through the terminal or take the graphical approach, using System Settings. You can put arbitrary commands in there environment variables that you set in this script will be seen by any program that you run in your session. Within Ubuntu and other Debian-based distros, there are two prominent ways of adding a sudo user. gnomerc in your home directory is automatically sourced each time you log in to a GNOME session. You can find a readable introduction to at: the man pages man 5 init and man 8 init give you the full details.Ī shell script named. These scripts will run during system startup (or in response to certain events, e.g., a shutdown request) and so are the place to run commands that do not interact with the user all servers are started using this mechanism. The upstart system will execute all scripts form which it finds a configuration in directory /etc/init. Under New Action, choose Comment to explain what you are doing, then the trigger (the command, something like Alt+ F10), and then, under action, enter the absolute path to the executable script above.There are different ways to automatically run commands: For KDE, go to System Settings -> Shortcuts and Gestures -> Custom Shortcuts -> Edit (in the lower left corner) -> New -> Global -Shortcut -> Command/URL. You may then click with the mouse on your terminal, which becomes the current active directory, and resend the shortcut: you will then get your terminal, and the proper directory.Īfter making this script executable, you can associate it to a keyboard shortcut this depends on DM. The good thing about this script is that, if the current active window is not a terminal, hence it has spawn no bash shells, nothing will happen. Simply find the user you need and add it to the su command syntax. Konsole -workdir $MYPWD 2>/dev/null & disownĬareful, there is no error checking in the above. su Command Syntax To use the su command, enter it into a command-line as follows: su options username arguments If a username is specified, su defaults to the superuser (root). Ps -o cmd -p "$i" | grep bash > /dev/null MY_PPID=$(xprop -id $ACT_WIN _NET_WM_PID | awk '') It does so for all bash shells found open, not just the first one. ![]() ![]() , if it is a terminal), then finds the children processes of konsole/xterm/., and, for every child process which is a bash shell, it locates its current working directory and opens a konsole window in the given current directory. The following script first identifies the current active window, then identifies the process running into it (it will be something like konsole, or xterm, or. without waiting for the movie to finish? The script solves exactly this problem. The script below is a tad complex for this reason: in the current active window you may have a currently running task (say, you are watching a movie via vlc), so you do not have the prompt available how do you then retrieve your PWD without waiting for the completion of the task, i.e. Unlike I understood the OP to mean: a shortcut to open a new terminal in the present working directory I find myself in, in the currently active terminal, not in the file manager (BTW, in KDE there is the same trick pointed out in the other answer: in Doplhin, you use Shift+ F4 I believe any decent file manager will provide such a key).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |