You are not logged in.

#1 2015-09-26 15:50:12

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Openbox add Icons to Menu

Hi! I'm on openbox and i want to set icons for my static menu ( i dont have icons there yet) so i added "<applicationIcons>yes</applicationIcons>" to my rc.xml in the menu section and now i want to run obmenu-generator to add icons to my menu. But i dont know how the commandline should look like to do this? so what must i do to add icons?

Offline

#2 2015-09-26 16:23:16

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

Offline

#3 2015-09-26 16:30:43

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

Doesn't help!
With

obmenu-generator -i -s -c

it is overwriting my whole menu and I cant configure it again cause it's toooo big.

Offline

#4 2015-09-26 16:35:10

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

Oh, well you didn't mention that you didn't want to regenerate the menu...

Maybe this helps: https://wiki.archlinux.org/index.php/Op … -generator

Offline

#5 2015-09-26 16:37:58

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

Hää? can you explain me please, I don't understand how to do/what they mean .. ;(

Offline

#6 2015-09-26 16:43:57

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

I think it means that you create the file ~/.config/openbox/menu.xml with the following content:

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu>
    <menu id="root-menu" label="OpenBox 3" execute="/usr/bin/obmenu-generator -i">
    </menu>
</openbox_menu>

Offline

#7 2015-09-26 16:46:30

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

But isn't my current menu overwritten then???

Offline

#8 2015-09-26 16:52:49

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

Well, yes. It's dynamically generated. I don't really understand what you're expecting here. Either you regenerate a static menu/use a dynamically generated menu or you go through your current menu file adding

icon="/path/to/icon.png"

to every single entry as per https://bbs.archlinux.org/viewtopic.php?id=175958

Last edited by Chazza (2015-09-26 16:54:16)

Offline

#9 2015-09-26 16:54:50

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

Ahh thats what i want. Adding these lines. But i can't do it by hand. Isn't it possible that it is generated? I though it is possible to generate a menu with icons based on my current one? no or yes?

Offline

#10 2015-09-26 16:57:55

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

I'm afraid I don't know of anything to automate the process off the top of my head. I suppose you throw together some sort of script that parses the menu, looks up the icon from the associated .desktop file and then adds the icon= lines.

Offline

#11 2015-09-26 16:59:20

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

So obmenu-generator cant just add the icons to my current menu??

Offline

#12 2015-09-26 17:04:07

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

Don't know, can't say I've ever used it before. Maybe try just running obmenu-generator -i and see if that adds the icons to your current menu without trying to regenerate it?

Offline

#13 2015-09-26 17:27:13

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

Nope it doesnt ;( Any other solution?

Offline

#14 2015-09-26 18:29:26

knightzx
Member
Registered: 2013-09-30
Posts: 6

Re: Openbox add Icons to Menu

You can config the menu generated with obmenu-generator by editing ~/.config/obmenu-generator/schema.pl
It's in perl but it's relatively easy to edit even if you don't know anything about perl.
Then you can regenerate the menu with

obmenu-generator -i -s -c

It will override your old menu, though.

Offline

#15 2015-09-26 18:51:52

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

Ough. But I don't have time to create such complex template cause I don't have any idea about perl!

But when someone could make me a theme that will "add icons to my current one" would be great!

Offline

#16 2015-09-26 19:26:03

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

Here is my menu, maybe someone can make a scheme? http://ix.io/l26

Offline

#17 2015-09-26 20:16:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,502
Website

Re: Openbox add Icons to Menu

Oh dear - I have no idea what to do with this thread.  I suppose the newbie corner is a good place, but I'm tempted to put it in TGN as the current posting strategey of the OP is clearly directing this thread to nowhere.

Tekkz, please take more time to think about your question and what you actually need help with so you don't end up waisting the time and goodwill of our members.

Please read the following guides:
how to ask smart questions
help vampires

Recognize that no one here is paid, and no one has any need to help you.  So if you drag people around with this back and forth of whether you want this automated, not automated, or partially automated, etc, you are likely going to make them all run out of patience so they wont bother helping you anymore.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Online

#18 2015-09-26 20:18:32

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

Sorry but you told me that there is no program which can help me, you told me that i can do something with perl, what i can't do, so what do you want me todo now?

Offline

#19 2015-09-26 21:36:30

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

I cooked up this script in Python that should automate the adding of the icon= lines. Note that it doesn't add icons for categories yet and also note that it will not work if the item label is not the same as the name in the .desktop file, e.g. Gimp will not work - it must be GNU Image Manipulation Program. Anyway, feel free to mess around with it if you like: https://github.com/charlesbos/my-script … onadder.py

Edit: added support for categories and non-standard names.

Last edited by Chazza (2015-09-27 16:05:43)

Offline

#20 2015-09-27 08:44:18

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

Thanks! Works fine, but sometimes it cant find the icon but i set the name correct. i just added the icons manually now, thanks anyway!!

Offline

#21 2015-09-27 09:51:05

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

No probs. Just for the hell of it, I'm adding a fix for names like Gimp so it can get icons for those as well.

Offline

#22 2015-09-27 09:55:31

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

How do you do this?

Offline

#23 2015-09-27 10:10:54

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

So if matching by name fails, we try and match the execute line in the menufile with the Exec= line in the .desktops. If that also fails, we try and match the execute line with the .desktop filename. And if that fails there's nothing more we can do. I've just added the fix so I'll push it to github now.

Offline

#24 2015-09-27 10:12:17

tekkkz
Member
Registered: 2015-08-07
Posts: 68

Re: Openbox add Icons to Menu

ah nice
okay
good work!

Offline

#25 2015-09-27 13:32:42

Chazza
Wiki Maintainer
Registered: 2013-06-02
Posts: 506

Re: Openbox add Icons to Menu

Thanks. As well as the support for the non-standard names, I've also added support for category icons. I think the script should now do everything you originally asked for.

Offline

Board footer

Powered by FluxBB