like xtrlock, slock and maybe alock
I think it is not good to restrict locking alternatives to a specific list of utilities. Xfce may have a default utility for xflock4, but user should be able to override the utility xflock4 uses. xflock4 could check for a configuration file setting or a custom script in certain location(s). one location under current user's home directory and one location for system-wide setting, if the former is not set.
What you can do is putting another xflock4 before in the PATH. Another solution would be to use an environment variable.
(In reply to comment #2) > What you can do is putting another xflock4 before in the PATH. Like in /usr/local/bin in Xubuntu; I had to log out and log in to make it work. > Another solution would be to use an environment variable. I suppose that does not help, if you don't change the xflock4.
Yes I meant using an env in the script.
(In reply to comment #4) > Yes I meant using an env in the script. I think it is more secure to create another instance of xflock4 like you told, or by just editing xflock4 script as superuser, if you want to use an alternative utility for screen locking.
To allow different users to use different locking method, a check for a custom script in $HOME could be done in the main script.
(In reply to comment #6) > To allow different users to use different locking method, a check for a custom > script in $HOME could be done in the main script. But that would pose a risk since regular user could execute any regular command by xflock4 then. Using an environment variable token to choose from a limited set of utilities would be safer, I think.
Created attachment 2254 diff file for the rewrite (In reply to comment #0) > like xtrlock, slock and maybe alock I tried slock that made my computer screen go crazy and alock that I could not use (in Xubuntu 8.10). However, I added xtrlock as a new alternative. Environment variable SCREEN_LOCK_UTILITY is used for choosing preferred utility (in the proposed patch). The variable should be initialized and exported somewhere. A distribution should have the respective package (or xlockmore or xlockmore-gl for xlock) installed together with Xfce.
Created attachment 2255 script that does not stop control I modified the script so that daemon-less lockers don't keep the script waiting until they exit. The name of the environment variable changed to DESKTOP_LOCK_UTILITY.
(In reply to comment #8) > I tried slock that made my computer screen go crazy and alock that I could not > use (in Xubuntu 8.10). However, I added xtrlock as a new alternative. I would withdraw xtrlock for now: It does not always lock when launched by a keybinding (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=325613). I found out that it does not always lock even if it was launched from a script and no key was pressed.
We can't add support for every exotic screen locker out there. I will try to see if I can implement something for the user to enter a custom command as screen locker.
(In reply to comment #11) > We can't add support for every exotic screen locker out there. I will try to > see if I can implement something for the user to enter a custom command as > screen locker. Another solution would be to ditch xflock4 completely and use xdg-screensaver which has more or less the same purpose (no idea if it works fine though).