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.
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: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
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: 2064
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: 3869
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 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » 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
Warlord
Warlord
Posts: 594
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: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
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
Warlord
Warlord
Posts: 594
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
Warlord
Warlord
Posts: 594
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: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
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: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
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