5

This is a double question.

The first one is: can I put a terminal shortcut on an Ubuntu desktop and how (the double-click is supposed to launch the terminal window)

The second is: is it possible to launch the terminal directly with a command? That is, any time it starts it must directly call sudo apt-get...

Any help is appreciated.

1 Answers1

7

The actual command that launches Terminal is . . .gnome-terminal. There are actually many different Terminal Emulators. For instance, I am using sakura right now, a lot of people like Terminator , the classic one is xterm (which by the way also comes with Ubuntu and pretty much any Linux distro that has graphical environment).

What you call "shortcut" in Windows world is an .lnk file. In Ubuntu world there is something similar, .desktop files. They are used for a lot more than just running some app - you can also use them to launch stuff on GUI login if you put those files into .config/autostart folder (notice the leading dot). The structure of those files is as follows :

[Desktop Entry]
Type=Application
Exec=**actual command goes here**
Hidden=false
NoDisplay=false
Terminal=false

So knowing that you could create a file like this:

[Desktop Entry]
Name=MY-CUSTOM-APP
Type=Application
Exec=gnome-terminal
Hidden=false
NoDisplay=false
Terminal=false
Icon=/usr/share/icons/gnome/48x48/apps/terminal.png

The Icon field can be ignored sometimes, but if you want the shortcut to look pretty, give it a full path to the image.

Also, there exists a folder with all the .desktop files, the /usr/share/applications, and there is /usr/share/applications/gnome-terminal.desktop. One could copy over such file to /home/user/Desktop/. Problem is, those files are owned by root user, so you have to do something along these lines:

cp /usr/share/applications/gnome-terminal.desktop /home/$USER/Desktop/Terminal.desktop

chown $USER:USER /home/$USER/Desktop/Terminal.desktop

chmod +x /home/$USER/Desktop/Terminal.desktop