简体   繁体   中英

Two terminal windows open up when I start my Ubuntu app with GNOME

I have created a simple terminal application and want to use a simple desktop icon in Ubuntu with GNOME. Currently I have created a.desktop file with the following content:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=My App
Icon=/opt/my-app/icon.png
Path=/opt/my-app
Exec=x-terminal-emulator --title "My App" -e "bash -c '/opt/my-app/MyApp;$SHELL'"
StartupNotify=false
X-UnityGenerated=true
Terminal=true
Categories=Utility

So far, this has worked well for me. I've created this simple shell script to put it in place:

APP_NAME=my-app
APP_BINARY=MyApp
APP_INSTALLATION_PATH=/opt/$APP_NAME

# create app dir
echo "Creating application directory..."
sudo mkdir -p $APP_INSTALLATION_PATH

# place icon and binary
echo "Placing icon in application directory..."
sudo cp resources/icon.png $APP_INSTALLATION_PATH/icon.png

echo "Setting permission for ${APP_INSTALLATION_PATH}/icon.png..."
sudo chmod 644 $APP_INSTALLATION_PATH/icon.png

echo "Placing binary in application directory..."
sudo cp build/MyApp $APP_INSTALLATION_PATH/$APP_BINARY

echo "Setting executable permission for ${APP_BINARY}..."
sudo chmod +x $APP_INSTALLATION_PATH/$APP_BINARY

echo "Placing desktop icon..."
cp resources/$APP_NAME.desktop $HOME/.local/share/applications/$APP_NAME.desktop

echo "Setting executable permission for ${APP_NAME}.desktop..."
chmod +x $HOME/.local/share/applications/$APP_NAME.desktop

echo "${APP_BINARY} is now installed..."

So what's the problem then? The problem is when I start the application it opens two terminal windows. And both terminals are open in the "regular" terminal icon with two more "dots".

What I simply want is to make my icon have one "dot" appearing there, also that the terminal window shows the title of the app as well. This does not work currently.

Any ideas how I can solve this?

Change

Terminal=true

to

Terminal=false

You're already creating a terminal with the x-terminal-emulator command, you don't need to tell Gnome to create one as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM