Thursday, September 20, 2012

Battery details using Terminal

Recently I installed Xubuntu which being awesome and far better than Ubuntu' s Gnome lacks some of the features like showing estimated battery time remaining.

I tried a lot to  find out a solution for this recently came across a ask Ubuntu thread which describes a way to obtain battery details using Terminal.

Using upower you can get all the battery details.

To view all the details you can use

upower -i /org/freedesktop/UPower/devices/battery_BAT0

Use grep to remove the unwanted details from the above result

upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state|time|per"

You can create alias for the same command so that you can run it using just the alias that you gave

alias bat='upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -E "state|time|per"'

To permanently add this to your system terminal just copy paste the same command to .bashrc or /etc/rc.local

Thursday, September 13, 2012

Permanently adjust screen brightness in Ubuntu 12.04 / Linux Mint 13


This tutorial will help you to adjust the screen brightness in Ubuntu 12.04 / Linux Mint 13 during each boot automatically.

Tested in Intel i7 laptop with Nvidia Graphics Card, this idea will work only if you have a file named brightness in /sys/class/backlight/acpi_video0


To know your systems current brightness level.
cat /sys/class/backlight/acpi_video0/brightness

Change brightness by changing the value 
echo 0 > /sys/class/backlight/acpi_video0/brightness

To permanently set the brightness you can use the rc.loacal script file to change brightness which is executed at each reboot
sudo gedit /etc/rc.local

add the following line above "exit 0" seen at the bottom of the document 
echo 0 > /sys/class/backlight/acpi_video0/brightness
save the file and restart your system.

You may also refer this.
Please free to post issues as a comment.

Saturday, September 8, 2012

Proper Nvidia Optimus Drivers for Ubuntu / Linux MInt


Note : These setting where tested @ Asus K53SV ( Nvidia 540M ) , but it should be working for any Nvidia graphics card with Optimus.

I have been using Linux for past two years, I was never satisfied with the battery life and graphics quality of Linux even though I had i7 processor and Nvidia 540M graphics tried lot of Nvidia Installations either they crashed or they crashed my entire system.Now I tried out bumblebee which works perfectly just like a switchable graphics.

Okay lets Install Bumblebee
  1. Get rid of all Default driver you already have in your system
    sudo apt-get purge xserver-xorg-video-nouveau
  2. Install Bumblebee ppa
    sudo apt-add-repository ppa:bumblebee/stable
  3. Update and Install Bumblebee
    sudo apt-get update && sudo apt-get install bumblebee

In case of an error (I got an error related to users addition to group) use these two commands
     sudo usermod -a -G bumblebee $USER
     sudo apt-get install virtualgl-libs:i386 libgl1-mesa-glx:i386 libc6:i386



To run application using Nvidia drivers you can use Optirun command in terminal it takes application name as parameter for example 

To run Vlc 
          optirun vlc & 
Firefox 
          optirun firefox &
I was able to achieve a increase of about 1 hour in my battery life. I have also heard that this can decrease the heating in Dell Laptops,but its a fact that we all done a mistake by selecting a optimus laptop for Linux use even after installing bumblebee you wont to be able to use HDMI output and some other functions that windows provide, I'm not sure may be I haven't come across such solutions yet.


You can Install the Bumblebee UI too! 
https://github.com/MrMEEE/bumblebee-ui/blob/master/INSTALL

Reference
1.http://askubuntu.com/questions/163251/how-do-i-install-bumblebee-on-nvidia-540m-in-12-04