[Kde-kiosk] Quota messages

Martijn Klingens kde-kiosk@mail.kde.org
Thu, 10 Oct 2002 22:08:39 +0200


On Wednesday 09 October 2002 18:53, Janyne Kizer wrote:
> I have quota's set up on my user's home directories.  They get a warning
> if they login via SSH and they are approaching their quota limit but not
> if they log onto KDE.  The problem is, of course, that if they go over
> quota, they cannot log into KDE at all.  Since most users log in via KDE
> only, this is somewhat problematic.  Is there a way to pass this warning
> to KDE?  Thanks!

I hoped that someone else would answer here, because I only have some ideas 
and no clear answer, but I'm staring into a remarkable silence here.

So here comes my feeble attempt:

1. try if using KNotify is an option. You can call KNotify via dcop and AFAIK 
you can create custom events that can show e.g. a messagebox on the screen. 
With KDE 2.x and 3.0 you can set $DISPLAY to the user's display and start 
dcop from a shell without X, which might even work automagically if you don't 
set $DISPLAY. For the upcoming KDE 3.1 I added some enhancements to the 
commandline dcop client that allow you more fine-grained control to where you 
send the message:

dcop --all-users --all-sessions [application] [interface] [method] [params]

broadcasts to all available DCOP servers as long as you can read the user's 
home dir for the .Xauthority file. For most non-NFS systems root should be 
able to do this, so critical events from cron jobs and root daemons can be 
trapped and passed on to the active GUIs (like reboot warnings, or more 
generally any 'wall', should be quite useful for your application server 
setup I hope).

dcop --user $USER --all-sessions [...]

sends to only one user, but to all sessions (if any), so you don't have to 
know $DISPLAY or $DCOPSERVER/$ICEAUTHORITY and you can send to users that are 
logged in more than once.

dcop --user $USER --list-sessions

doesn't call, but lists the active sessions that dcop can find. Should be 
useful from shell scripts to find the right session, although I don't know if 
the naming is always as reliable as it is here, where the file name for the 
DCOP server is simply ".DCOPserver_${hostname}__${displaynumber}". If it is, 
this should be fairly usable.

2. use KDialog. This application is available somewhere for KDE 2, and will be 
part of KDE 3.1. It allows simple dialogs and messageboxes to be called from 
shell scripts.

3. I seem to remember that for a simple message box there's an other option, 
but for the time of my live I can't find the name of that command again.

4. Write your own simple KDE app that either takes command line args or 
provides a dcop interface.

I hope this helps, it's not the quality level Waldo's replies usually have, 
but at least it's better than nothing.
-- 
Martijn