Page 1 of 1

How to Manually Add a Program to the Menu

Posted: 21 Feb 2021, 00:50
by sonny
Hello,
I just downloaded Tor browser and unzip it.
How do I list the program in the "Internet" menu alongside other browsers?
Very much appreciated!

How to Manually Add a Program to the Menu

Posted: 21 Feb 2021, 01:42
by ncmprhnsbl
by placing a .desktop file in either /usr/share/applications or /home/guest/.local/share/applications
maybe the tor bundle includes one?
if not, have a look at the .desktop files in /usr/share/applications to get an idea of the format ...
typically, something like this would do: (<parts> to be filled in)
torbrowser.desktop:

Code: Select all

[Desktop Entry]
Name=Tor Browser
Icon=<some icon> or <path/to/some icon>
Exec=<path/to/executable> %u
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
Categories=Network;WebBrowser

(make sure there's a blank line at the end)
and then do (as root)

Code: Select all

update-desktop-database

How to Manually Add a Program to the Menu

Posted: 21 Feb 2021, 04:06
by sonny
Thank you, ncmprhnsbl.
Porteus community never disappoints!

How to Manually Add a Program to the Menu

Posted: 21 Feb 2021, 06:04
by donald

How to Manually Add a Program to the Menu

Posted: 21 Feb 2021, 06:55
by sonny
Thank you, Donald.
I simply did this to add "Tor Browser" to the menu:
Copy /tor-browser_en-US/Tor Browser" to /usr/share/applications
"Tor Browser will automatically be added to the menu under "Internet"

How to Manually Add a Program to the Menu

Posted: 21 Feb 2021, 08:12
by Blaze
Use slackbuild for building tor-browser
https://slackbuilds.org/repository/14.2 ... r-browser/
and you will get tor-browser.desktop

How to Manually Add a Program to the Menu

Posted: 21 Feb 2021, 16:34
by sonny
Thank you for the tip, Blaze!
It is very much appreciated.

How to Manually Add a Program to the Menu

Posted: 22 Feb 2021, 10:09
by Kulle
$BOOTDEV cannot be used in a .desktop file.

works:
Exec=/mnt/sdb1/browser/google-chrome_/chrome/google-chrome %U

doesn't work:
Exec=$BOOTDEV/browser/google-chrome_/chrome/google-chrome %U

That's not a good thing because $BOOTDEV isn't always /mnt/sdb1

How to Manually Add a Program to the Menu

Posted: 22 Feb 2021, 16:53
by Ed_P
I'll bet this would work.

google-chrome.desktop file

Code: Select all

Exec=sh /home/guest/google-chrome.sh
home/guest/google-chrome.sh script

Code: Select all

#!/bin/sh
Exec=$BOOTDEV/browser/google-chrome_/chrome/google-chrome %U

How to Manually Add a Program to the Menu

Posted: 23 Feb 2021, 09:17
by Kulle
Hi Ed_P,
thanks for the idea. But it doesn't work.
Error message:
/home/guest/google-chrome.sh: line 2: fg: no job control

What does that mean? what does "fg" mean?

How to Manually Add a Program to the Menu

Posted: 23 Feb 2021, 09:35
by Kulle
Hi Ed_P,
I found an answer here:
https://stackoverflow.com/questions/118 ... shell-mean
I added the script:

Code: Select all

#!/bin/sh
set -m
Exec=$BOOTDEV/browser/google-chrome_/chrome/google-chrome
Still does not work:
/home/guest/google-chrome.sh: Zeile 3: fg: %U: no such job

Very complicated?

How to Manually Add a Program to the Menu

Posted: 23 Feb 2021, 14:02
by ncmprhnsbl
i don't think you can use Exec= in a script like that... simply:

Code: Select all

#!/bin/sh
$BOOTDEV/browser/google-chrome_/chrome/google-chrome $@ &

How to Manually Add a Program to the Menu

Posted: 23 Feb 2021, 16:03
by Ed_P
ncmprhnsbl wrote:
23 Feb 2021, 14:02
i don't think you can use Exec= in a script like that... simply:

Code: Select all

#!/bin/sh
$BOOTDEV/browser/google-chrome_/chrome/google-chrome $@ &
I agree ncmp. My error Kulle. Sorry, I just posted your whole copied desktop line. :oops: