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 Thu 14 Dec 2017, 15:24
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
WM menu systems for DebianDog/MintPup using xdg etc
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [34 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
fredx181


Joined: 11 Dec 2013
Posts: 2634
Location: holland

PostPosted: Tue 25 Aug 2015, 14:47    Post subject:  

Hi Toni, William,

Quote:
I'm also not the most objective person Fred, but while mk-jwm, mjwm and update-menus use zero RAM this is the report from lxtask about ram usage (RSS) after starting menu-openbox in DD-Jessie:
Code:
openbox-menu 10,5
jwm 6,1
menu-cached 4,2
jwm-obmenu 2,4


Yes, I agree that's to much extra RAM usage, I didn't look at that very much, just saw increase of total RAM in htop by a few MB's, but obviously that says not all.


Quote:
Edit: If you mean to make jwm-obmenu processes active only when update-menus is executed from deb package installing I'm not sure about this. Maybe Fred will know better if it is possible.


Ok, that would be a good compromise, I experimented already to make it this way, got it working with user root, but can't make it work yet with e.g. user puppy, continuing... I won't give up Smile

Fred
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Wed 26 Aug 2015, 00:46    Post subject:  

Thanks Fred.

I don't know if you use similar method but with Terry's menu from user account refreshing menus and installing packages with apt-get has different scripts.
/opt/bin/refresh-menus is for manually refreshing from user (and root) account. /opt/bin/menu-puppy doesn't work well from user account (It asks once for user password and then once more but for root password). The script works also for root and it is the one inside the desktop file.
/opt/bin/update-menus is link to /opt/bin/menu-puppy and starts /opt/bin/refresh-menus-3 when installing packages and auto-updates the menu for user and root.
I think the code in refresh menus was suggested by you when I asked for help at that time. I tested 3 different combinations and the best one is the uncommented in refresh-menus scripts.
The menu setup seems complicated at first but works well even in standard Debian.

Toni

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


Joined: 11 Dec 2013
Posts: 2634
Location: holland

PostPosted: Wed 26 Aug 2015, 10:58    Post subject:  

Hi Toni,

Quote:
I don't know if you use similar method but with Terry's menu from user account refreshing menus and installing packages with apt-get has different scripts.
.......


Thanks, yes the menu system is rather complicated, glad anyway that I don't have to re-invent the wheel.

I think it has one weakness:

Suppose you are logged in as root and make the switch to menu-mjwm, then login as user puppy,ok, menu- puppy is used, the user likes to stay with it, install some programs, then suddenly the menu has changed to menu-mjwm (because /opt/bin/update-menus is still symlink to menu-mjwm.
Not a disaster of course, but not how it should be.

Now.., probably not many users will switch from root to e.g. puppy and back, on the other hand if you like it to be a true multi-user system, for info here's a possible solution for that, didn't test very much, just an idea:

Make /opt/bin/update-menus a script with content something like this:

Code:
#!/bin/bash

export USER_HOME=`echo $XAUTHORITY | sed -e 's,/[^/]*$,,'`

if grep -q ".jwmrc-mjwm" $USER_HOME/.jwm/jwm.main; then
echo menu-mjwm running...
/opt/bin/menu-mjwm

elif grep -q "/etc/jwm/debian-menu" $USER_HOME/.jwm/jwm.main; then
echo menu-debian running...
/opt/bin/menu-debian.

elif grep -q ".cache/jwm-app-menu" $USER_HOME/.jwm/jwm.main; then
echo menu-openbox running...
/usr/local/bin/jwm-obmenu

else
echo menu-puppy running...
/opt/bin/menu-puppy
fi


And remove the commands for creating symlink to /opt/bin/update-menus in all /opt/bin/menu-* scripts.

Again, just idea, there may be complications or compatibility issues, as there almost always are some Smile

Btw, I have made also jwm-obmenu for wheezy now (compiled openbox-menu on wheezy), it works but I like to do some more testing.

Fred
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Wed 26 Aug 2015, 12:06    Post subject:  

Hi Fred.

The menu setup is not perfect but adding one more script instead symlink will make it more complicated. We always get problems after changes. In the case with your example /opt/bin/update-menus script it will break the menu in IceWM.
IceWM has the default Debian menu and needs /usr/bin/update-menus to update the menu. With this script Icewm will update Jwm menu because /opt/bin/update-menus script will run instead /usr/bin/update-menus command.
Installing different WM like blackbox for example will create the same problem for the user. Running menu-debian as it is will restore the official update-menus command and every WM using this method will work well.
I'm sure you can easy add few lines to cover this option but not for any available WM in debian repo and you can't predict what complications this change will bring later in situation not tested from us. I prefer to know the weakness we have instead finding new problems after we make new iso updates.
fredx181 wrote:
Btw, I have made also jwm-obmenu for wheezy now (compiled openbox-menu on wheezy), it works but I like to do some more testing.

Thanks.

Toni

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


Joined: 11 Dec 2013
Posts: 2634
Location: holland

PostPosted: Wed 26 Aug 2015, 12:42    Post subject:  

Hi Toni, William,

Here is low resources jwm-obmenu v 0.0.3-nocache.

- No daemon mode; Once the part of the menu 'jwm.main' is generated, openbox-menu exits, similar as mk-jwm.main does.
- Menu-cached is disabled (menu-cached is very stubborn, btw, needs to get killed by first remove ~/.cache/menus/* and then 'pkill menu-cached', tried to compile openbox-menu without libmenu-cache, it seems not possible to me)
- Updating the menu depends on /opt/bin/update-menus or refreshing by running 'Menu Openbox' from menu.

Alltogether: no process is running in the background after the menu has been generated so it works basically the same as the other menu systems.

Attached;
For DebianDog Jessie and Mintpup;
jwm-obmenu_0.0.3-no-cache_i386.deb.tar

For DebianDog Wheezy:
jwm-obmenu_0.0.3-wheezy-nocache_i386.deb.tar
(remove dummy .tar extension)

Edit:
Toni wrote:
The menu setup is not perfect but adding one more script instead symlink will make it more complicated.
......


Yes, I see, suspected something like that already.

Edit: Made small fix:
There should be no 'user settings' category when logged in as root. fixed.
Reattached.

Fred
jwm-obmenu_0.0.3-no-cache_i386.deb.tar
Description  jwm-obmenu for jessie and mintpup
tar

 Download 
Filename  jwm-obmenu_0.0.3-no-cache_i386.deb.tar 
Filesize  42.31 KB 
Downloaded  200 Time(s) 
jwm-obmenu_0.0.3-wheezy-nocache_i386.deb.tar
Description  jwm-obmenu for wheezy
tar

 Download 
Filename  jwm-obmenu_0.0.3-wheezy-nocache_i386.deb.tar 
Filesize  42.34 KB 
Downloaded  171 Time(s) 

Last edited by fredx181 on Thu 27 Aug 2015, 07:29; edited 1 time in total
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Wed 26 Aug 2015, 15:07    Post subject:  

fredx181 wrote:
Here is low resources jwm-obmenu v 0.0.3-nocache.

Thanks Fred.
Removing libgdk-pixbuf2.0 dependency from Wheezy deb makes possible to use jwm-obmenu in DD-Squeeze also Smile
I will test it in all versions but it will take some time.

Toni

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


Joined: 11 Dec 2013
Posts: 2634
Location: holland

PostPosted: Wed 26 Aug 2015, 15:13    Post subject:  

Toni wrote:
Removing libgdk-pixbuf2.0 dependency from Wheezy deb makes possible to use jwm-obmenu in DD-Squeeze also Smile


Ah, great!

Fred
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 3194
Location: New Zealand

PostPosted: Wed 26 Aug 2015, 19:45    Post subject:  

fredx181 wrote:
menu-cached is very stubborn, btw, needs to get killed by first remove ~/.cache/menus/* and then 'pkill menu-cached'


Hi Fred,

I didn't find menu-cached stubborn, but I think it may be the order you kill the processes. I guess menu-cached is restarted by openbox-menu because I found earlier that if you pkill openbox-menu, jwm-obmenu will then automatically be killed. After that a simple pkill menu-cached works fine without it coming back.

Of course, in terms of system resource usage it may be good to also rm ~/.cache/menus/* (though maybe it is tiny anyway).

The other,perhaps more important, issue that crosses my mind is that killing the processes may or may not (?) clean up any RAM memory caches they may have been using. So it might be worth considering freeing up RAM (cleaning dirty caches) after killing the processes:

Code:
sync && echo 3 > /proc/sys/vm/drop_caches


If you run the command 'free' before and after using that command in a terminal you will notice the huge difference it makes. Being only one-off temporary and at menu generation time I can't see any disadvantages in using that - never noticed any disadvantages anyway. I used to have an old low RAM machine like Toni's and that drop_caches command made a huge difference in terms of reducing need to swap (which is a real slowdown) and absolutely prevented crashes when I was trying to do too much otherwise. Of course Linux will quickly allocate new buffers, but at least these will not be caches and buffers abandoned by dead processes (EDIT: I don't know much about how Linux frees up processes RAM usage though so whether that is done automatically following a pkill terminate signal I don't know).

I wrote quite a bit about such matters long ago, because I was trying to get as much performance out of my low resource machine as I could. Actually, I stopped using swap space altogether around that time because that was the biggest slowdown of all on my old machine with its slow hard-drives (and Linux insists on using some swap regardless of swappiness settings). Note that I utterly disagree with the commonly advertised idea that for optimum performance swap space should at least equal machines physical RAM - that is a lot of nonsense IMO (swap/virtual memory is a compromise - it provides more 'apparent' RAM but inevitable system slow down - especially noticeable in old machines with slow harddrives, which alas, also tend to be machines with low RAM...):

http://www.murga-linux.com/puppy/viewtopic.php?p=529914

William

_________________
SomeOfMyWork with links:
dCoreDog
weX, scrox, Precord, Premote, fokSyfEyeR, xhippo-mod, flite_hts_pet
Back to top
View user's profile Send private message Visit poster's website 
fredx181


Joined: 11 Dec 2013
Posts: 2634
Location: holland

PostPosted: Thu 27 Aug 2015, 07:42    Post subject:  

Hi Toni, William,

I made small mistake with jwm-obmenu:
There should be no 'user settings' category when logged in as root.

Re-Attached fixed versions, see here.
http://murga-linux.com/puppy/viewtopic.php?p=861811#861811

Quote:
menu-cached is very stubborn, btw, needs to get killed by first remove ~/.cache/menus/* and then 'pkill menu-cached'
Hi Fred,

I didn't find menu-cached stubborn,


Yes, that's right. removing ~/.cache/menus/* is not needed, left it in the script though, as it doesn't do any harm.

Fred
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 3194
Location: New Zealand

PostPosted: Thu 27 Aug 2015, 09:29    Post subject:  

Hi Fred,

I've probably just done something silly, but I lost my menu altogether for a while after apt-get purge jwm-obmenu and then installing latest 0.0.3 version.

I note that if I currently run /opt/bin/menu-openbox I get the following terminal output:

Code:
mint bin # ./menu-openbox
cat: /root/.jwm/jwm.tail: No such file or directory
** Message: wrote to /root/.cache/jwm-app-menu


But I note that my menu has mysteriously reappeared (I'm not sure when or how - I've rebooted a few times...).

May as I say, just be something I did and not a problem - I'm not sure.

William

_________________
SomeOfMyWork with links:
dCoreDog
weX, scrox, Precord, Premote, fokSyfEyeR, xhippo-mod, flite_hts_pet
Back to top
View user's profile Send private message Visit poster's website 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Thu 27 Aug 2015, 10:36    Post subject:  

Hi Fred, William.

I think jwm-obmenu needs mkjwmmenu as dependency inside control file as the setup is now. It depends on already created ~/.jwm folder and jwm.tail file inside (provided from mkjwmmenu). This could be the reason William lost the menu while reinstalling. Maybe mkjwmmenu package is uninstalled because jwm.tail is missing according the terminal output.

Fred,
if you like to setup jwm-obmenu to work without depending on files included in mkjwmmenu package I prefer to wait with further testing because the scripts will be changed. I don't think User Settings category in previous version for root account was a problem but it is ok for me to remove it. The only included in this category script will give message for running as root anyway.
The suggestion from William for clearing the cache command didn't work from user account from quick testing installing packages with apt-get for me. Again - if you like to add the change I prefer to wait for updated package before further testing.

In my opinion jwm-obmenu package depending on mkjwmmenu is fine. I don't plan to remove mkjwmmenu.

I made some localisation tests in MintPup comparing the menus with my native language (which is not well supported in Debian/Ubuntu desktop files).
Click for desktop files menus screenshot.
Click for debian menu screenshots.

Terry's mk-jwm menu doesn't support translation for main categories and displays only the english name inside desktop files.
Mitra's mjwm menu doesn't support translation for main categories but displays the correct localisation name inside desktop files.
Jwm-obmenu supports both - localisation for main categories and for the names inside desktop files.
Debian menu supports localisation for main categories but /usr/share/menu files don't have name localisation lines and the programs have only the included name in English.

In general DD and MintPup don't have many desktop files with diffrent localisation name included. Even official Debian and Ubuntu don't include my native language in desktop files for many installed official packages.
I guess English is the only language with 100% supported localisation for main menu categories and names inside desktop files.

Edit: One thing I like more in Terry's menu is it doesn't add duplocate menu entries in different categories. Testing all programs from menu is faster when you have only one entry for each program.

Toni

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


Joined: 11 Dec 2013
Posts: 2634
Location: holland

PostPosted: Thu 27 Aug 2015, 11:44    Post subject:  

Hi Toni, William

Toni wrote:
I think jwm-obmenu needs mkjwmmenu as dependency inside control file as the setup is now.


Thanks, I couldn't understand first, but now I think I do, probably William removed mkjwmmenu earlier, as the result that ~/.jwm/jwm.tail doesn't exist anymore.
But how could the menu re-appear again after reboot?

Quote:
In my opinion jwm-obmenu package depending on mkjwmmenu is fine. I don't plan to remove mkjwmmenu.


Fine for me also, but in case you'd like it as independent package, /opt/bin/menu-openbox script can be changed easily by having something like this (mkdir ~/.jwm and adding jwm.tail to copy commands):

Code:
mkdir -p $HOME/.jwm 2> /dev/null

if [ "`whoami`" != "root" ]; then
cp -a /etc/xdg/templates/jwm_user.head $HOME/.jwm/jwm.head
else
cp -a /etc/xdg/templates/jwm.head $HOME/.jwm/
fi
cp -a /etc/xdg/templates/jwm.main $HOME/.jwm/
cp -a /etc/xdg/templates/jwm.tail $HOME/.jwm/
# cd $HOME/.jwm/
cat $HOME/.jwm/jwm.head $HOME/.jwm/jwm.main $HOME/.jwm/jwm.tail >  $HOME/.jwmrc

But then, if someone wants to change jwm.tail it needs to be done in /etc/xdg/templates/jwm.tail for menu-openbox.

I don't mind how it is done. I'll leave the choice up to you, as Jwm version is your project.

Quote:
I guess English is the only language with 100% supported localisation for main menu categories and names inside desktop files.


I agree, it's disappointing.

Edit:
Quote:
The suggestion from William for clearing the cache command didn't work from user account from quick testing installing packages with apt-get for me


It needs probably sudo, BTW, it could be very useful for you to run this command from time to time (as you have little RAM), to avoid as much as possible having to use swap, I agree with William, the system gets terribly slow when using swap.

Edit2:
Quote:
Edit: One thing I like more in Terry's menu is it doesn't add duplocate menu entries in different categories. Testing all programs from menu is faster when you have only one entry for each program.


Yes, to many programs in e.g. System or Accesories from menu-openbox, it's partly because we added multiple categories in custom made .desktop files.

Fred
Back to top
View user's profile Send private message 
saintless


Joined: 11 Jun 2011
Posts: 3882
Location: Bulgaria

PostPosted: Thu 27 Aug 2015, 13:50    Post subject:  

Hi Fred.
fredx181 wrote:
Thanks, I couldn't understand first, but now I think I do, probably William removed mkjwmmenu earlier, as the result that ~/.jwm/jwm.tail doesn't exist anymore.
But how could the menu re-appear again after reboot?

I'm not sure about this. But after removing mkjwmenu if you don't run "jwm -restart" and running menu-openbox it will appear without Shutdown category. But "jwm -restart" will break it again.
Changing the jwm theme will copy new jwm.tail in ~/.jwm and fix the menu again.
But maybe William's result is caused by something else. Testing will show it.
Quote:
I don't mind how it is done. I'll leave the choice up to you, as Jwm version is your project.

Thanks, probably I will add only mkjwmmenu as dependency in the deb and include jwm-openbox in next iso as fourth menu choice after some testing. It is great to have it since the ram usage problem is solved.
Quote:
Quote:
The suggestion from William for clearing the cache command didn't work from user account from quick testing installing packages with apt-get for me


It needs probably sudo...

Yes, it works with sudo but I mean I couldn't make the command work inside jwm-obmenu scripts for user account. Maybe I will try again later.

Quote:
Yes, to many programs in e.g. System or Accesories from menu-openbox, it's partly because we added multiple categories in custom made .desktop files.

Most extra categories are included to sort better the entries in Mitras menu-mkjwm or I get too many in category Others. It is difficult to make the desktop file suitable for different menu systems without extra categories. And some categories are different for Jwm and OpenBox version. We can't avoid this I'm afraid.

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: 3194
Location: New Zealand

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

saintless wrote:
Hi Fred.
fredx181 wrote:
Thanks, I couldn't understand first, but now I think I do, probably William removed mkjwmmenu earlier, as the result that ~/.jwm/jwm.tail doesn't exist anymore.
But how could the menu re-appear again after reboot?

I'm not sure about this. But after removing mkjwmenu if you don't run "jwm -restart" and running menu-openbox it will appear without Shutdown category. But "jwm -restart" will break it again.
Changing the jwm theme will copy new jwm.tail in ~/.jwm and fix the menu again.


But your description of what would happen, Toni, seems to be correct. When I said menu reappeared I didn't at the time notice that jwm tail part (Shutdown etc) still wasn't there. And on rebooting this morning the whole menu is gone again.

William

EDIT: Unfortunately, I didn't think about using /opt/bin/jwm-theme-change and not having a menu I didn't actually remember about that program or the themes location. Instead, I just deleted whiteout files for ~/root/.jwm and some other whiteout files to do with menu programs in /opt/bin. Since I was using Porteus boot changes dir, that was easy to do, and it worked on a reboot (no doubt there was easier way), though perhaps I have broken some dpkg thing (I don't know, but doesn't matter for me just now since this particular install is only a temporary one). After I got jwm-obmenu back, I re-installed the other menu systems and then purged them again to in the hope that would fix any dpkg misundertandings... Anyway, my jwm-obmenu is back.

Note that at some stage (alas i can't give details - I think on running menu-openbox) I got message about "can't make menu..." and something about "is .menu file okay". That's just from memory and wording is not exact.

EDIT2: Actually, turned out to not be quite so 'simple' as above edit. On rebooting, openbox menu was gone again and running menu-openbox told me .jwm tail was gone again (presumably because I had purged mjwm. Anyway, the menu appeared albeit without the tail part and I was able to run jwm-theme-changer from there, which as Toni suggested, seemed to fix everything once more...

_________________
SomeOfMyWork with links:
dCoreDog
weX, scrox, Precord, Premote, fokSyfEyeR, xhippo-mod, flite_hts_pet
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 28 Aug 2015, 02:10    Post subject:  

Hi William.

You can find and delete whiteout files in all boot method in /live/cow but doing this from your running system could have unpredictable results. I don't know what is the reason but with live-boot-2 I had similar strange experience after deleting whitout files in /live/cow

To test menu-openbox it is better to start with new save filder and keep mkjwmmenu package installed. I'm not sure changing the theme is enough but it will add jwm.tail needed for menu-openbox.
When I upload jwm-openbox deb on the site it will have mkjwmmenu as dependency and installing jwm-openbox will auto-install mkjwmmenu (if it is missing).
I made some tests in MintPup uninstalling and installing all menu packages and it works witout problems for me. After installing again mkjwmmenu the openbox-menu works well. I will test this more.

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 2 of 3 [34 Posts]   Goto page: Previous 1, 2, 3 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.1190s ][ Queries: 13 (0.0061s) ][ GZIP on ]