MintPup (Trusty LTS)

A home for all kinds of Puppy related projects
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#121 Post by sunburnt »

Hi guys;

Here is the Bacon command that grabs the Desktop files list.
You can see the Bash command inside it.

Code: Select all

lstDt$ = CHOP$(EXEC$("ls -1 /usr/share/applications/*.desktop"))
I can add another command for /usr/.local/share/applications/* and merge the two.
Like:

Code: Select all

lstDt$ = lstDt$ & CHOP$(EXEC$("ls -1 /usr/.local/share/applications/*.desktop"))
Do you want the ".local" list first, or last?
Or maybe a different way to handle it would be better?

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#122 Post by fredx181 »

Hi William,
I'm also curious how menus are generated from desktop files in openbox.
I must say first that I don't know exactly how it works, but here's some info:

The menu is generated by '/usr/bin/openbox-menu' (from package openbox-menu), it can make use of either /etc/xdg/menus/lxde-applications.menu or /etc/xdg/menus/xfce-applications.menu.
The latter I used for latest mintpup-openbox setup (version before I used lxde-applications.menu)
Dependencies are either lxmenu-data, (for lxde-applications.menu) or libgarcon-common (for xfce-applications.menu)
Both install also 'Categories' *.desktop files in /usr/share/desktop-directories; the <name>.menu file inside /etc/xdg/menus/ can read from these and the menu will be updated if there's a *.desktop change or addition in /usr/share/applications (or e.g. ~/.local/share/applications).
I can only guess, probably dependency 'libmenu-cache3' does the updating, so it's not depending on 'update-menus' command, which is pretty nice :)

The config file is ~/.config/openbox/menu.xml, containing:

Code: Select all

 <menu id="desktop-app-menu-lxde" label="LxdeApplications" execute="/usr/bin/openbox-menu mintpup-ob-applications.menu" icon="/usr/share/icons/applications.png">
'mintpup-ob-applications.menu' is a modified xfce-applications.menu (still labelled 'LxdeApplications' in menu.xml, but this doesn't really matter)

I've been searching for similar way for Jwm, but couldn't find, yes, there's xdg-menu from Arch Linux;
https://wiki.archlinux.org/index.php/Xdg-menu
Which should work with Jwm, but needs extra perl dependencies.
And there's a python dependent script I've seen a while back, but we probably don't want that.

Still I think it should be possible, there might be a way such as puppy handles it, I've seen here and there.

Terry: Thanks for replying, all the best to you!
One thing:

Code: Select all

/usr/.local/share/applications/*.desktop
Should probably be:

Code: Select all

/usr/local/share/applications/*.desktop
(not ".local", but "local")

Edit: Sorry, reading now I see Icewm listed, not Jwm on:
https://wiki.archlinux.org/index.php/Xdg-menu

Fred

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#123 Post by mcewanw »

sunburnt wrote:Hi guys;

Here is the Bacon command that grabs the Desktop files list.
You can see the Bash command inside it.

Code: Select all

lstDt$ = CHOP$(EXEC$("ls -1 /usr/share/applications/*.desktop"))
I can add another command for /usr/.local/share/applications/* and merge the two.
Like:

Code: Select all

lstDt$ = lstDt$ & CHOP$(EXEC$("ls -1 /usr/.local/share/applications/*.desktop"))
Do you want the ".local" list first, or last?
Or maybe a different way to handle it would be better?
Hi Terry,

Yes, I had also noted that it was that CHOP$ command that provided the list of desktop files and had planned to try adding $HOME/.local/share/applications as you suggest ($HOME not /usr), so I think it would be good if you could manage that. I don't know whether it should be first or last; EDIT: I think .local is correct (i.e. $HOME/.local/share/applications).

Main thing is, are you sure the sources from smokey01 are the most up to date. I wonder why after I compiled the BaCon the resulting program didn't work for me and gave error about CHANGEDIR line?

Thanks for your help.

William
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#124 Post by mcewanw »

Thanks for the info Fred,

I'll check that out further. I take it that the file /usr/bin/openbox-menu is in MintPup. I'm currently in DDopenbox_wheezy and don't see it there.

William
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#125 Post by mcewanw »

Note that I've also tried compiling the smokey01 stored (mk-menu.zip) bacon code mk-jwm.main.bac in DD-openbox-wheezy using its DEVX. Again it seemed to compile using bacon in that DEVX, but again on trying to use the resulting binary mk-jwm.main in /opt/bin, I still get the same runtime error message:

Code: Select all

Runtime error: statement 'CHANGEDIR' at line 25 in 'mk-jwm.main.bac': Unable to change to directory: No such file or directory
I still wonder if I am using the most up to date source code for mk-jwm.main.bac? I don't know BaCon so have difficulty understanding that CHANGEDIR code line in the source code - I did wonder how it knows what its working directory is. The line 25 referred to in mk-jwm.main.bac is:

Code: Select all

CHANGEDIR REPLACE$(ARGUMENT$, "/mk-jwm.main", "")
I've already spent a lot of time on this but don't want to go further, of course, if it turns out I'm using the wrong or old source code.

EDIT: I do note that there is a commented out PRINT statement, which should yield the result of above CHANGEDIR code - I'll try that to see what the problem may be, but I still need confirmation I'm working with the most uptodate source code.

EDIT2: Very odd, it seems it can't find ~/.jwm/categories.lst or ~/.jwm/menu-root.lst when trying to run mk-jwm.main once placed in /opt/bin. Does it have to be compiled in a special way from a special location, Terry?

EDIT3: It does soom to me that the CHANGEDIR line should result in a cd to $HOME/.jwm (but doesn't seem to as source code stands) so that the line

lstCat$ = CHOP$(EXEC$("echo \"$(<./categories.lst)\" |sed '/#/d;/./!d'"))

can find ./categories.lst and similarly later on for ./menu-root.lst, but as it stands I think it probably cd's to /opt/bin since that is where binary mk-jwm.main is stored (unless, as I ask, it is something to do with compiling in a special way?). Well, bit of a mystery since it is true that /opt/bin/mk-jwm.menu contains 'cd $HOME/.jwm' before calling mk-jwm.main, so I don't know what the problem is...

William
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#126 Post by mcewanw »

I have now tried commenting out the CHANGEDIR (line 25) in the source code mk-jwm.main.bac and included my suggested fix for Terminal=true that I gave here:

http://www.murga-linux.com/puppy/viewto ... 025#861025

On then modifying the desktop file for htop such that it says Terminal=true and no longer includes xterm -e, I find that my fix works: After running menu-puppy and restarting jwm and running JWM -> System -> Htop, the menu seems to be generated okay and htop runs correctly in a terminal... (which would fix the openbox problem since no xterm -e needed in the desktop file, though of course this would need more testing).

I would also expect the CHOP$ modification suggested by Terry to also now work (making mk-jwm.main also search for desktop files in $HOME/.local/share/applications. However, I haven't tried that since I am concerned that the mk-jwm.main.bac source code from smokey01 site isn't the most up to date version afterall.

Hoping Terry will confirm the source code issue or otherwise help me with the existing CHANGEDIR line 25 of existing source code not working for me.

William

EDIT: Well I went that one stage further. Terry's CHOP$ lines didn't work for me, but I used my own version. I still worry about the following, since my having to comment out line 25 (CHANGEDIR) in it would mean that the source code I was using from smokey01 isn't up-to-date. However, the attached mk-jwm.main also searches in $HOME/.local/share/applications for desktop files (as a test I copied my new htop.desktop file to there; it contains Terminal=true but no longer has xterm -e in it. I use this line 32 of my mod to the source code to search in $HOME/.local. Note that you need to remove dummy tar, put mk-jwm.main into /opt/bin and make it executable (I haven't yet stripped the binary with strip -s or similar). EDIT2: Hmmm... I thought addition of 'SORT DT$' in BaCon code would sort the list, but it didn't... oh well, Terry can answer that one if sort desired via BaCon rather than bash (ah, I think its cause DT array includes complete path to the desktop file - can't sort that easily at all):

Code: Select all

lstDt$ = CHOP$(EXEC$("ls -1 /usr/share/applications/*.desktop; ls -1 $HOME/.local/share/applications/*.desktop"))
EDIT: an improvement to this would perhaps be to add a 'sort' since as it stands the .local desktop file apps come last (though I think keeping them unsorted is actually better, since separates out user desktop files from system ones). Could change the order, of course, to put user desktop apps at the top of the list (mk-jwm.main.homelocalfirst.tar also attached).
Attachments
mk-jwm.main_homelocalfirst.bac.tar
new source code with homelocal desktop files coming first in search
(4.68 KiB) Downloaded 177 times
mk-jwm.main.homelocalfirst.tar
This binary puts lists home/.local desktops first in the list order (not stripped)
(35.14 KiB) Downloaded 166 times
mk-jwm.main.tar
resultant binary once BaCon compiled (not stripped yet)
(35.14 KiB) Downloaded 172 times
mk-jwm.main.bac.tar
my mod to the source code from smokey01 mk-menu.zip
(4.68 KiB) Downloaded 177 times
Last edited by mcewanw on Fri 21 Aug 2015, 06:13, edited 1 time in total.
github mcewanw

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#127 Post by saintless »

Hi William.

Both binaries seems to work OK for me from quick test from user and root account.
I like more the sorting in mk-jwm.main.homelocalfirst

Unfortunately I can't say if the source archive has something missing from the binary included inside the system.

The testing shows Menu-MJWM (from Mitra) also doesn't read "Terminal=true" line and htop doesn't work from menu with Menu-MJWM after removing "xterm -e".

Maybe the best thing to do is to make updated deb package for mkjwmmenu. If it works well after testing properly we can remove Menu-MJWM and leave it as extra package for download. It is separate deb package anyway and easy to install/uninstall.

Edit:
mcewanw wrote:After running menu-puppy and restarting jwm and running JWM -> System -> Htop...
/opt/bin/mk-jwm.menu has "jwm -reload" line and this is enough to update the menus. Doesn't this work the same for you or you need to restart jwm to update the menu?

Toni

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#128 Post by mcewanw »

Hi Toni,

Oh yes, you are correct, the menu is automatically reloaded on menu-puppy being run.

I'll upload the source for homelocalfirst since preferred (I prefer it too by the way) - I guess Terry can confirm if source code is correct version albeit with CHANGEDIR line now commented out. Do you want it to search any other fixed location for desktop files - would be easiest to add that now if required (but I feel it is probably enough as it is - keep it simple. EDITED: agreed - just saw your following post)?

William
Last edited by mcewanw on Fri 21 Aug 2015, 06:23, edited 2 times in total.
github mcewanw

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#129 Post by saintless »

mcewanw wrote:Do you want it to search any other fixed location for desktop files - would be easiest to add that now if required?
I think it is OK to search only in /usr/share/applications and $HOME/.local/share/applications
Maybe some packages will use /usr/local/share/applications as location for .desktop files but I doubt there is such official Debian/Ubuntu/Mint package and for DD special packages we use /usr/share/applications

In my opinion no need to add more fixed locations.

BTW Mitra's MJWM has option to add any location for desktop files and it will be available as alternative menu system.

Toni

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#130 Post by sunburnt »

Just to be sure... Will someone post my current JWM menu maker file?
I seem to have a number of source files and need to nail it down.
One of them has the CHANGEDIR commented out. I don`t see it`s needed.
But then it shouldn`t cause problems either, as it`s a simple command.

So search /.local first?
Maybe have it look for /local also?

Could have it find a config. file with other paths, and if exists use it?
I think this is probably going too far. But you guys decide.

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#131 Post by saintless »

sunburnt wrote:Just to be sure... Will someone post my current JWM menu maker file?
Attached inside zip archive Terry. The same binary is in all DD versions and MintPup.

No need to search config file with paths or different locations. The standard locations for .desktop files are /usr/share/applications (desktop files appear in all users menu) and $HOME/.local/share/applications (desktop files appear only in the user menu).

Toni
Attachments
mk-jwm.main.zip
(19.38 KiB) Downloaded 166 times

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#132 Post by sunburnt »

Toni; I`m sorry I wasn`t clear, I need the ".bac" source file.
I`m not sure I`m working with the same file here.
I gave you guys all my BaCon source code files I think?
If not I`ll work with my best guess...
Last edited by sunburnt on Fri 21 Aug 2015, 15:43, edited 1 time in total.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#133 Post by sunburnt »

Toni; If you want to include the new BaCon 3.1 in your releases...

Here is the DnLd page: http://www.basic-converter.org/

Below is the top of the page, you could try the Debian file.
If you use the autoconfig source package, try vovchik`s instructions.
Downloads

BaCon Sources version 3.1

Autoconf source package for BaCon here
BaCon CHANGES
Screenshots of BaConGUI in action here, here and here.
BaCon Precompiled Binaries and Packages

Debian/Ubuntu/Mint/Bodhi
BaCon .deb install package here version 3.1 (64bit).
BaCon .deb install package here version 3.1 (32bit).
Here is the instructions from vovchik who is also at Puppy forum too.
Dear Terry,

Nice to have you back here. Bacon now uses the standard ./configure --prefix=/usr, make, make install sequence for easy compilation. There is bacon.sh in the archive, but I haven't done it the old way ever since Peter introduced the new build scheme. Maybe Peter could explain whether the old method still works...

With kind regards,
vovchik

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#134 Post by saintless »

Hi Terry.

Better wait for William to answer also.

The .bac file posted from you is only one and it is not for the binary attached in my previous post but for older mk-jwm.main version.
We have only the .bac file in the archive here and it is for older version:
http://smokey01.com/saintless/source-code/mk-menu.zip

In case you didn't read William's and mine posts above - he already made the changes we need. But he is working with .bac file for older version. He also posted above .bac files with his mods.

There is no need you or anyone else to work more on this in my opinion. We need only the correct source (.bac) for the binary attached above.

If you have more .bac files for mk-jwm.main I guess one of them is for the binary attached in my previous post and we need this .bac file if you still have it. We need nothing more.

Toni

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#135 Post by saintless »

sunburnt wrote:If not I`ll work with my best guess...
Please Terry, read my previous post and consult with William what you both work on exactly.
The important thing is to find .bac file for the attached binary.
Otherwise there is a chance you both are wasting your time.

Toni

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#136 Post by saintless »

Hi William.

We have already two pages about mk-jwm menu and anyone reading this thread will start thinking we have some major bug in the menu system which is not true.

Please, consult again with Terry what you need because I have the feeling we are wasting his time (since the correct .bac file is not available).

I already wrote I like the menu system as it is. It is tested over a year and works well. I have many things to test and fix for DD and MintPup updates but menu improvement is not my idea or priority.

Edit: if you think mk-jwm.main_homelocalfirst is ready for testing I will update the repository with new deb package.

Toni

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#137 Post by fredx181 »

William wrote:I'll check that out further. I take it that the file /usr/bin/openbox-menu is in MintPup. I'm currently in DDopenbox_wheezy and don't see it there.
Yes, it's with openbox setup for mintpup, DD-openbox doesn't use /usr/bin/openbox-menu, there the menu is provided by xfce4-panel menu plugin.

Good luck with the Jwm menu improvement, btw, I think it's good as it is now, except that it will be updated just only when a package has been installed (or by running 'update-menus') and few small other issues maybe.

Fred

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#138 Post by mcewanw »

saintless wrote:Hi William.

We have already two pages about mk-jwm menu and anyone reading this thread will start thinking we have some major bug in the menu system which is not true.

Please, consult again with Terry what you need because I have the feeling we are wasting his time (since the correct .bac file is not available).

I already wrote I like the menu system as it is. It is tested over a year and works well. I have many things to test and fix for DD and MintPup updates but menu improvement is not my idea or priority.

Edit: if you think mk-jwm.main_homelocalfirst is ready for testing I will update the repository with new deb package.

Toni
Hi Toni,

Yes, that's fine. I won't be working on this further anyway - it is as you say not a major problem anyway. The source and binaries I uploaded also do work fine for me, though if you decide to use the binary you should strip them to smaller size with strip -s.

Terry, the source code I modified (the only one I have or could find) is that inside here:

http://www.smokey01.com/saintless/sourc ... k-menu.zip

and my working modifications to that are here:

http://www.murga-linux.com/puppy/viewto ... 254#861254

Sorry, it was nightime here so just read your posts now and I have a sick three year old so having to head out to doctor.

William

EDIT: I feel that development work done in a team does tend to need many posts per item being developed. These threads are probably not the best for that but no-one is using a dedicated development thread for DD/MintPup anymore. So if there is no development thread or if further development contributions are not wanted then best just to leave these matters to Fred and yourself. I am happy with DD and MintPup as they are and can change my own system anyway - I was mainly just concerned about having access to up-to-date source code where that is applicable.
github mcewanw

User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#139 Post by saintless »

mcewanw wrote:EDIT: I feel that development work done in a team does tend to need many posts per item being developed. These threads are probably not the best for that but no-one is using a dedicated development thread for DD/MintPup anymore. So if there is no development thread or if further development contributions are not wanted then best just to leave these matters to Fred and yourself.
Hi William.

We can always use this thread for development:
http://murga-linux.com/puppy/viewtopic. ... start=4230
We discuss here and in DD threads mostly bugs fixing and not working in some situations programs (but we can do this in the thread above in the future). Then the solution goes in fixes post or we agree there is no problem for fixing.

We all see different problems in mk-jwm menu (but we all agree it works OK as it is).
For me it is the missing localization support.
For Fred it is the need to run update-menus before refreshing the menu.
For you it is the reading of "Terminal=true" line and $HOME/ path.

Mk-jwm menu should have separate thread in my opinion because it works in standard Debian system after changing sh to bash. And it is better to work fixing all problems at the same time.
For example Mitra's MJWM menu deb package in dd-repo also works in standard Debian with Jwm even with dash and his script has github development page.

I hope the child will be OK soon. I have a boy and a girl (almost 4 and 6 years old).

Toni

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#140 Post by fredx181 »

Hi Toni,

I've found a fix for scripts that require UTF-8 encoding:
Put on top of the script:

Code: Select all

LC_CTYPE=en_US.UTF-8
export LC_CTYPE
And it will display e.g. russian or arabic characters, from what I tested, for example by yad,

Don't know if it helps for localization support of Jwm menu, but I thought you'd like to know anyway.
Maybe you remember the issue we had with youtube-get, not displaying russian characters, (only when locales installed or running from uxterm)
I will update some scripts e.g. youtube-get, youtube-get2, dogradio with that fix included.
It needs of course the uxterm UTF-8 fix /usr/share/i18n/charmaps/UTF-8.gz (and /usr/lib/locale/locale-archive), which isn't installed on current openbox versions, but it will in next iso release.

Fred

Post Reply