Author Topic: Advanced tips for the Samsung NC10  (Read 3861 times)

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5521
  • PCLinuxOS: A revolution in personal computing
Advanced tips for the Samsung NC10
« on: November 09, 2009, 09:45:56 AM »
I have had to put this stuff here because messing around with some of the stuff this requires is not advisable. Before you do any of this you should read and do the stuff in the following topic:

http://www.pclinuxos.com/forum/index.php/topic,64666.0.html

You will also need install "xbindkeys" which has recently been added in synaptic. Keytouch does not work correctly on this machine, on my one it causes the "A" key not to work, amongst other problems.
« Last Edit: November 09, 2009, 09:48:44 AM by davecs »
PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5521
  • PCLinuxOS: A revolution in personal computing
Re: Advanced tips for the Samsung NC10
« Reply #1 on: November 09, 2009, 12:33:29 PM »
Firstly, to get your backlight controls working. Rather than have the Fn-F5 key toggle between on and off, I have made it step between 4 settings, 0 - 1/3 - 2/3 - 1. This enables you to pick different settings for outside lighting conditions, varying between different levels of power saving. Up/Down in small steps is accomplished on the Fn-Up/Down keys.

Note that this script works at system level, so you can be sure that the LED power is being reduced, I am concerned that some of the commands that work through X may just darken the contents of the screen.

Here is a script I wrote, it's called s-backlight and I have placed it in /usr/local/bin

Code: [Select]
#/bin/bash
#quick and dirty by davecs

#tail r to rotate between 0,85,170,255
#tail s n to set absolute n
#tail number to increment/decrement brightness

#get existing brightness
BRTNESS=$((0x0`setpci -s 00:02.1 F4.B`))

if [ "$1" = "r" ] ; then

   #rotate between 0 > 85 > 170 > 255
   if [ "$BRTNESS" = "255" ] ; then
      BRTNESS2=0
   else
      Y=$(( $BRTNESS / 85 ))
      Y=$(( $Y + 1 ))
      Y=$(( $Y * 85 ))
      BRTNESS2=$Y
   fi

else

   # just set to figure supplied
   if [ "$1" = "s" ] ; then
      BRTNESS2=$2
   else

   #set increment in tail of command, maybe 5 for up, -5 for down
   BRTNESS2=$(($BRTNESS + $1))

      #block overflows
      if [ $BRTNESS2 -gt 255 ] ; then
           BRTNESS2=255
      fi

      if [ $BRTNESS2 -lt 0 ] ; then
         BRTNESS2=0
      fi
   fi
fi

setpci -s 00:02.1 F4.B=`printf '%x' $BRTNESS2`

Don't forget to right-click on it in Konqueror or Dolphin super user mode, and make it executable.

The problem here is that setpci is only able to change values if run as root. So we need to be able to run it, without a password, using sudo. The way to do this is to add this line at the end of the file /etc/sudoers

ALL localhost = NOPASSWD: /usr/local/bin/s-backlight

It is recommended that you use the command "visudo" in a terminal as root to make this change. visudo will refuse to save an invalid sudoers file.

In order to be able to bind commands to certain keys, you need to have xbindkeys running. When you run this, it has a file ~/.xbindkeysrc as its setup file, all key binding declarations have to be in that file.

