Light-Debian-Core-Live-CD-Wheezy + Porteus-Wheezy

For talk and support relating specifically to Puppy derivatives
Message
Author
User avatar
saintless
Posts: 3862
Joined: Sat 11 Jun 2011, 13:43
Location: Bulgaria

#2061 Post by saintless »

Hi, Fred.
Yes it works for root and if it was not then we have a problem. This will leave root with option to refresh-menus manual :)
At first I thought to add at the end:

Code: Select all

/opt/bin/mk-jwm.menu
jwm -reload
but no need to do it. Here is the current update-menus configuration for mk-jwm.menu:
(folder-changes is renamed to debmenu-changes)
/opt/bin/update-menus is symlink to /opt/bin/menu-puppy
/opt/bin/menu-puppy content:

Code: Select all

#!/bin/sh

sudo sh -c "ln -f -s /opt/bin/menu-puppy /opt/bin/update-menus; /opt/bin/debmenu-changes"

/opt/bin/refresh-menus
/opt/bin/refresh-menus content:

Code: Select all

#!/bin/sh

if [ -n $SUDO_USER ]; then
su - $SUDO_USER -c '/opt/bin/mk-jwm.menu && jwm -reload'
else
user=`echo $XAUTHORITY | sed -e 's,.*/home/,,' -e 's,/.Xauthority.*,,'`� � 
su - $user -c '/opt/bin/mk-jwm.menu && jwm -reload'
fi
installing and uninstalling w3m with (apt-get install and apt-get purge) auto adds and auto removes menu entry from user and root account.

I think this is the fix we need.

Edit: Fred - do you see � � in the last code :) It is Dillo copy paste issue. Mystery solved.

Toni
Last edited by saintless on Sat 29 Mar 2014, 21:01, edited 1 time in total.

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

#2062 Post by saintless »

mcewanw wrote:Rather than changing the fine program could you just tell me the best way to change Scale into Stretch (or do I need to manually edit text file ~/.wallpapers/wallpapers.lst and then restart?)
William,
Terry is right and GUI option to use Stretch is working. Here is how to do it. I also did not notice it works this way till now.
Open Wallpapers GUI and remove all pictures from Remove button. Then set Stretch and add first pictire. It will be set to stretch. Add the rest as Stretch this way or choose Scale, Tile, Center for each one before adding the picture with Add button.

Toni

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

#2063 Post by mcewanw »

fredx181 wrote:Hi Toni
Fred, it seems it is exactly what we need. Just quick tested but it works for puppy user and root without errors. I will test it more in the next days creating another user.
OK, great!, but strange..are you sure it works for root also?

Fred
I think it may also work for root user because the following command probably works even if user variable is empty:

su - $user -c '/opt/bin/mk-jwm.menu && jwm -reload'

The only issue, as you mention Fred, would be for the case where a user didn't have home directory in /home

My otherwise not so elegant suggestion of temporarily storing $USER to /tmp or similar doesn't have that issue. i.e.
EDIT:

Code: Select all

mkdir -p /tmp/${USER};echo $USER > /tmp/${USER}/user

followed by:

user=$(cat /tmp/${USER}/user)
and then using that user value per Fred's code:

Code: Select all

#!/bin/sh
user=$(cat /tmp/${USER}/user) 
su - $user -c '/opt/bin/mk-jwm.menu && jwm -reload'
Last edited by mcewanw on Sat 29 Mar 2014, 21:35, edited 3 times in total.
github mcewanw

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

#2064 Post by saintless »

mcewanw wrote:
fredx181 wrote:The only issue, as you mention Fred, would be for the case where a user didn't have home directory in /home
We have debian-menu untouched as back-up option for cases like that.
Perhaps will be good to include menu button for manual menu update pointing to back-up script with this content as option?

Code: Select all

/opt/bin/mk-jwm.menu
jwm -reload

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

#2065 Post by mcewanw »

saintless wrote: Edit: Fred - do you see � � in the last code :) It is Dillo copy paste issue. Mystery solved.

Toni
Yes, that's the charset=iso-8859-1 versus UTF-8 issue I mentioned before. Same thing happens if copying from iceweasel to Geany. You can see the murga-forum uses charset=iso-8859-1 by looking at the webpage Source and Geany setup for UTF-8
github mcewanw

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

#2066 Post by saintless »

mcewanw wrote:My otherwise not so elegant suggestion of temporarily storing $USER to /tmp or similar doesn't have that issue. i.e.
EDIT:

Code: Select all

mkdir -p /tmp/${USER};echo $USER > /tmp/${USER}/user

followed by:

