How to set timer to turn off laptop?
How to set timer to turn off laptop?
Is it possible in puppy to set poweroff of computer in say 30 minutes when laptop works on batteries? Can not find relevant menu.
Thanks in advance
Thanks in advance
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
you might try this
http://www.murga-linux.com/puppy/viewtopic.php?t=69275
http://www.murga-linux.com/puppy/viewtopic.php?t=69275
Or, if you don't want to install any additional software, you can type in terminal (Roxterm, urxvt...)
But if you run this, terminal must be left open.
Code: Select all
sleep 30m && wmpoweroff &
I guess I should have explained better:
I am setting up an old nettbook for my grandsun (2,5 years old). He usually forgets to shut down the computer (although I put big shutdown icon on desktop). So the netbook is all time switched on, but sometimes power goes off and the battery can only work for 30 minutes. After that the netbook has sudden blackout. And every time this happens puppy crashes.
Usually other distors have some power management tools where you can request that if laptop works on batteries in some minutes it automatically shuts down. I hoped that if I set up that in that case puppy would not crash.
Is it possible to make the sleep or poweroff commands dependant on whether the laptop works on AC or the batteries? Or is there any other way to prevent puppy from crashing at sudden blackout?
I am setting up an old nettbook for my grandsun (2,5 years old). He usually forgets to shut down the computer (although I put big shutdown icon on desktop). So the netbook is all time switched on, but sometimes power goes off and the battery can only work for 30 minutes. After that the netbook has sudden blackout. And every time this happens puppy crashes.
Usually other distors have some power management tools where you can request that if laptop works on batteries in some minutes it automatically shuts down. I hoped that if I set up that in that case puppy would not crash.
Is it possible to make the sleep or poweroff commands dependant on whether the laptop works on AC or the batteries? Or is there any other way to prevent puppy from crashing at sudden blackout?
Found script of the Battery gauge.. It says:
#! /bin/sh
if [ -d /sys/class/power_supply/BAT0 ]; then BAT='BAT0'; fi
if [ -d /sys/class/power_supply/BAT1 ]; then BAT='BAT1'; fi
if [ -d /sys/class/power_supply/BAT2 ]; then BAT='BAT2'; fi
STATUS="`cat /sys/class/power_supply/$BAT/status`"
CHARGE_FULL="`cat /sys/class/power_supply/$BAT/charge_full`"
CHARGE_NOW="`cat /sys/class/power_supply/$BAT/charge_now`"
CHARGE_PERCENT=$[$CHARGE_NOW*100/$CHARGE_FULL]
if [ $CHARGE_PERCENT -lt 7 ]; then
echo 1
STATUS="`cat /sys/class/power_supply/$BAT/status`"
TMP="`ps`"
if [ $CHARGE_PERCENT -lt 7 ] && [ $STATUS != Charging ] && [ ! "`echo "$TMP" | grep 'WARNING: Battery'`" ]; then
yaf-splash -text "WARNING: Battery are running low!" -margin 2 -bg red -bw 0 -placement top -font "9x15B" -outline 0 &
fi
fi
#find char
TMP="abcdefghijklmnopqrstu"
[[ "$CHARGE_PERCENT" -eq 0 ]] && echo a || echo ${TMP:$(( $CHARGE_PERCENT/5 )):1}
Could you tell me where should I add poweroff?
#! /bin/sh
if [ -d /sys/class/power_supply/BAT0 ]; then BAT='BAT0'; fi
if [ -d /sys/class/power_supply/BAT1 ]; then BAT='BAT1'; fi
if [ -d /sys/class/power_supply/BAT2 ]; then BAT='BAT2'; fi
STATUS="`cat /sys/class/power_supply/$BAT/status`"
CHARGE_FULL="`cat /sys/class/power_supply/$BAT/charge_full`"
CHARGE_NOW="`cat /sys/class/power_supply/$BAT/charge_now`"
CHARGE_PERCENT=$[$CHARGE_NOW*100/$CHARGE_FULL]
if [ $CHARGE_PERCENT -lt 7 ]; then
echo 1
STATUS="`cat /sys/class/power_supply/$BAT/status`"
TMP="`ps`"
if [ $CHARGE_PERCENT -lt 7 ] && [ $STATUS != Charging ] && [ ! "`echo "$TMP" | grep 'WARNING: Battery'`" ]; then
yaf-splash -text "WARNING: Battery are running low!" -margin 2 -bg red -bw 0 -placement top -font "9x15B" -outline 0 &
fi
fi
#find char
TMP="abcdefghijklmnopqrstu"
[[ "$CHARGE_PERCENT" -eq 0 ]] && echo a || echo ${TMP:$(( $CHARGE_PERCENT/5 )):1}
Could you tell me where should I add poweroff?
Here is the modified version of my laptop-tools. It consists of acpitool, vattery,vattery-ibam-vattery-acpitool,xbindkeys,acpid, ppower, cpu-frequency tray app needed framework, extra Fn + function buttons support like media buttons. You need to use xbindkeys-config to bind the buttons to executables found on your comp or laptop.
What it provides. It provides Vattery-ibam and Vattery-acpitool with needed framework to handle verbose warnings and also executable commands at certain battery state levels.
Check /root/.config/vattery-ibam/config and corresponding vattery-acpitool/config text files how to configure the commands for your needs.
For me...I get verbose warning at battery state level 10 % and suspending to the ram at battery level 5 %.
I have included those config files in the pet.
Also you get those other functionality for laptop or netbook. Like power button should shut down the comp. Laptop or netbook sleep button suspends to the ram, lid closing suspends to the ram.
If something is missing, report. I removed Frisbee and dhcpcd stuff from the pet so I hope I didnt remove anything needed.
Vattery-ibam is sometimes picky. If you dont get new battery icon to the tray after reboot, restart X is not enough to get whole functionality, edit /root/Startup/1vattery script and leave only shebang row and exec vattery-acpitool row. Save and restart X.
What it provides. It provides Vattery-ibam and Vattery-acpitool with needed framework to handle verbose warnings and also executable commands at certain battery state levels.
Check /root/.config/vattery-ibam/config and corresponding vattery-acpitool/config text files how to configure the commands for your needs.
For me...I get verbose warning at battery state level 10 % and suspending to the ram at battery level 5 %.
I have included those config files in the pet.
Also you get those other functionality for laptop or netbook. Like power button should shut down the comp. Laptop or netbook sleep button suspends to the ram, lid closing suspends to the ram.
If something is missing, report. I removed Frisbee and dhcpcd stuff from the pet so I hope I didnt remove anything needed.
Vattery-ibam is sometimes picky. If you dont get new battery icon to the tray after reboot, restart X is not enough to get whole functionality, edit /root/Startup/1vattery script and leave only shebang row and exec vattery-acpitool row. Save and restart X.
- Attachments
-
- laptop-acpi-battery-tools-0.0.1.pet
- (161.21 KiB) Downloaded 1000 times
Last edited by pemasu on Mon 12 Sep 2011, 18:58, edited 2 times in total.
Probem solved: I Installed pwidgets and changed csript of Battery (at /usr/local/pwidgets/widgets/scripts/Battery
Namely, replaced the text
yaf-splash -text "WARNING: Battery are running low!" -margin 2 -bg red -bw 0 -placement top -font "9x15B" -outline 0 &
with
wmpoweroff
With active pwidget Battery it safely shuts down the computer at critical battery.
Thanks!
And thanks to pemasu - His tool allows shutdown through simply pushing the power button. Very useful! And yes, finally - wireless connection established on Asus eee pc! (which was hopeless from any puppe except from pupeee). Thaanks!!!
Namely, replaced the text
yaf-splash -text "WARNING: Battery are running low!" -margin 2 -bg red -bw 0 -placement top -font "9x15B" -outline 0 &
with
wmpoweroff
With active pwidget Battery it safely shuts down the computer at critical battery.
Thanks!
And thanks to pemasu - His tool allows shutdown through simply pushing the power button. Very useful! And yes, finally - wireless connection established on Asus eee pc! (which was hopeless from any puppe except from pupeee). Thaanks!!!
note that means less than 7%.
depending on the characteristics of your battery you may find something else more suitable. my battery runs at 1% for a long time then at 0% for quite a while.
it also goes under 7% quite quickly. so for me would be more convenient. your battery and needs will very likely differ.
Code: Select all
-lt 7
depending on the characteristics of your battery you may find something else more suitable. my battery runs at 1% for a long time then at 0% for quite a while.
it also goes under 7% quite quickly. so for me
Code: Select all
-lt 1
This provides all stuff. It has stuff for keybindings through xbindkeys-config, acpid demon for acpi, acpitool for suspending in ram, battery monitoring, verbose warning and possibilty to suspend at configured battery percent level or shutdown....the vattery-acpitool and vattery-ibam accepts whatever command. Also there is tray cpu frequency setting tray app and so on...
This pet provides the whole set for Lucid Puppy. I use this stuff in my Lucid builds.
Of course there might be something which needs tuning. I dont remember so accurately if I finetuned the scripts after I posted this pet.
Answer...you get Vattery tray app for verbose warnings and possiblity to execute commands, keybindings for laptop function buttons...might need reconfiguring for Lucid Puppy apps...power button shuts down...Fn + Zz button suspends to ram..ppower tray app gives tray cpu frequency scaling tray app.
It consists of all the needed binaries, /root/Startup scripts and the whole framework of scripts in /etc/acpi/*
This pet provides the whole set for Lucid Puppy. I use this stuff in my Lucid builds.
Of course there might be something which needs tuning. I dont remember so accurately if I finetuned the scripts after I posted this pet.
Answer...you get Vattery tray app for verbose warnings and possiblity to execute commands, keybindings for laptop function buttons...might need reconfiguring for Lucid Puppy apps...power button shuts down...Fn + Zz button suspends to ram..ppower tray app gives tray cpu frequency scaling tray app.
It consists of all the needed binaries, /root/Startup scripts and the whole framework of scripts in /etc/acpi/*
Suspend to Ram
Thanks for ur laptop.pet. I have been struggling to get my pup to sleep since I got her.
One issue though, about every 1 out of 4 times that I put my netbook (Pendo u1000- d425 Atom, Ralink 3090 wireless card) to sleep it doesn't wake up properly. The screen does not turn on nor the wireless card and I can only guess the keyboard aswelll. The only sign of life is a solid LED and the faint noise of the cpu fan. I'm using macpup 5.2.8
Can anyone help me with this and thanks in advance
One issue though, about every 1 out of 4 times that I put my netbook (Pendo u1000- d425 Atom, Ralink 3090 wireless card) to sleep it doesn't wake up properly. The screen does not turn on nor the wireless card and I can only guess the keyboard aswelll. The only sign of life is a solid LED and the faint noise of the cpu fan. I'm using macpup 5.2.8
Can anyone help me with this and thanks in advance
Running the laptop pet in Racy 53 I get:
Code: Select all
# acpitool
acpitool: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by acpitool)
[color=darkblue]Acer Aspire 5349-2635 laptop Tahrpup.[/color]
[color=blue]Acer R11 and C720 Chromebks Bionicpup64[/color]
[color=olive]Acer Iconia A1-830 tablet no pup[/color]
[color=orange]www.sredmond.com[/color]
[color=blue]Acer R11 and C720 Chromebks Bionicpup64[/color]
[color=olive]Acer Iconia A1-830 tablet no pup[/color]
[color=orange]www.sredmond.com[/color]
- TwoPuppies
- Posts: 77
- Joined: Wed 29 Dec 2010, 05:13
- Location: Melbourne, Australia
I thought it might be a nice idea to have the low battery warning as it is now, followed subsequently by the auto shutdown at a lower percentage (say 2% or 3%).
I've diddled around with the Pwidgets battery script a bit, and I can get either the warning message or the auto shutdown to work individually, but not both together.
Does anyone know how I might modify the script to get both to work consecutively?
I've diddled around with the Pwidgets battery script a bit, and I can get either the warning message or the auto shutdown to work individually, but not both together.
Does anyone know how I might modify the script to get both to work consecutively?
[color=#006699]What you really need is two puppies:
Puppy Linux, and the sort with four legs and a tail.[/color]
Puppy Linux, and the sort with four legs and a tail.[/color]