Thursday, April 25, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 1673  / 2 Years ago, mon, july 11, 2022, 3:57:26

I'm trying to create my first launcher for Unity that works like this:



when I use the left-click, it opens the browser set as default on the system

when I use the right-click it opens 3 shortcuts related with the other browsers of the system.



But I'm having this problem: for each shortcut, unity is duplicating the icon on the launcher. I wanna all the browsers set on the same icon.

Is that possible?



Here is the code:



[Desktop Entry]
Version=1.0
Name=Brox
Comment=Navegue pela Internet
GenericName=Brox
Exec=sensible-browser %u
Terminal=false
Type=Application
Icon=/usr/share/icons/Faenza/apps/scalable/brox.png
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;

X-Ayatana-Desktop-Shortcuts=Google Chrome;Firefox;Opera;

[Google Chrome Shortcut Group]
Name=Google Chrome
Exec=/opt/google/chrome/google-chrome %U
OnlyShowIn=Unity

[Firefox Shortcut Group]
Name=Firefox
Exec=firefox %u
OnlyShowIn=Unity

[Opera Shortcut Group]
Name=Opera
Exec=/usr/bin/opera %U
OnlyShowIn=Unity


Thanks in advance


More From » unity

 Answers
0

Ok, I gotta it!

What I had to do is to edit (as a root) the file bamf.index set in the path /usr/share/applications.

Just added few lines with the name of the launcher followed by the command you want it to manage.
The example on my case was:



brox.desktop  sensible-browser %u
brox.desktop /opt/google/chrome/google-chrome %u
brox.desktop firefox %u
brox.desktop /usr/bin/opera %u


And its done!


[#44919] Tuesday, July 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
truwom

Total Points: 101
Total Questions: 99
Total Answers: 100

Location: Ivory Coast
Member since Tue, Sep 15, 2020
4 Years ago
truwom questions
;