From: Nicolas B. <ni...@bo...> - 2006-04-25 21:12:54
|
Hi Daniel, First, thank you for your tool, looks very nice, even though I can't test it. Daniel Elstner wrote: > Hello, > > first, let me thank you for this great piece of software. I own a > Samsung SyncMaster 970p and thus would not be able to change the monitor > setup at all without a tool like ddccontrol. > > Addicted to technical gimmicks as I am, I obviously also wanted to make > use of the pivot functionality of my flat panel. But even with a simple > graphical tool like gnome-randr-applet, having to change the rotation > setting of the X screen manually each time is highly annoying. (Just > try using your mouse with the panel already rotated... Go figure.) Quite funny .-) > Well, the result of the hacking frenzy that followed is attached to this > mail. Simply by diff'ing the output of two ddccontrol runs, I found the > control I need to listen for. I then put together a tiny C program that > uses libddccontrol to poll the monitor every second, and XRandR to set > the screen rotation whenever the panel rotation changed. This is just a > proof of concept for now as you have to start the tool manually and keep > it running all the time. Nonetheless it works quite well on my system. > > I'd be glad if interested people could pick up this piece and have some > fun with it, and share the results on this list. Simple build and usage > instructions are to be found at the top of the source file. Thank you! It will certainly happen. > However, for a proper solution, a couple of questions need to be > considered first: > > 1) Is the control index 0xF8 standardized in any way? If not, it might > be necessary to add an entry to ddccontrol's monitor database. No, it is not a standard (values in this range are vendor-specific). You're right, an entry must be added in the database. However, there is no support for read-only controls right now, however this is something I wanted to add so I'll work on it. > 2) Is there a better way than polling? I already tried to keep the > overhead at a minimum by reducing the work that is done periodically. > The bash script I initially wrote called ddccontrol every second, which > caused simply unacceptable overhead for something running in the > background. With the current code there are no CPU usage spikes > noticeable anymore; but nonetheless, it'd be cool if the polling could > be avoided altogether. No. I'm almost certain DDC/CI doesn't support interrupts or anything like this which could avoid polling. However, as I never had the specifications, we could have surprises .-) > 3) The big question: Where to put this? System service, I don't think it is possible, as you have to attach the application with an X server, which probably isn't running when the service starts. X itself, gdm, > addition to gnome-randr-applet, I don't think Xorg, or Gnome, will accept to depend on ddccontrol .-) ddccontrol applet Could be an idea, but ddccontrol applet depends on Gnome. I think it would be a good idea to have support for other window managers, as your application doesn't need user interaction. , whatever? The goal > should be to make this as most "out of the box" as possible. gdm support running scripts even before logging in (see subdirectories in /etc/X11/gdm/), so I think it would be a good place to start your program. Maybe there is also ways to get an application started at the same time as X. Of course > this requires to first get ddccontrol itself into distros :) This depends on maintainers. On Gentoo, as the work is really small, sometimes I make the ebuilds, sometimes others do. Of course, integration in other distributions would be very nice, but as I don't use them I won't do the work. > 4) Minor one: I think libddccontrol should install a .pc file for use > with pkg-config, in order to ease the burden of linking to it. Ok I don't think it is an essential feature, and as I don't have much time, I won't on it for now. (Of course if you want to provide a patch you're welcome .-)) > 5) Do you like the idea? :-) Yes a lot!! I would like to get it integrated into the main ddccontrol package, so, if you agree, please send me your SourceForge id some I will give you developer CVS access. (We should then discuss the name we want to give to your app, and discuss about coding guidelines (for example, we use tab identation in ddccontrol)) > I probably forgot one issue or another, but that's enough for now > anyway. I'll be glad to hear your opinions/suggestions/flames. Thank you very much, Best regards, Nicolas |