3

I have this .desktop file set to update my software:

[Desktop Entry]
Version=1.0
Type=Application
Name=Update Software
Comment=Application
Exec=/home/david/Update_Script.sh
Icon=/home/david/Downloads/upgrade.jpg
Categories=Application;
Terminal=true

However, it launches Terminal, where I would prefer xterm. So do not mark this as a duplicate of this. I want the file to open xterm and then close xterm when the script is done. Here is what the script looks like currently:

sudo apt-get upgrade
sudo apt-get update
sudo apt-get install -f
sudo apt-get clean

Do I need to add something to the .desktop file or to the script to make it open xterm (and close it when done)?

David
  • 3,367
  • 1
    Why aren't you using Exec=xterm -e /home/david/Update_Script.sh, if you so insist on xterm? – muru Nov 17 '15 at 03:30
  • @muru Sorry I am new to using .desktop files and shell scripts, didn't know I could do that. – David Nov 17 '15 at 03:30

1 Answers1

3

.desktop and the Ctrl-Alt-T shortcut all launch x-terminal-emulator , which is a symlink to /etc/alternatives/x-terminal-emulator , which in turn is a symlink to /usr/bin/gnome-terminal.wrapper. In short, gnome-terminal aka Terminal is the default terminal emulator on Ubuntu.

If you want to use xterm for just one .desktop file , follow muru's suggestion in the comments and use use

Exec=xterm -e /path/to/script.sh

If you want to globally change the terminal that the system launches by default, run

sudo update-alternatives --config x-terminal-emulator
Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • 3
    You might want to add that he should remove the Terminal=true then. Else gnome-terminal will open, running xterm, running script :) – Jacob Vlijm Jun 09 '16 at 20:52