user=$(cat /tmp/${USER}/user)
and then using that user value per Fred's code.
William, it is not very clear for me how exactly to make this work.
I guess just adding the lines in the begining of /opt/bin/refresh-menus?
If you can test it and it works the same way for user and root it is good to have it included in DebianDog for testing or replacement.

Toni

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

#2067 Post by mcewanw »

saintless wrote:
mcewanw wrote:My otherwise not so elegant suggestion of temporarily storing $USER to /tmp or similar doesn't have that issue. i.e.
EDIT:

Code: Select all

mkdir -p /tmp/${USER};echo $USER > /tmp/${USER}/user

followed by:

user=$(cat /tmp/${USER}/user)
and then using that user value per Fred's code.
William, it is not very clear for me how exactly to make this work.
I guess just adding the lines in the begining of /opt/bin/refresh-menus?
If you can test it and it works the same way for user and root it is good to have it included in DebianDog for testing or replacement.

Toni
hmmm... I would test it but need the latest menu code on my system, which I don't have and am not sure how to add it. Like I say, I haven't been keeping up with Terry's and your own menu code updates.

But, yes, you just need to do this early on in the process:

Code: Select all

mkdir -p /tmp/${USER};echo $USER > /tmp/${USER}/user
followed by changing the code Fred suggested to:

Code: Select all

#!/bin/sh
user=$(cat /tmp/${USER}/user)
su - $user -c '/opt/bin/mk-jwm.menu && jwm -reload'
or more simply:

Code: Select all

su - $(cat /tmp/${USER}/user) -c '/opt/bin/mk-jwm.menu && jwm -reload'
github mcewanw

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

#2068 Post by fredx181 »

Hi William, Toni
The only issue, as you mention Fred, would be for the case where a user didn't have home directory in /home

My otherwise not so elegant suggestion of temporarily storing $USER to /tmp or similar doesn't have that issue. i.e.
EDIT:
Code:

Code: Select all

mkdir -p /tmp/${USER};echo $USER > /tmp/${USER}/user
followed by:

user=$(cat /tmp/${USER}/user)
Yes, should be better but has disadvantage because the line:

Code: Select all

mkdir -p /tmp/${USER};echo $USER > /tmp/${USER}/user
Doesn't fit inside my previous code because $USER is root.
It could maybe be executed at start of a user session e.g. in ~/.xsession.
The line "user=$(cat /tmp/${USER}/user)" can then replace the "user=.." line in my code.
saintless wrote:

Edit: Fred - do you see � � in the last code :) It is Dillo copy paste issue. Mystery solved.
...
Yes, that's the charset=iso-8859-1 versus UTF-8 issue I mentioned before. Same thing happens if copying from iceweasel to Geany. You can see the murga-forum uses charset=iso-8859-1 by looking at the webpage Source and Geany setup for UTF-8
Ah, so looks like a copy/paste murga-forum > geany issue so we need to watch out for that.

Fred

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

#2069 Post by fredx181 »

Hi All
Here's a different way of loading a sfs or squashfs module.
Not only activate the module but also run the corresponding apllication at the same time.
When running "portablesfs" a "application-portable" script will be created in the same folder as the module.
Running that will activate the module, run the command/application you entered and deactivate the module once the app has exited.
It's easier as it looks like when I try to explain this :)
See screenshots below.
There's a .template file in the zip which need to be in /opt/docs

Works on debiandog and on porteus-wheezy

EDIT: btw, looking at installing gimp through apt-get:

Code: Select all

After this operation, 258 MB of additional disk space will be used
Ough!!
The sfs by pemasu from here works fine AFAIK:
http://www.smokey01.com/pemasu/pet_packages-wheezy/

create-portable-sfs-script.zip:

Fred
Attachments
create-portable-sfs-script.zip
Create portable script to load sfs and run application at the same time
(3.3 KiB) Downloaded 132 times
portable-sfs-create.png
Create portable script
(107.64 KiB) Downloaded 136 times
gimp-portable.png
Running gimp-portable will run gimp directly.
(12.15 KiB) Downloaded 134 times
Last edited by fredx181 on Sat 29 Mar 2014, 23:41, edited 4 times in total.

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

#2070 Post by mcewanw »

fredx181 wrote:Hi All
Here's a different way of loading a sfs or squashfs module.
Debian/PorteusDog is certainly becoming the most flexible and user-configurable distribution around! :-)
github mcewanw

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

#2071 Post by sunburnt »

Fred; That`s basically how AppDir & RoxApp works, both types have all files in a dir.
The main run file or link is AppRun and the dir`s icon is .DirIcon ( hidden ).
Other than these 2 items, AppDir can be setup by any method.
amigo made some AppDir that compile the app in the AppDir dir. and set it up to run.
# Rox-Filer supports AppDir, clicking on the AppDir runs it, and Rox-Filer shows the dir`s icon.
I can not figure out how to get Xfe to do these 2 things. Anyone know how.?

