xlock is not installed by default on some distro's. (even if xorg is installed) Yet, xflock4 tries to use it if it could not use xscreensaver or gnome-screensaver, breaking the script. Imho, xflock4 should also try to see if xlock is installed before trying to use it. If xflock4 can find neither xscreensaver, gnome-screensaver or xlock, it should echo an error message on stderr. (and maybe a gtk error popup) stating it cannot work. Another approach would be stating xlock as a dependency of xflock4, but that would be dirty if the user has xscreensaver or gnome-screensaver. (In fact, xflock4 depends on either one of the 3 options, it's up to the user to decide. But I've never seen a package manager supporting a structure like that) See http://bugs.archlinux.org/task/11609
xflock4 should check the *running* screensaver (xscreensaver, gnome-screensaver and maybe kde equivalent, for crazy users). And fallback to xlockmore (which has nothing to do with xorg, btw). Packagers can then add the dependency they need (like xlockmore | xscreensaver | gnome-screensaver). But anyway dependency is not really the dev's problem. Cheers, -- Yves-Alexis
> And fallback to xlockmore (which has nothing to do with xorg, btw). If it's available! (That was my whole point, not everyone has it) Xflock4 should be prepared for when no screensaver/lock tool is available and show an error appropriately.
Patches welcome...
Created attachment 1868 patch for xflock4. generated with diff -Naur Here you go. It will display an error on stderr and with zenity (gtk error message) if available. I also took the liberty of improving the other shell code a bit.
Created attachment 1869 new patch with better exit status this time. Same as before, but now set proper exit status. generated with diff -Naur.
Suggest a fallback to 'xmessage' if zenity isn't installed.
Let's not exaggerate. Xmessage is very ugly. The user can always execute it on commandline and look at stderr. If there is a better way to show a gtk error in Xfce (without zenity) that would be better though, but that would probably mean a rewrite of xflock4 in C. Don't think that's worth it.
(In reply to comment #2) > > And fallback to xlockmore (which has nothing to do with xorg, btw). > > If it's available! (That was my whole point, not everyone has it) Xflock4 > should be prepared for when no screensaver/lock tool is available and show an > error appropriately. I'd say, if $user don't have any locking stuff, we don't give a shit. It'll fail, but eh, that's normal. (In reply to comment #7) > Let's not exaggerate. Xmessage is very ugly. The user can always execute it > on commandline and look at stderr. > If there is a better way to show a gtk error in Xfce (without zenity) that > would be better though, but that would probably mean a rewrite of xflock4 in C. > Don't think that's worth it. If warning $user, you should take care of really warning him. Either you do it completely or you don't to it at all. My 2 cents.
(In reply to comment #8) > (In reply to comment #2) > > > And fallback to xlockmore (which has nothing to do with xorg, btw). > > > > If it's available! (That was my whole point, not everyone has it) Xflock4 > > should be prepared for when no screensaver/lock tool is available and show an > > error appropriately. > > I'd say, if $user don't have any locking stuff, we don't give a shit. It'll > fail, but eh, that's normal. I hope you're joking. xflock4 comes with Xfce, so users expect it to work and not to break. They expect to have locking functionality or at least to be given instructions on how to get what they want.
(In reply to comment #9) > I hope you're joking. No I'm not. And I'm not interested in trolls on bug reports either. > xflock4 comes with Xfce, so users expect it to work and > not to break. Sure > They expect to have locking functionality or at least to be > given instructions on how to get what they want. Well, Xfce doesn't provide any locking capability by itself, they rely on something else. If the user uses a distribition, it's the packager role to provide the correct locking stuff. If using tarballs, installer or svn, I guess $user is able to find the required info by himself. I'm not against warning the user, I just don't think it's a good idea in that case. Document that xflock4 needs (obviously) a locking utility, document what it needs (*screensaver, xlockmore). But don't bother him.
Should be fixed in master.