Ubuntu – Ubuntu Touch – how to create Unity .desktop launcher to make UT terminal to open and execute a command

command linelauncherubuntu-touchunity

I have latest Ubuntu Touch installed on Nexus 7.

I just apt-get installed there 'emacs' package. Currently I open Terminal application in Ubuntu Touch and key in "emacs" to get it launched.

I want to create .desktop launcher to start emacs in terminal (-nw) mode right from the Ubuntu Touch Unity desktop.

I want to keep using the new Ubuntu Touch terminal application as a shell to run emacs because the ubuntu touch terminal allows me to customise its toolbar to include custom shortcuts I need to use emacs with virtual keyboard. Like CTRL-X, CTRL-@, etc.

Normal gnome-terminal does not look good because there would not be this helpful toolbar and I do not always use ubuntu touch with hardware keyboard available.

Besides, when I apt-get installed gnome-terminal and added gnome-terminal -e "emacs -nw" into my launcher, as kindly suggested below – this does not work, neither gnome-germinal nor emacs window appears, just short 'start app' animation. And gnome-terminal is not nice because of it missing the custom keys toolbar, so I guess this is dead-end for me.

So I guess the question is – how should I modify the existing .desktop launcher for Ubuntu Touch Terminal application to make it open emacs on its launch?

Here is slightly cut default Ubuntu Touch terminal app .desktop launcher. How should I modify it to make it start emacs in terminal mode when clicked?

[Desktop Entry]
Exec=aa-exec-click -p com.ubuntu.terminal_terminal_0.7.49 -- terminal

Here is what I tried to put into the above launcher and what did not work:

  1. Exec=aa-exec-click -p com.ubuntu.terminal_terminal_0.7.49 -- terminal emacs
  2. Exec=aa-exec-click -p com.ubuntu.terminal_terminal_0.7.49 -- terminal -e "emacs -nw"

Best Answer

I guess you are trying to launch Emacs in Ubuntu's builtin terminal, don't you?

Then, you have to launch the terminal app and pass the command for it to execute. For example you could do it with gnome terminal using command

gnome-terminal -e "emacs -nw"

I don't have an Ubuntu Touch's terminal installed so I won't check if it accepts commands to execute via program arguments and what the syntax is. If so, then the command to put in the .desktop file would look similar to the one above.

Emacs GUI is probably impossible to run on Ubuntu touch until running XMir apps lands in the production images - I have no device to install UT on and have no information whether it has happened by now.

Related Question