*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: [1]
Print
Author Topic: Black and white with backlight  (Read 7291 times)

Black and white with backlight

Bastian
Guest
April 15, 2008, 11:33:08 AM

Hi,

I want to have the high resolution black and white screen and backlight. I had the line to type into terminal, but lost it when my MacBooks hard drive died. Can somebody help me out.

Thanks
Logged

#1 Re: Black and white with backlight

Tjelfe
Commenter

Posts: 22


April 15, 2008, 02:10:54 PM

Hey Bastian,

since the color is produced via hardware filter this would be impossible.
btw: The resolution is always 1200x900.

cu
T.
Logged

#2 Re: Black and white with backlight

Bastian
Guest
April 15, 2008, 06:41:04 PM

Found it!

ok, the resolution is always 1200x900 and the reflective mode (and its crispness) can't be used with backlight, still:

su
echo 1 > /sys/devices/platform/dcon/output

will put the screen in grayscale mode with the backlight on. This makes the screen less blurry and is great for reading pdf in bed. Using the screen brightness buttons turns it off again.

Bastian
Logged

#3 Re: Black and white with backlight

Ben
Contributor
*
Posts: 68


April 15, 2008, 10:57:39 PM

su
echo 1 > /sys/devices/platform/dcon/output

It works, but you have to switch away from the Terminal to see that it worked.

« Last Edit: April 15, 2008, 11:00:46 PM by Ben » Logged

#4 Re: Black and white with backlight

magnuan
Commenter

Posts: 7


April 16, 2008, 03:50:14 PM

Nice.
It seems to turn off some anti-aliasing filtres. Very usefull for viewing b/w line art.
Made some scripts for switching between modes:
Code:
#/bin/bash
iofile="/sys/devices/platform/dcon/output"
while read line; do cur_mode=$line; done < <(cat "$iofile")
if [ $cur_mode = "0" ]; then
        new_mode=1;
       echo Going B/W
else
        new_mode=0;
       echo Going Color
fi
echo $new_mode > /sys/devices/platform/dcon/output
To be able to run this script as non-root, I added this to /etc/rc.local
Code:
chgrp olpc /sys/devices/platform/dcon/output
chmod g+w /sys/devices/platform/dcon/output
I don't think this would be to much of a security risk (please let me know if you dissagree) Smiley
There still seems to be a lot of unused keys on the OLPC-keyboard, so untill it comes into better use, I mapped the "two-squares"-button to this script with xbindkeys
~/.xbindkeysrc
Code:
# Videomode (color/ BW)
 "/bin/bash /usr/bin/videomode"
 c:224
Where /usr/bin/videomode is a link to the script for switching modes.

Logged

#5 Re: Black and white with backlight

Tjelfe
Commenter

Posts: 22


April 17, 2008, 01:43:17 AM

Really nice! I didn't know that.
Thanks for sharing.

CU
T
Logged

#6 Re: Black and white with backlight

XOIOWA
Senior Contributor
**
Posts: 119



April 19, 2008, 07:18:37 PM

I'm not exactly a newbie... but I'm far from expert.

I'd love to to the keybindings as shown here, but I'm missing something.  I've tried, but even as root, I'm getting permission denied when I run /usr/bin/toggle_screen_color  (that's what I named my symlink)

Could you please provide more detail about the file permissions, and how to actually do the keybinding?

Thanks in advance,
Logged

#7 Re: Black and white with backlight

magnuan
Commenter

Posts: 7


April 20, 2008, 03:57:01 PM

Sounds strange.
Did the rc.local script work as intended?
Check:
Code:
ls -l /sys/devices/platform/dcon/output
Mine reads:
Code:
-rw-rw-r-- 1 root olpc 0 (file date) /sys/devices/platform/dcon/output
Are you able to switch modes manually with (both as olpc and as root):
Code:
echo 1 > /sys/devices/platform/dcon/output
What about the permissions for your script and symlink?

I am running "OLPC build update.1 703", haven't tested it on any other builds, but as long as echoing to .../dcon/output works, I can't see why the script shouldn't.

Logged

#8 Re: Black and white with backlight

XOIOWA
Senior Contributor
**
Posts: 119



April 21, 2008, 04:55:53 AM

I'm on build 656.

ls -l /sys/devices/platform/dcon/output
-rw-r--r-- 1 root root 4096 <date&time> /sys/devices/platform/dcon/output

I found out that I can change modes manually only as root, so, I must have missed something in the file permission there.  chmod g+w?  I guess I'm not familiar enough to know those arguments.  I'll have to check that later.

Logged

#9 Re: Black and white with backlight

XOIOWA
Senior Contributor
**
Posts: 119



April 23, 2008, 04:58:46 AM

I did some checking, and found that I had done the rc.local incorrectly.  So, I fixed that.  Now I can run my script as root, or as a user, but only if I'm in the same directory as the script, and I use this command:  ./toggle_screen_color

It doesn't seem to want to run from the symlink in /usr/bin.  Whenever I try that, I get a Permission Denied message, no matter if I'm root or user.

Any hints?
Logged

#10 Re: Black and white with backlight

magnuan
Commenter

Posts: 7


May 04, 2008, 03:48:58 PM

Try
> sudo chmod a+x /usr/bin/toggle_screen_color    (or the name of your symlink)
From what you write, this shouldn't be necessary, but it's worth a try.
Logged
Pages: [1]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 29
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 19
Total: 19