Here is my .xbindkeysrc file: (you only need to copy the lines not starting with # )

Code: [Select]
# For the benefit of emacs users: -*- shell-script -*-
###########################
# xbindkeys configuration #
###########################
#
# Version: 1.8.3
#
# If you edit this file, do not forget to uncomment any lines
# that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# To specify a key, you can use 'xbindkeys --key' or
# 'xbindkeys --multikey' and put one of the two lines in this file.
#
# The format of a command line is:
#    "command to start"
#       associated key
#
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier:
#   Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
#   Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#

# The release modifier is not a standard X modifier, but you can
# use it if you want to catch release events instead of press events

# By defaults, xbindkeys does not pay attention with the modifiers
# NumLock, CapsLock and ScrollLock.
# Uncomment the lines above if you want to pay attention to them.

#keystate_numlock = enable
#keystate_capslock = enable
#keystate_scrolllock= enable

"sudo /usr/local/bin/s-backlight 10"
  m:0x0 + c:212

"sudo /usr/local/bin/s-backlight -10"
  m:0x0 + c:101

"sudo /usr/local/bin/s-backlight s 255"
  m:0x4 + c:212

"sudo /usr/local/bin/s-backlight s 160"
  m:0x4 + c:101

"sudo /usr/local/bin/s-backlight r"
  m:0x0 + c:159


##################################
# End of xbindkeys configuration #
##################################

And to make xbindkeys run when you start your session, you need to amend the file (14_setkeys) you made earlier at ~/.kde4/Autostart to look like this:

Code: [Select]
#/bin/sh
xmodmap ~/.Xmodmap
xbindkeys

If you log out and in, you can check this is all working.
« Last Edit: November 09, 2009, 03:31:32 PM by davecs »
PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

flux

  • Guest
Re: Advanced tips for the Samsung NC10
« Reply #2 on: November 09, 2009, 12:56:56 PM »
Just an idea: What about including a RPM with all needed programs (xbacklight, xbindkeys) and special configurationfiles in a standard PCLinuxOS-2009.2 which the NC 10 user can choose at the bootprompt of the livesystem with a cheatcode

NC10

?

I did this for 4 several netbooks and the eeePCs with my last remaster. 5 cheatcodes and 5 different configurations for the 4 netbooks (NC 10, LG X110, A110, MSI Wind) and the eeePCs.

flux.

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5521
  • PCLinuxOS: A revolution in personal computing
Re: Advanced tips for the Samsung NC10
« Reply #3 on: November 09, 2009, 01:35:22 PM »
Just an idea: What about including a RPM with all needed programs (xbacklight, xbindkeys) and special configurationfiles in a standard PCLinuxOS-2009.2 which the NC 10 user can choose at the bootprompt of the livesystem with a cheatcode

NC10

?

I did this for 4 several netbooks and the eeePCs with my last remaster. 5 cheatcodes and 5 different configurations for the 4 netbooks (NC 10, LG X110, A110, MSI Wind) and the eeePCs.

flux.

a good idea if any RPM builders fancy it?
PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5521
  • PCLinuxOS: A revolution in personal computing
Re: Advanced tips for the Samsung NC10
« Reply #4 on: November 09, 2009, 01:48:06 PM »
The Fn-F9 key is meant for wireless on/off, however, what would you be doing with a netbook if not connecting to the net? The problem is actually that you have taken the netbook to a new place and need to log into a wireless service.

Well this is not too hard.

You need to add this line to /etc/sudoers (bearing in mind about visudo as I mentioned above):

ALL localhost = NOPASSWD: /usr/sbin/drakroam

EDIT only if you used the advanced method for backlight:
or you can combine the two commands onto one line:

ALL localhost = NOPASSWD: /usr/sbin/drakroam , /usr/local/bin/s-backlight


and add these two lines to .xbindkeys

Code: [Select]
"sudo /usr/sbin/drakroam"
  m:0x0 + c:243

Log out, log in, and Fn-F9 will produce the dialogue for choosing wireless signals.

« Last Edit: November 17, 2009, 09:02:59 AM by davecs »
PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

Offline critter

  • Full Member
  • ***
  • Posts: 220
Re: Advanced tips for the Samsung NC10
« Reply #5 on: November 11, 2009, 01:59:10 PM »
davecs
great idea using sudoers and drakroam, much more suitable for a netbook than my little script I posted somewhere.
I've adopted the idea but have an icon on my panel rather than mapping to the fn-key. Just suits me that way.
Thank you. :)

Still can't get the brightness working on my n510 yet though  :(  (still, not a show stopper)
Motherboard   Gigabyte Z68X-UD3H-B3
Hard Drives      2 x Maxtor STM350032 500GB SATA
Memory      16GB RAM
Processor      Intel core i5 3.30GHz
Video         nVidia GeForce GT430
Sound      HDA Intel PCH
PCLinuxOS          KDE

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5521
  • PCLinuxOS: A revolution in personal computing
Re: Advanced tips for the Samsung NC10
« Reply #6 on: November 15, 2009, 04:19:19 AM »
davecs
great idea using sudoers and drakroam, much more suitable for a netbook than my little script I posted somewhere.
I've adopted the idea but have an icon on my panel rather than mapping to the fn-key. Just suits me that way.
Thank you. :)

Thanks, I've used that method on laptops/netbooks generally.

Quote
Still can't get the brightness working on my n510 yet though  :(  (still, not a show stopper)

