How to Manually Add a Program to the Menu

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
sonny
White ninja
White ninja
Posts: 15
Joined: 15 Feb 2021, 16:46
Distribution: Porteus 5

How to Manually Add a Program to the Menu

Post#1 by sonny » 21 Feb 2021, 00:50

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!

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2844
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

How to Manually Add a Program to the Menu

Post#2 by ncmprhnsbl » 21 Feb 2021, 01:42

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
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

sonny
White ninja
White ninja
Posts: 15
Joined: 15 Feb 2021, 16:46
Distribution: Porteus 5

How to Manually Add a Program to the Menu

Post#3 by sonny » 21 Feb 2021, 04:06

Thank you, ncmprhnsbl.
Porteus community never disappoints!

donald
Full of knowledge
Full of knowledge
Posts: 1742
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

How to Manually Add a Program to the Menu

Post#4 by donald » 21 Feb 2021, 06:04


sonny
White ninja
White ninja
Posts: 15
Joined: 15 Feb 2021, 16:46
Distribution: Porteus 5

How to Manually Add a Program to the Menu

Post#5 by sonny » 21 Feb 2021, 06:55

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"

User avatar
Blaze
DEV Team
DEV Team
Posts: 3119
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

How to Manually Add a Program to the Menu

Post#6 by Blaze » 21 Feb 2021, 08:12

Use slackbuild for building tor-browser
https://slackbuilds.org/repository/14.2 ... r-browser/
and you will get tor-browser.desktop
Linux 5.10.11-porteus #1 SMP Thu Jan 28 11:33:44 UTC 2021 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

sonny
White ninja
White ninja
Posts: 15
Joined: 15 Feb 2021, 16:46
Distribution: Porteus 5

How to Manually Add a Program to the Menu

Post#7 by sonny » 21 Feb 2021, 16:34

Thank you for the tip, Blaze!
It is very much appreciated.

Kulle
Shogun
Shogun
Posts: 277
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

How to Manually Add a Program to the Menu

Post#8 by Kulle » 22 Feb 2021, 10:09

$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

User avatar
Ed_P
Contributor
Contributor
Posts: 5948
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 & 5.0rc2 Cinnamon 64 ISOs
Location: Western NY, USA

How to Manually Add a Program to the Menu

Post#9 by Ed_P » 22 Feb 2021, 16:53

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
Ed

Kulle
Shogun
Shogun
Posts: 277
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

How to Manually Add a Program to the Menu

Post#10 by Kulle » 23 Feb 2021, 09:17

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?

Kulle
Shogun
Shogun
Posts: 277
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

How to Manually Add a Program to the Menu

Post#11 by Kulle » 23 Feb 2021, 09:35

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?

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 2844
Joined: 20 Mar 2012, 03:42
Distribution: 5.0rc1-64bit all-DE+more
Location: australia
Contact:

How to Manually Add a Program to the Menu

Post#12 by ncmprhnsbl » 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 $@ &
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 5948
Joined: 06 Feb 2013, 22:12
Distribution: 4.0 & 5.0rc2 Cinnamon 64 ISOs
Location: Western NY, USA

How to Manually Add a Program to the Menu

Post#13 by Ed_P » 23 Feb 2021, 16:03

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:
Ed

Post Reply