Ubuntu – show battery status for Openbox
Tech April 14th, 2010
There are several ways to show your battery status in Openbox.
Here I use conky, which has many useful function like weather cast, network status also… here I just want it to show my battery status, cpu, ram and dates on my desktop screen.
Ok, first of all, install conky via Terminal emulator (select from the right click menu – root menu)
sudo apt-get install conky
Now you can run it by typing
conky
As you can see now, by default conky does not show your battery status. To let it do that, create a .conkyrc file in your home directory
gedit ~/.conkyrc
Paste the following code into .conkyrc file, save it and restart conky (ctrol+c, type conky again in the terminal):
Code ref: Various sources from the Internet and my own experience by studyihttp://conky.sourceforge.net/variables.html
# Use Xft?use_xft yesxftfont DejaVu Sans:size=8xftalpha 0.8text_buffer_size 2048# Update interval in secondsupdate_interval 4# This is the number of times Conky will update before quitting.# Set to zero to run forever.total_run_times 0# Create own window instead of using desktop (required in nautilus)own_window yesown_window_transparent yesown_window_type normalown_window_hints undecorated,below,sticky,skip_taskbar,skip_pager# Use double buffering (reduces flicker, may not work for everyone)double_buffer yes# Minimum size of text areaminimum_size 180 0#maximum_width 200# Draw shades?draw_shades no# Draw outlines?draw_outline no# Draw borders around textdraw_borders no# Stippled borders?stippled_borders 0# border marginsborder_margin 5# border widthborder_width 1# Default colors and also border colorsdefault_color grey#default_shade_color black#default_outline_color greyown_window_colour grey# Text alignment, other possible values are commented#alignment top_leftalignment top_right#alignment bottom_left#alignment bottom_right# Gap between borders of screen and text# same thing as passing -x at command linegap_x 25gap_y 25# Subtract file system buffers from used memory?no_buffers yes# set to yes if you want all text to be in uppercaseuppercase no# number of cpu samples to average# set to 1 to disable averagingcpu_avg_samples 2# number of net samples to average# set to 1 to disable averagingnet_avg_samples 2# Force UTF8? note that UTF8 support required XFToverride_utf8_locale yes# Add spaces to keep things from moving about? This only affects certain objects.use_spacer none#################################Dates################################TEXT${alignc 35}${font Arial Black:size=12}${time %A, %d-%m-%Y}${font}${alignc 35}${font Arial Black:size=12} ${time %H:%M:%S}${font}#################################System Default conky config################################${color grey}Acpi temp:$color $acpitemp C${color grey}RAM Usage:$color $mem/$memmax – $memperc% ${membar 10}${color grey}CPU Usage:$color $cpu% ${cpubar 6}${color grey}Processes:$color $processes ${color grey}Running:$color $running_processes$hr#################################${color grey}File systems:#/ $color${#fs_used /}/${fs_size /} ${fs_bar 6 /}################################${color grey}Name PID CPU% MEM%${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}$hr${color grey}Networking:Up:$color ${upspeed eth0} ${color grey} – Down:$color ${downspeed eth0}#################################Battery################################$hr${color grey}Time left or until charged:$color ${color red} ${battery_time BAT0} $color${color grey}Battery:$color${battery_bar 6,150 BAT0}${color} ${battery BAT0}${color grey}Uptime:$color $uptime#################################Weather Can Tho VMXX0004################################
Tags: battery, conky, laptopbattery, ubuntu
how to prolong your laptop battery
Linux, Tech December 26th, 2009
Battery life is a common topic for laptop users. I have read many many posts about how to prolong a laptop battery life. Here are most popular tips that I know.
0 – If you want to use your A.C./D.C power (use power directly from a charger) you may consider these steps:
- Charge your battery full 100%
- Unplug charger
- Use battery power until I has about 45-50% life left.
- Turn off your laptop (certainly) and remove your battery (and pls keep the placeholder of the batter clean + dry
) - Place the battery in a cool place.
- Use your A.C/D.C power
Someone said that “Never remove a fully charged battery from laptop for a period over well about 1 month, because your battery will not be able to be charged again”. I have not test this tip yet, so I am not sure it is true or not.
1 – Keep your battery working in a cool place (at least < 30*C) (Li-on battery is also a chemical battery, it reacts to heat).
2 – Do not charge your batter until the battery has just 5-10% life left.
3- Turn off unnecessary functions as much as you can (blue-tooth, wifi… when you don’t use them)
4 – Using Linux OS (advanced config).
Most of these tips come from my favorite post: http://www.trap17.com/index.php/Pro-long-Laptop-Battery-Life_t64414.html
Tags: laptopbattery



