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.

I use a python script to set brightness to zero.

#!/usr/bin/python

import dbus 
bus = dbus.SessionBus() 
proxy = bus.get_object('org.gnome.SettingsDaemon',
                       '/org/gnome/SettingsDaemon/Power') 
iface = dbus.Interface(proxy,dbus_interface='org.gnome.SettingsDaemon.Power.Screen')
iface.SetPercentage(0)

I've put it in Startup Applications. It works only when I login. There is full brightness at login screen.

Where should I put this so that it sets brightness to zero at login screen?

share|improve this question

1 Answer 1

I'm not 100% sure of this, but i recall that i have used /etc/rc.local in similar situations. add a line that executes your script there.

And then there is upstart that might work. But i have no experience with that except a script that i found to autostart deluged

Your startup script would probably look something like

start on startup

script
  python - <<END
    import dbus

    bus = dbus.SessionBus() 
    proxy = bus.get_object('org.gnome.SettingsDaemon',
                   '/org/gnome/SettingsDaemon/Power') 
    iface = dbus.Interface(proxy,dbus_interface='org.gnome.SettingsDaemon.Power.Screen')
    iface.SetPercentage(0)

  END
end script

Upstart resource http://upstart.ubuntu.com/

share|improve this answer
    
Nice, but you should probably add some pre-requisites to this. I assume (no testing) that you will need both dbus and ligthdm running for this to work. –  Javier Rivera Oct 2 '12 at 7:32
    
Yeah i did not test it, and you are right those probably needs to be running for this to work –  Kempe Oct 2 '12 at 8:37

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.