Sep 25

Set brightness automatically at the startup in Linux

When ever I restart (or logout and login) my laptop the LCD display brightness is set to the maximum value. Even if I set the brightness settings in the power to the value I need, they won’t be in effect when I restart the machine.

 Please note that rest of the blog article was edited on 5th of August 2012.

To solve this problem I wrote the following python script. First you need to add it to the startup applications list. The command to be given in the startup applications is “python /<path>/<to>/<script>/setBrightness.py < Brightness level>”.

(If you don’t know how to add this to start-up applications please refer http://linuxandfriends.com/2011/06/01/how-to-add-startup-programs-in-gnome-3/ )

An example would be python /home/ishan/.setBrightness/setBrightness.py 20 . If you do not specify a brightness level, the script will change the brightness level according to the time of the day. If it’s between 7am and 8pm, the script will make the brightness be set to 75.  If it’s between 8pm and 7am, the script will make the brightness be set to 20. You can edit these brightness levels by changing the variables day_level and night_level respectively.  

A special thank should go to Sergio Aguilar for adding this neat functionality of brightness changing according to the time of the day and changing the brightness using parameter passing.

If you are using Gnome 3 or Unity – 

Checkout the master branch from https://github.com/ishanthilina/setBrightness.

If you are using Gnome 2 –

Checkout the Gnome2 branch from https://github.com/ishanthilina/setBrightness.

 

Share Button
Sep 24

Start empathy automatically when network connection is available

I have noticed that Empathy (the default multi-protocol chat client in Ubuntu 11.04) doesn’t re-login to the accounts after the network is dropped and re-connected. So I wrote the following python script to solve this problem. The script will be using D-bus signals to detect the network connection status.This will make empathy to,

 

  • connect automatically when network connection is established (even when empathy is not running).
  • re-login to accounts when the network gets dropped and reconnect again(very useful when using wireless connections).

 

 

To use this script add it to the startup applications. Command to be given is “python /<path>/<to>/<script>/empathyConnect.py

 

Download:: http://ishans.info/attachments/article/64/empathyConnect.py

Share Button