Hi all.
I have a shell script which launches an app for me with custom parameters (which is why I don't use the standard app shortcut).
I would like to create a symlink to that script, and place that shortcut on the panel.
How do I do that, and can I add the app's icon (which I can find) as the shortcut icon?
Thanks in advance.
Create a panel shortcut to a .sh script
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Create a panel shortcut to a .sh script
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
- smurphos
- Level 18
- Posts: 8498
- Joined: Fri Sep 05, 2014 12:18 am
- Location: Irish Brit in Portugal
- Contact:
Re: Create a panel shortcut to a .sh script
Which Desktop Environment (Cinnamon, Mate or XFCE)?
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
Re: Create a panel shortcut to a .sh script
Oh, sorry...
Mint 20, Cinnamon 4.6.7
Mint 20, Cinnamon 4.6.7
Re: Create a panel shortcut to a .sh script
I've done this with an AppImage that I launch with custom parameters. The process should be similar:audio2u wrote: ⤴Thu Jan 20, 2022 5:52 am Hi all.
I have a shell script which launches an app for me with custom parameters (which is why I don't use the standard app shortcut).
I would like to create a symlink to that script, and place that shortcut on the panel.
How do I do that, and can I add the app's icon (which I can find) as the shortcut icon?
Thanks in advance.
You can right-click on the Desktop and "Create a new launcher here..."
In the "Command" box, you would write something like:
sh /path/to/your/script.sh --your --parameters
(somebody correct me if I'm wrong on this!)And you can click on the Icon box on the top left to add an icon to it.
This will create a Desktop launcher, but it will ask you "do you want to also add it to the Menu?" Say YES.
Then go to the new Menu shortcut, right-click, and "Add to Panel".
Re: Create a panel shortcut to a .sh script
Thanks spamegg.
Weird thing is... the desktop launcher works, and I could choose to add it to the menu. But the menu version DOESN'T work. Same with the panel. I could add it, but it wouldn't run the script.
I'm sure I'm missing something really simple here. Any ideas?
Weird thing is... the desktop launcher works, and I could choose to add it to the menu. But the menu version DOESN'T work. Same with the panel. I could add it, but it wouldn't run the script.
I'm sure I'm missing something really simple here. Any ideas?
- smurphos
- Level 18
- Posts: 8498
- Joined: Fri Sep 05, 2014 12:18 am
- Location: Irish Brit in Portugal
- Contact:
Re: Create a panel shortcut to a .sh script
Can you share the contents of the script, and the launcher you've created in the menu - you will find it in ~/.local/share/applications - right click it and open with text edito to share.
For executable shell scripts just the full path to the script should work e.g. this works fine for me on a desktop launcher, menu and panel. Double quotes aren't needed in this example but would be if there was a space somewhere in the path to the script.
You can use sh if you want - in this case the command would be
For executable shell scripts just the full path to the script should work e.g. this works fine for me on a desktop launcher, menu and panel. Double quotes aren't needed in this example but would be if there was a space somewhere in the path to the script.
"/home/steve/.local/bin/toggle_surfshark.sh"
You can use sh if you want - in this case the command would be
sh -c "/home/steve/.local/bin/toggle_surfshark.sh"
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
Re: Create a panel shortcut to a .sh script
Ahhhh!
Smurphos, you pointed me in a direction which enabled me to help myself!
I had edited the desktop launcher in a text editor to change ...
... to read as ....
But the launcher (if that's what you would call it) which was located in /home/bruce/.local/share/applications still contained the original code, with the tilde and forward slash.
I removed those, and now the menu version AND the panel version of the launcher both work!
Thanks. I knew it would be something simple!
Smurphos, you pointed me in a direction which enabled me to help myself!
I had edited the desktop launcher in a text editor to change ...
Code: Select all
Exec=sh ~/darktable_3.8.0.sh
Code: Select all
Exec=sh darktable_3.8.0.sh
I removed those, and now the menu version AND the panel version of the launcher both work!
Thanks. I knew it would be something simple!