William; As Toni said, you have to pick a wallpaper, set the display mode type and then Apply.
If you want just one wallpaper for all desktops, just select one and it should show for all.
NOTE: Having multiple wallpapers should not take more memory, only one is in ram at a time.


### I just realized I made a mistake in desktop.ctrl, I don`t think it will switch desktops if run=off.
# Try the first one I posted, but I think this one is needed for it to work. ( Sorry about that... :roll: )
.
Attachments
desktop.ctrl.zip
(1.11 KiB) Downloaded 132 times

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

#2072 Post by mcewanw »

sunburnt wrote: William; As Toni said, you have to pick a wallpaper, set the display mode type and then Apply.
If you want just one wallpaper for all desktops, just select one and it should show for all.
NOTE: Having multiple wallpapers should not take more memory, only one is in ram at a time.
Okay Terry, I understand it now. Thanks.
github mcewanw

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

#2073 Post by mcewanw »

Guys, could you test epdfview is working properly for you. I find that out of the box I'm having to press Zoom to Fit to make it display first time. If I put it to zoom 100% value the output is blank again. I don't have that issue in Puppy Precise. Not sure if it depends on the size (LxB) of the original pdf. The one that gives problem is displayed landscape (has longside horizontal by default).

EDIT: actually any zoom factor other than 100% makes it display okay with the pdf I've tried.

EDIT2: Just tried a different pdf file and it displayed fine at any zoom setting. Weird... Don't know why first one displays okay other than 100% (and also for any setting using epdfview in Puppy precise). No big deal though.
github mcewanw

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

#2074 Post by fredx181 »

Hi Toni
Toni wrote:/opt/bin/refresh-menus content:
Code:
#!/bin/sh

if [ -n $SUDO_USER ]; then
su - $SUDO_USER -c '/opt/bin/mk-jwm.menu && jwm -reload'
else
user=`echo $XAUTHORITY | sed -e 's,.*/home/,,' -e 's,/.Xauthority.*,,'`� �
su - $user -c '/opt/bin/mk-jwm.menu && jwm -reload'
fi
This will not depend on if the user's $HOME is in /home:

Code: Select all

#!/bin/sh

if [ -n $SUDO_USER ]; then
su - $SUDO_USER -c '/opt/bin/mk-jwm.menu && jwm -reload'
else
user=`echo $XAUTHORITY | sed -e 's,/[^/]*$,,' -e 's,.*/,,'`
su - $user -c '/opt/bin/mk-jwm.menu && jwm -reload'
fi
Changed the "user=.." line to extract the username in any case of where $HOME is.
Also when logged in as root the $user variable will be root.

Fred

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

#2075 Post by saintless »

fredx181 wrote:This will not depend on if the user's $HOME is in /home:

Code: Select all

#!/bin/sh

if [ -n $SUDO_USER ]; then
su - $SUDO_USER -c '/opt/bin/mk-jwm.menu && jwm -reload'
else
user=`echo $XAUTHORITY | sed -e 's,/[^/]*$,,' -e 's,.*/,,'`
su - $user -c '/opt/bin/mk-jwm.menu && jwm -reload'
fi
Changed the "user=.." line to extract the username in any case of where $HOME is.
Also when logged in as root the $user variable will be root.
Thank you, Fred!
I will use this one.
Works for user after running sudo apt-get install. Not tested proper for Synaptic yet.

The problem is all configurations do not work for manual refres-menus for user account. It asks for user password and then asks again for root password and then gives failure message.
I can create separate manual refresh-menus option to run debmenu-changes and different menu-puppy and refresh-menus script for user account.

Or we can use the configuration that works for root and needs manual type refresh-menus for user account only after using sudo apt-get. It uses the same scripts for user and root for manual refresh and auto-refresh menus after installin/uninstalling programs. No need from two separate script lines for manual and autorefresh menus.

Much options to consider ;)

Toni

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

#2076 Post by saintless »

fredx181 wrote:Here's a different way of loading a sfs or squashfs module.
Not only activate the module but also run the corresponding apllication at the same time.
When running "portablesfs" a "application-portable" script will be created in the same folder as the module.
Thank you, Fred!
Added next to SFS-Loader-new and SFS-Loader-old menu items.

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

#2077 Post by saintless »

Hi, William.

