6

Well for Unity/Ubuntu 16.04 I added a custom script to the quick launch menu by added a *.desktop file inside ~/.local/share/applications/

With content as:

[Desktop Entry]
Type=Application
Terminal=true
Name=pgadmin
Icon=/home/paul/pgadmin4/pgadmin4.png
Exec=/home/paul/pgadmin4/pgadmin4.sh

The contents of the script under /home/paul/pgadmin4/pgadmin4.sh are:

#!/bin/bash
cd ~/pgadmin4
source bin/activate
python3 lib/python3.6/site-packages/pgadmin4/pgAdmin4.py &
/opt/google/chrome/google-chrome --profile-directory=Default --app-id=ojglidlfoedmhkmjdapihkjneoemohjm &

(which launches pgadmin4 python + a webpage in chrome with the correct address).

However this no longer seems to work, I can (after some troubles, see comments) add the icon to the favourite bar and find the desktop entry when I search the applications. However trying to click this icon doesn't open anything, it seems the icon points to "nothing".

So how to actually make it execute the given script?

paul23
  • 343
  • does it work if you create one using this gui? gnome-desktop-item-edit --create-new ~/Desktop – Joshua Besneatte Sep 11 '18 at 15:53
  • 1
    @JoshuaBesneatte I don't think gnome-desktop-item-edit is available by default (it's from the gnome-panel package which is not installed by default). – pomsky Sep 11 '18 at 15:58
  • interesting... I must have installed gnome-panel then because that is how I have been making launchers on my system. either way, the launchers I make with said gui are working for me. – Joshua Besneatte Sep 11 '18 at 16:01
  • 1
    @pomsky yes I'm absolutely sure - it worked in ubuntu 16.04 and manually executing /home/paul/pgadmin4/pgadmin4.sh in a terminal works. If I search I can find "pgadmin", however it doesn't start anything. – paul23 Sep 11 '18 at 16:21
  • @paul23 Does it work if you change Terminal=true to Terminal=false? Adding a launcher to the dock is pretty simple: https://askubuntu.com/questions/967409/cant-add-custom-desktop-files-to-ubuntu-dock – pomsky Sep 11 '18 at 16:22
  • @pomsky nope that doesn't change anything, I can still find it but if I click it nothing starts. -- I can indeed add it to the favourites following that link, however it still seems like it's an empty command. right click "show details" also just goes to ubuntu software with the message application not found. – paul23 Sep 11 '18 at 16:26
  • Wanted to add my 2c worth here, and say I have the exact same problem with 18.04 (upgraded from 16.04). Having a shortcut or launcher on the desktop for a script like this fails to execute, despite being set up to run as executable. Instead it tries to open under archive manager! If (through CLI) I navigate to the script file and run it, it runs just fine. How to make the script execute from desktop?! – witenitenz Oct 20 '18 at 00:06

1 Answers1

0

Change your

Exec=/home/paul/pgadmin4/pgadmin4.sh

To

Exec=bash /home/paul/pgadmin4/pgadmin4.sh