I'm waiting for an rpm for xbacklight to appear in the repos. I will be able to then do a simpler version of backlight control which will go in the "normal" area, it won't need to be in "advanced". What's more it will interact better with Battery Monitor, the technique I've used here does not (though it's a lot faster!)
PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

Offline rick0612

  • Sr. Member
  • ****
  • Posts: 258
  • The only dumb question is the one not asked.
Re: Advanced tips for the Samsung NC10
« Reply #7 on: November 16, 2009, 07:13:01 AM »
Hi davecs,

I also have an NC10 and am trying your tweaks but with problems.

The keys working are:
Fn - ESC
Fn - F2
Fn - F6
Fn - Vol up and down

The keys not working are:
Fn - F5
Fn - Brightness up and down
Fn - F9

OS is MiniMe 2009.

I went through the steps from the beginning three times but can't find my error. I'm sure it's something dumb. Can you point me in the right direction?

On another subject; the only reason I have Windows on this machine is to run the BIOS updates. I found this link that takes care of that problem:

http://www.voria.org/forum/viewtopic.php?f=3&t=248

I haven't actually tried it yet but it seems as though it should work.
He's using a DOS image but I have a Freedos USB stick.

Rick.
Packaging rig: Averatec 2573 /12.1" screen /2.0GHZ /3GB RAM /120GB SSD /Minime 2012.12

Daily rig: Alienware X51 /23" monitor /Windows 7 host /KDE VBox client

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5521
  • PCLinuxOS: A revolution in personal computing
Re: Advanced tips for the Samsung NC10
« Reply #8 on: November 16, 2009, 04:35:10 PM »
@ Rick

I made an error in reply #5 in the NC10 thread in the Netbook Hardware section, telling you to put the 14_setkeys file in ~/.kde/Autostart whereas it should be ~/.kde4/Autostart. It is now corrected and may be the reason why certain keys don't work.
PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

Offline rick0612

  • Sr. Member
  • ****
  • Posts: 258
  • The only dumb question is the one not asked.
Re: Advanced tips for the Samsung NC10
« Reply #9 on: November 16, 2009, 05:10:03 PM »
I caught that and put the file 14_setkeys in ~./kde4/Autostart, so that's not it.
Just went through everything again. It must something really obscure.

Did you get a chance to check out that link?

Rick.
Packaging rig: Averatec 2573 /12.1" screen /2.0GHZ /3GB RAM /120GB SSD /Minime 2012.12

Daily rig: Alienware X51 /23" monitor /Windows 7 host /KDE VBox client

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5521
  • PCLinuxOS: A revolution in personal computing
Re: Advanced tips for the Samsung NC10
« Reply #10 on: November 17, 2009, 09:12:20 AM »
I've read it. I have everything working, I'm not touching the BIOS!!
PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

Offline Joble

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6804
  • USA - Mountain Time
Re: Advanced tips for the Samsung NC10
« Reply #11 on: November 17, 2009, 09:45:29 AM »
Did you make the file 14_setkeys executable?
« Last Edit: November 17, 2009, 09:49:46 AM by Joble »
Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System

Offline Ɗα√ϵς§

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5521
  • PCLinuxOS: A revolution in personal computing
Re: Advanced tips for the Samsung NC10
« Reply #12 on: November 17, 2009, 11:11:11 AM »
Did you make the file 14_setkeys executable?

That's a good point, though if it isn't, won't it open with kwrite instead of executing?
PCLinuxOS has no wealthy sponsors and can only survive with your donations! Don't wait it might be too late.

Running PCLOS on Athlon II/250 with 2Gb Ram using ASUS M2N68-AM Plus Mobo with Nvidia GF7600GT graphics, and Samsung NC10 Netbook

Offline Joble

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6804
  • USA - Mountain Time
Re: Advanced tips for the Samsung NC10
« Reply #13 on: November 17, 2009, 11:22:40 AM »
Just trying to think of a reason why it wouldn't work.  I've made that mistake before.   ;D
Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System

Offline rick0612

  • Sr. Member
  • ****
  • Posts: 258
  • The only dumb question is the one not asked.
Re: Advanced tips for the Samsung NC10
« Reply #14 on: November 17, 2009, 04:57:02 PM »
Thanks, checked 14_setkeys and it is executable.

I tried the new brightness procedure davecs wrote yesterday. Still no help.

I thought perhaps the sudoer file was screwed so I ran up visudoers, deleted the entries and re-entered them. Still no help.

Still pluggin' away. Hopefully I'll stumble across the error soon.

Rick.
Packaging rig: Averatec 2573 /12.1" screen /2.0GHZ /3GB RAM /120GB SSD /Minime 2012.12

Daily rig: Alienware X51 /23" monitor /Windows 7 host /KDE VBox client