I need your help on this one. I remember you wrote you have some experience with XDM in the past.
XDM changes the PATH when is active and do not allow the system to read /etc/profile export lines. Not only for user but also for root.
I thought this is the only problem and adding the export lines from /etc/profile to /etc/environment will fix it. It did but it gives also secure bin paths for user account which is not right.
Unfortunately this is not the only problem. When XDM is active Synaptic does not work anymore with sudo. It needs su-to-root if xdm is active.
Reading XDM man pages it really changes the paths but I don't know why it creates this sudo not working issue.

Code: Select all

puppy@debian:~$ sudo synaptic
[sudo] password for puppy: 
No protocol specified

(synaptic:10524): Gtk-WARNING **: cannot open display: :0
puppy@debian:~$ 
We need to fix this problems for the beta.

What I have tested is full install of XDM and it behaves the same way.
There is /etc/init.d/xdm file which has PATH= line inside but changing the PATH there does not change anything. It seems something has to be configured for user and root paths in the files in /etc/X11/xdm folder.

You can test this problem with the last 01-v7.squashfs. Just use save file and delete the lines in /etc/envioronment
Check out then the path for user and root with echo $PATH to see the difference.

/opt/bin/xdm-stop will stop xdm and restore autologin as root after reboot. And everything is back to normal for user and root.
/opt/bin/xdm-start will activate xdm after reboot.

i also tried installing SLIM and it works OK without changing the PATH and /etc/profile is in use for user and root. Tested with empty /etc/environment
The problem with SLIM is after stopping SLIM and trying to autologin as root I can't get to X for user and root. I still think SLIM is unreliable and we should not use it but may be we I should try to make it work in separate sfs module to be tested as replacement of xdm.
BTW removing most of the themes for slim makes it two times smaller.

Toni
Last edited by saintless on Sun 30 Mar 2014, 17:48, edited 1 time in total.

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

#2078 Post by saintless »

Hi, Terry.
Installing e3 text editor makes 9 desktop files from this menu file content:

Code: Select all

?package(e3):needs="text" section="Applications/Editors"\
  title="e3em" command="/usr/bin/e3em"

?package(e3):needs="text" section="Applications/Editors"\
  title="e3vi" command="/usr/bin/e3vi"

?package(e3):needs="text" section="Applications/Editors"\
  title="e3pi" command="/usr/bin/e3pi"

?package(e3):needs="text" section="Applications/Editors"\
  title="e3ws" command="/usr/bin/e3ws"

?package(e3):needs="text" section="Applications/Editors"\
  title="e3ne" command="/usr/bin/e3ne"
e3ne is only one e3ne.desktop.
All others have .desktop working file + .desktop.desktop file which does not appear in the menu with this content inside for example e3ws.desktop.desktop:

Code: Select all

[Desktop Entry]
Type=Application
And e3ws.desktop:

Code: Select all

[Desktop Entry]
Type=Application
Terminal=true
Categories=Applications;Editors;
Name=e3ws
Exec=default_virtual-terminal -e /usr/bin/e3ws
Toni

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

#2079 Post by fredx181 »

Hi Toni
i also tried installing SLIM and it works OK without changing the PATH and /etc/profile is in use for user and root. Tested with empty /etc/environment
The problem with SLIM is after stopping SLIM and trying to autologin as root I can't get to X for user and root. I still think SLIM is unreliable and we should not use it but may be we I should try to make it work in separate sfs module to be tested as replacement of xdm.
I've been struggling with this also, the only thing that seemed to work was uninstalling slim to get working startx back.
But now after some experimenting I found workaround:
Simular to your xdm-stop, slim-stop:

Code: Select all

#!/bin/bash

[ "`whoami`" != "root" ] && exec gsu ${0}

insserv -r slim
mv /etc/X11/Xsession.d/20slim_locale /etc 2> /dev/null
cp -fr /etc/inittab-auto /etc/inittab
And slim-start:

Code: Select all

#!/bin/bash

[ "`whoami`" != "root" ] && exec gsu ${0}

insserv slim
#mv /etc/20slim_locale /etc/X11/Xsession.d # better leave this commented out
cp -fr /etc/inittab-noauto /etc/inittab
#service slim start # uncomment if you want slim started instantly
You'd expect in slim-start the copying back of 20slim_locale but better don't because startx stops working by that (in current session), slim works without that file AFAIK.
BTW, A great advantage of slim is that it has autologin supported. :)

Fred

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

#2080 Post by saintless »

Thank you, Fred!
If I can make it work well I will add it to DebianDog. I edited slim.deb to be less than 200 K from 1,2Mb. It has only one theme now with Linux-Village background. + dependencies it will add less than 1Mb uncompressed this way.
Here is the edited deb if you are interested:
http://smokey01.com/saintless/Fredx181/ ... 2_i386.deb
It will be nice to have SLIM working also.

Toni

Post Reply