PDA

View Full Version : Enable Laptop Mode in Kali!



Hitman
2013-05-24, 18:49
Mostly pen-testing distributions have the same issue they consume more battery power. There are a lot of things that we can do to lower the consumption of battery power most of them we already know like

1. Putting our computer to sleep when it is inactive.
2. Setting our computer to hibernate mode when battery power is low.
3. Slowing down the hard disk spin.
4. Putting display to sleep when it is inactive.
5. Reducing the back light brightness.
6. Dimming display when the computer is idle.
7. Turn off WiFi when not required
8. Kill all unwanted processes
9. Hard disk power saving option (hdparm -i /dev/sda if AdvancedPM=yes then hdparm -B 1 -S 12 /dev/sda)

But one more thing we can do and that is

Enable Laptop Mode

We can save our battery energy life by turning on Linux’s laptop mode. Remember not every hardware comes with a laptop mode so we need to check whether our hardware supports laptop mode by executing the following command under root:


nano /proc/sys/vm/laptop_mode

If you find that the value in the laptop_mode text file is 0 it means that the laptop mode is disabled. Just set it to 5 and save the file to enable the laptop mode.

apices
2013-06-07, 03:07
Cool.. I wrote a script to toggle it on or off


#!/bin/bash

currentMode=$(cat /proc/sys/vm/laptop_mode)

if [ $currentMode -eq 0 ]
then
echo "5" > /proc/sys/vm/laptop_mode
echo "Laptop Mode Enabled"
else
echo "0" > /proc/sys/vm/laptop_mode
echo "Laptop Mode Disabled"
fi

Hitman
2013-06-08, 18:40
Appreciated @apices. you can make it more interesting for example if you write "lmode on" or "lmode off" in the terminal it will on/off the laptop mode. just give it a try (hint: use command line arguments). If need help then inform me.

BeRniTo
2013-07-03, 00:46
Hello from Uruguay! :)

I've just installed Kali in a laptop and can't find where to add the battery icon to the taskbar.
I tried enabling laptop mode but didn't work.

Any help would be appreaciated. :)

compuwar
2013-07-03, 01:47
Hello from Uruguay! :)

I've just installed Kali in a laptop and can't find where to add the battery icon to the taskbar.
I tried enabling laptop mode but didn't work.

Any help would be appreaciated. :)

You're probably better off creating a new thread in the installing section. Even without laptop mode enabled, my Thinkpads have the battery monitor in the taskbar by default, and by default it shows the status of both batteries (I have an extra-capacity battery installed.) In your post, you should include your hardware information (manufacturer, model.) Links to my power device directories live in /sys/class/power_supply if that helps.