>>     to do it (not using dbus however) and there's no race with
>>     DSME. It stays off until the touchscreen or key is pressed. Here's
>>     code that'll blank the screen:
>>     #include <fcntl.h>
>> #include <sys/ioctl.h>
>> #include <linux/fb.h>
>> int main(int argc, char **argv) {
>>     int fb = open("/dev/fb0", O_NONBLOCK);
>>     if (fb < 0) perror("Error opening /dev/fb0");
>>     if (ioctl(fb, FBIOBLANK, VESA_POWERDOWN) < 0) perror("Blanking error");
>>     close(fb);
>> }
>>
>
> But that's run as root, right? I need to be able to blank from
> userspace without root as a normal user.

    It works for me as a normal user but I no longer remember whether
    I had either added 'user' to the video group or otherwise changed
    the permissions on /dev/fb0 so that the user had extra
    permissions.
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers

Reply via email to