Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 19 Nov 2018, 17:35
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
MintPup (Trusty LTS)
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 9 of 23 [332 Posts]   Goto page: Previous 1, 2, 3, ..., 7, 8, 9, 10, 11, ..., 21, 22, 23 Next
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5087
Location: Arizona, U.S.A.

PostPosted: Thu 20 Aug 2015, 13:08    Post subject:  

Hi guys;

Here is the Bacon command that grabs the Desktop files list.
You can see the Bash command inside it.
Code:
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:
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?
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 3541
Location: holland

PostPosted: Thu 20 Aug 2015, 14:31    Post subject:  

Hi William,

Quote:
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 Smile

The config file is ~/.config/openbox/menu.xml, containing:
Code:
 <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:
/usr/.local/share/applications/*.desktop

Should probably be:
Code:
/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
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 3200

PostPosted: Thu 20 Aug 2015, 16:18    Post subject:  

sunburnt wrote:
Hi guys;

Here is the Bacon command that grabs the Desktop files list.
You can see the Bash command inside it.
Code:
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:
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
Back to top
View user's profile Send private message Visit poster's website 
mcewanw

Joined: 16 Aug 2007
Posts: 3200

PostPosted: Thu 20 Aug 2015, 18:02    Post subject:  

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
Back to top
View user's profile Send private message Visit poster's website 
mcewanw

Joined: 16 Aug 2007
Posts: 3200

PostPosted: Thu 20 Aug 2015, 18:28    Post subject:  

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:
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:
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
Back to top
View user's profile Send private message Visit poster's website 
mcewanw

Joined: 16 Aug 2007
Posts: 3200

PostPosted: Thu 20 Aug 2015, 23:19    Post subject:  

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/viewtopic.php?p=861025#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:
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).
mk-jwm.main_homelocalfirst.bac.tar
Description  new source code with homelocal desktop files coming first in search
tar

 Download 
Filename  mk-jwm.main_homelocalfirst.bac.tar 
Filesize  4.68 KB 
Downloaded  118 Time(s) 
mk-jwm.main.homelocalfirst.tar
Description  This binary puts lists home/.local desktops first in the list order (not stripped)
tar

 Download 
Filename  mk-jwm.main.homelocalfirst.tar 
Filesize  35.14 KB 
Downloaded  110 Time(s) 
mk-jwm.main.tar
Description  resultant binary once BaCon compiled (not stripped yet)
tar

 Download 
Filename  mk-jwm.main.tar 
Filesize  35.14 KB 
Downloaded  118 Time(s) 
mk-jwm.main.bac.tar
Description  my mod to the source code from smokey01 mk-menu.zip
tar

 Download 
Filename  mk-jwm.main.bac.tar 
Filesize  4.68 KB 
Downloaded  115 Time(s) 

Last edited by mcewanw on Fri 21 Aug 2015, 02:13; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Fri 21 Aug 2015, 01:30    Post subject:  

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

_________________
Farewell, Nooby, you will be missed...
Back to top
View user's profile Send private message MSN Messenger 
mcewanw

Joined: 16 Aug 2007
Posts: 3200

PostPosted: Fri 21 Aug 2015, 02:10    Post subject:  

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, 02:23; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Fri 21 Aug 2015, 02:21    Post subject:  

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

_________________
Farewell, Nooby, you will be missed...
Back to top
View user's profile Send private message MSN Messenger 
sunburnt


Joined: 08 Jun 2005
Posts: 5087
Location: Arizona, U.S.A.

PostPosted: Fri 21 Aug 2015, 03:30    Post subject:  

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.
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Fri 21 Aug 2015, 03:53    Post subject:  

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
mk-jwm.main.zip
Description 
zip

 Download 
Filename  mk-jwm.main.zip 
Filesize  19.38 KB 
Downloaded  107 Time(s) 

_________________
Farewell, Nooby, you will be missed...
Back to top
View user's profile Send private message MSN Messenger 
sunburnt


Joined: 08 Jun 2005
Posts: 5087
Location: Arizona, U.S.A.

PostPosted: Fri 21 Aug 2015, 11:24    Post subject:  

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, 11:43; edited 1 time in total
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5087
Location: Arizona, U.S.A.

PostPosted: Fri 21 Aug 2015, 11:42    Post subject:  

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.
Quote:
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.
Quote:
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
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Fri 21 Aug 2015, 11:53    Post subject:  

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

_________________
Farewell, Nooby, you will be missed...
Back to top
View user's profile Send private message MSN Messenger 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Fri 21 Aug 2015, 12:01    Post subject:  

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

_________________
Farewell, Nooby, you will be missed...
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 9 of 23 [332 Posts]   Goto page: Previous 1, 2, 3, ..., 7, 8, 9, 10, 11, ..., 21, 22, 23 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1208s ][ Queries: 12 (0.0208s) ][ GZIP on ]