From: Daniel E. <dan...@go...> - 2006-04-25 17:21:05
|
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.) 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! 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. 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. 3) The big question: Where to put this? System service, X itself, gdm, addition to gnome-randr-applet, ddccontrol applet, whatever? The goal should be to make this as most "out of the box" as possible. Of course this requires to first get ddccontrol itself into distros :) 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. 5) Do you like the idea? :-) I probably forgot one issue or another, but that's enough for now anyway. I'll be glad to hear your opinions/suggestions/flames. Have fun! --Daniel |