Quote (hs7sv @ Feb. 16 2006,00:23) |
I'm using DSL-2.1b and wmacpi_1.99r7.dsl on my laptop |
Code Sample |
sudo modprobe battery sudo modprobe button sudo modprobe fan sudo modprobe processor sudo modprobe thermal sudo modprobe ac |
Code Sample |
sleep 3; wmswallow -geometry 64x64 docked & |
Quote (hs7sv @ Feb. 18 2006,10:19) |
For the better time remaining calculating and 2 batteries support, I replaced wmacpi_1.99r7.dsl with wmbatteries. |
Quote (hs7sv @ Feb. 28 2006,22:53) | ||||||
marimo, Please read this thread. Option: apm=off acpi=force are needed in menu.list or lilo.conf. I added these commands in /opt/bootlocal.sh
For dMix problem, please read this thread. I'm using this command in .xinitrc:-
Note:
|
Code Sample |
title DSL fb1024x768 kernel /boot/linux24 root=/dev/hda1 quiet apm=off acpi=force vga=791 noapic noapm dma noscsi frugal mydsl=hda2 restore=hda2 initrd /boot/minirt24.gz |
Code Sample |
#!/usr/bin/perl # # This is somem messy Perl script, but hey, # it works. If you somehow stuble upon this # code, then please note that you may have to # change certain paths, such as BAT0, depending # on how many batteries you have. Also, note # that this script has only been tested with # ACPI and not APM. # # Enjoy! :-) # # written by ateam (derek@backdrifts.net) # # modified for DSL-2.1b by hs7sv (paphons@gmail.com) chop (@info = `cat /proc/acpi/battery/BAT0/state`); chop (@capacity = `cat /proc/acpi/battery/BAT0/info`); chop ($left = @info[4]); chop ($left = `echo \"$left\" | awk '{ print \$3 }'`); $state = @info[2]; chop ($state = `echo \"$state\" | awk '{ print \$3 }'`); chop ($full = @capacity[1]); chop ($full = `echo \"$full\" | awk '{ print \$3 }'`); $remain = $left / $full * 100; $remain = int ($remain); chop (@time = `cat /proc/acpi/battery/BAT0/state`); chop (@time2 = `cat /proc/acpi/battery/BAT0/info`); $rcap = @time[4]; chop ($rcap = `echo \"$rcap\" | awk '{ print \$3 }'`); $prate = @time[3]; chop ($prate = `echo \"$prate\" | awk '{ print \$3 }'`); if ($prate > 0) { if ($state eq "discharging") { $seconds = $rcap / $prate * 60 * 60; } elsif ($state eq "charging") { $seconds = ($full - $rcap) / $prate * 60 * 60; } $minutes = sprintf("%.2f", $minutes); $hours = $seconds / 60 / 60; $hours = sprintf("%.2f", $hours); chop ($singhour = $hours); chop ($singhour); chop ($singhour); $hourmins = $hours; $hourmins =~ s/^.//; $hourmins =~ s/^.//; $hourmins = $hourmins * .6; $hourmins = sprintf("%.0f", $hourmins); } else { $seconds = 0; } if ($singhour >= 1) { print " $singhour"; } if ($hourmins >= 1) { if ($singhour < 1) { print " 0"; } if ($hourmins < 10) { print ":0$hourmins"; } else { print ":$hourmins"; } print " remains" } else { print " A:C"; } print "\n"; if ($state eq "charged") { $printstate = "AC on-line"; } elsif ($state eq "discharging" and $rcap eq $full) { $printstate = "AC on-line"; } elsif ($state eq "charging") { $printstate = "AC on-line and charging"; } elsif ($state eq "discharging") { $printstate = "AC unplugged"; } print " $remain%, $printstate"; |
Code Sample |
${color grey}Battery: $color${exec perl /home/dsl/battstate.pl} |