woofCE /etc/windowmanager can be invalid

Please post any bugs you have found
Post Reply
Message
Author
williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

woofCE /etc/windowmanager can be invalid

#1 Post by williams2 »

if /etc/windowmanager is invalid and does not point to a valid executable file (this can happen from a typo when starting xwin from the connsole, e.g.

Code: Select all

xwin jwm
xwin jwn
xwin JWM
xwin icwm
or it might get corrupted installing something. Anyway, if /etc/windowmanager is invalid .xinitrc will start X using the default wm, jwm. It does NOT fix /etc/windowmanager. wmexit still works properly, because after failing to kill `cat /etc/windowmanager` it then explicitly kills jwm, which should succeed.

But other software might use /etc/windowmanager and assume it is correct, (e.g. remasterpup2) which could cause problems. I think:

1) the code in .xinitrc that checks the validity of /etc/windowmanager should be moved to xwin

2) xwin should check the validity of /etc/windowmanager

3) xwin should display an appropriate error message (dialog might get more attention.)

4) optionally, xwin could place a copy of the error message in $HOME, something like that.

5) it should offer a choice to exit to allow the user to start xwin with a valid wm name, or wait 30s and allow xwin to automatically fix /etc/windowmanager with the default wm (not necessarily jwm.)

There are many ways to do things. I think /etc/windowmanager should be checked AND fixed by the software.

See MochiMoppel's posts here.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#2 Post by disciple »

Hmmm.
The way you describe it, it sounds like it is already a nice foolproof system which "just works", even compensating for user error.
So I'm inclined to think most of what you suggest would just be unnecessary complexity. Unless you can identify a real problem it would solve?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#3 Post by musher0 »

Hello, williams2.

Sorry for being so frank, but your question comes out of science-fiction.

The last three lines of /root/.xinitirc -- if you have not touched it -- are:

Code: Select all

which $CURRENTWM && exec $CURRENTWM
[ -x $CURRENTWM ] && exec $CURRENTWM
[ "$desktop" = "rox" ] && exec jwm
Push comes to shove, anything happens,
a mouse eats file /etc/windowmanager thinking it is cheese, :twisted:
or you're out in the cold in the Great White North, there is ice on your keyboard and
your fingers slip typing icwm instead of icewm, jwm gets loaded. Big deal.

If your chosen WM is icewm and you did a typo, you open a console and re-type

Code: Select all

echo icewm > /etc/windowmanager
Problem solved.

disciple is right, no need for fancy preventive or guessing code.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#4 Post by MochiMoppel »

musher0 wrote:Problem solved.
Image

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#5 Post by williams2 »

There is no bug here, of any kind, as I was trying to explain to MochiMoppel here.
most likely it is this bug.
I doubt that this will ever be fixed properly. The whole trouble started with this post back more than 12 years ago and the unfortunate "all implemented" response by BK.
There is no bug, just features. If /etc/windowmanager is invalid, Puppy starts automatically with jwm. I think that is a good thing. I like that code, it seems to be well thought out. I think that it does not fix /etc/windowmanager intentionally, partly so you can check what was wrong. For example, a wm pet package might have a bug and damage /etc/windowmanager, looking in the file would help debugging.

I do not agree with MochiMoppel here but I can see why it might be a good thing to actually fix the file. There is some software that uses /etc/windowmanager, and most or all of them assume that the file is valid. For example, remastering scripts. This might cause bugs to occur.

I think Puppy would be slightly more robust if /etc/windowmanager is checked AND fixed. Maybe change this:

Code: Select all

which $CURRENTWM && exec $CURRENTWM
[ -x $CURRENTWM ] && exec $CURRENTWM
[ "$desktop" = "rox" ] && exec jwm
to this:

Code: Select all

which $CURRENTWM && exec $CURRENTWM
[ -x $CURRENTWM ] && exec $CURRENTWM
echo -n jwm > /etc/windowmanager
[ "$desktop" = "rox" ] && exec jwm
This would prevent you looking in /etc/windowmanager for debugging info, but the contents of the file could be saved in an error message.

And this assumes that jwm is actually in each and every Puppy that runs this code. It might be safer to have a default wm somewhere, rather than assuming it is jwm. Like this:

Code: Select all

test -f /etc/windowmanager-default || cp /etc/windowmanager /etc/windowmanager-default
which would copy the file once when Puppy first runs. Or you can assume jwm is in every Puppy.

It's not a question of a bug, it's what features you want to have. Fixing /etc/windowmanger automatically might help other scripts have fewer bugs.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

Double. Sorry.
Last edited by musher0 on Mon 04 Mar 2019, 01:52, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#7 Post by musher0 »

Hi williams2.

Yes of course .xinitrc needs improvement. Mistfire and I gave it a go way back when,
and we came up with something pretty solid, as I remember it. But it was received by
some on this board as if it were a Frankestein.

(Back in a few minutes with the reference. I have to do a search.) Here it is:
http://murga-linux.com/puppy/viewtopic. ... 242#979790.
Perhaps read the entire thread to get the context? You'll see that mistfire's original is
(still?) used in the LXPups. I ask "still?" because that thread is 14 months old. Perhaps
someone can confirm.

As to protecting, etc., the /etc/windowmanager file tself, I do not see it as necessary.
I tend to think of that file as strictly data.

TWYL.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#8 Post by williams2 »

Thanks for the link musher0, I will read that.

It's just that I was trying adwm and I needed to run it from a script, which means the wmexit bug prevents X from shutting down, which might have been MrDuckGuy's problem so I thought this time I would whine about it, for the benefit of all users.

And something MochiMoppel said made me think, yes, maybe it would be good if Puppy automatically fixes the configuration data in /etc/winmanager.

Not that I expect anything to happen. But I did try.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#9 Post by musher0 »

Thanks for the context, williams2.

adwm? Do you have a URL to its home page? Is it new?
I love exploring "unknown" WM's!

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#10 Post by williams2 »

adwm is a fork of Echinus.

https://github.com/bbidulock/adwm

If it doesn't compile and wants reallocarray - well, it should compile, but I had to:

download zip from git

edit configure.sh:
change:
CPPFLAGS="-D_FORTIFY_SOURCE=2"
to:
CPPFLAGS="-D_FORTIFY_SOURCE=2 -D_GNU_SOURCE"

then:

./autogen.sh
./configure
make
make install

I got it to compile in bionicpup64-7.9.7 but not in xenialpup64-7.5

It's not clear in the documentation, but A+Tab is set to the same thing as A+j. I set this to make A+Tab do the same thing as Echinus:
Adwm*viewprevtag: A + Tab

If you want to change the default number of workspaces you need to edit /usr/share/adwm/themes/Default/themerc

Adwm*tags.number: 12

There are some bugs. I opened Geany in ws1, moved it to ws5, then pressing ctrl+F opens a search box in ws1 instead of ws5 where Geany is.

And it crashes sometimes, which kills X, so I'm running adwm from a script:

Code: Select all

while true
do
date >> /root/adwm-start.log
date >> /root/adwm.log
adwm "$@" >> /root/adwm.log 2>&1
sleep 10
done
By the way, bbidulock seems to be a dev at Arch.

And adwm has "full support for Window Maker dock applications in floating and tiling modes"

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#11 Post by musher0 »

williams2 wrote:adwm is a fork of Echinus.

https://github.com/bbidulock/adwm
(...)
Thanks, williams2.

I'm a great fan of echinus. Will look adwm up.

TWYL.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#12 Post by musher0 »

Thanks, williams2.

adwm discussion cont'd here, so as not to burden this thread.

See you there, hopefully.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply