Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So whenever I hit my dim/brighten keys on the keyboard, a notification bubble pops up with the screen brightness. All that's fine, but I would like to be able to change how much the brightness changes with each key press.

For example, right now it takes just 5 presses to go from the completely dark to the brightest setting. However, I know from the "Brightness/Lock" setting that the screen is capable of much smaller intervals than this.

Is there a way to change how much the brightness jumps each time the keys are pressed?

share|improve this question

2 Answers 2

Since you haven't specified which desktop environment you use, I'll provide some KDE-specific details as well.

I've just updated KDE to 4.9.2 and met with the same inconvenience. I decided to dig into the code, and here are my conclusions:

  1. Brightness is actually controlled by kernel itself. According to KDE's PowerDevil source code, there exist two basic ways for kernels to provide control interface:
    • sysctl() system call (likely on *BSD systems, I suppose)
    • sysfs interface (likely Linux)
  2. sysfs interface is located at /sys/class/backlight/*your_backlight_type*/. Here's what it looks like for me:
    $ ls -1 /sys/class/backlight/intel_backlight/
    actual_brightness
    bl_power
    brightness
    device
    max_brightness
    power
    subsystem
    type
    uevent
    Two files are relevant for us now: brightness and max_brightness. And here's how they can be used:
    $ cd /sys/class/backlight/intel_backlight
    $ cat max_brightness 
    976
    $ cat brightness 
    176
    $ echo 77 | sudo tee brightness
    77
    
    First command lets you determine the maximum brightness you can set (the minimum is always zero). Second one lets you know what value the actual brightness is set to. And with the third you can set it to any value you desire in the range of [0; max_brightness].
  3. KDE's KRunner still has the freedom to set any brightness level. Press Alt-F2 and type:

    screen brightness 17

  4. KDE's keyboard Brightness Up and Brightness Down key handling code has increment value of 10% hard-coded. Hence, unless you want to mess with building KDE from sources, there's nothing you can do with it.

  5. KDE's BatteryMonitor plasmoid has its own brightness control, whose increment is also hard-coded as 10%, but now we're lucky enough, since it is written in QML: $ sudo nano /usr/share/kde4/apps/plasma/plasmoids/battery/contents/ui/PopupDialog.qml (upd: in KDE 4.11 it has been moved to BrightnessItem.qml), navigate to section that looks like

    Components.Slider {
            id: brightnessSlider
            minimumValue: 0
            maximumValue: 100
            stepSize: 10
            onValueChanged: brightnessChanged(value)
        }
    and change the step size to what you desire. After relogin you'll see the change.

share|improve this answer
    
Never knew we could do so... Thanks for sharing it. –  Vishnu Kumar Oct 29 '12 at 7:57
    
@vines : you are my Eye saver !!! A million thanks –  vikkyhacks Jul 31 at 14:57

I dont think theres such a feature enabled now in Ubuntu (Or any other OS). Try posting your ideas to Ubuntu Brainstorm.

share|improve this answer
    
Does the downvote mean there is such a feature?? If yes please let me know –  Vishnu Kumar Jun 13 '12 at 9:22
    
It wasn't me. I think you should be able to do it one way or another, since it's possible in the gui settings? –  TreefrogInc Jun 13 '12 at 13:45
    
@VishnuKumar Check the post below :) –  Suhaib Oct 24 '12 at 1:04
    
@Suhaib, sorry you said below, so was looking below. I think you meant vines's post? –  Vishnu Kumar Oct 26 '12 at 9:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.