Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cerco scriptino...
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
quantumwire
Guru
Guru


Joined: 15 Oct 2003
Posts: 403
Location: Lausanne

PostPosted: Tue Feb 17, 2004 2:02 am    Post subject: Cerco scriptino... Reply with quote

Ciao a tutti.

Sto cercando uno scriptino o qualsiasi cosa sia in grado di mettermi a nanna il portatile quando la batteria scende sotto l'8%.
Non ho pretese di avere sul desktop alcun tipo di warning... di conti alla rovescia e non richiedo nessun particolare modo di spegimento... un bel:
Code:

# shutdown -h now

e' quello che fa al caso mio.

Chiaramente il mio laptop e' una bellissima gentoo box! :wink:

Thanks.
_________________
HOWTO 1: Spegnere il laptop!
HOWTO 2: Comprimere i DVDs!
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Tue Feb 17, 2004 7:04 am    Post subject: Reply with quote

Non dovrebbe essere difficile. Se usi apm con un
Code:
$ cat /proc/apm
1.16ac 1.2 0x03 0x01 0x00 0x01 98% -1 ?

vedi in che stato e' la batteria e con un if controlli se e' al di sotto del 8%. Poi metti nel tuo crontab di farlo partire ogni tot di tempo. Se hai acpi non saprei.

PS: ora non ho tempo di farlo perche' sono sotto esami ma posso provare non appena li ho finiti.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
cerri
Bodhisattva
Bodhisattva


Joined: 05 Mar 2003
Posts: 2957
Location: # init S

PostPosted: Tue Feb 17, 2004 8:26 am    Post subject: Reply with quote

acpid/apmd fa al caso tuo.
_________________
Enjoy your freedom.
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
<----------------------->
Andrea Cerrito
Back to top
View user's profile Send private message
quantumwire
Guru
Guru


Joined: 15 Oct 2003
Posts: 403
Location: Lausanne

PostPosted: Tue Feb 17, 2004 11:16 am    Post subject: Reply with quote

Uso acpi:

Code:

[stekkino:~] > cat /proc/acpi/battery/BAT0/alarm
alarm:                   unsupported

Code:

[stekkino:~] > cat /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         4300 mAh
last full capacity:      4542 mAh
battery technology:      rechargeable
design voltage:          14800 mV
design capacity warning: 454 mAh
design capacity low:     45 mAh
capacity granularity 1:  409 mAh
capacity granularity 2:  4088 mAh
model number:            BA-03
serial number:
battery type:            LIon
OEM info:                ASUSTek

Code:

[stekkino:~] > cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            0 mA
remaining capacity:      4542 mAh
present voltage:         16836 mV

Ora cerco qualche info su acpid.
_________________
HOWTO 1: Spegnere il laptop!
HOWTO 2: Comprimere i DVDs!
Back to top
View user's profile Send private message
Naspe
Guru
Guru


Joined: 10 Dec 2003
Posts: 321
Location: Genova - Italy

PostPosted: Tue Feb 17, 2004 1:10 pm    Post subject: Reply with quote

Non so se dico una belinata... ma io avevo messo di lanciare questo comando nel programmino che ti fa vedere lo stato della batteria in kde/gnome. Cliccando sull'iconcina della batteria puoi impostare qule comando lanciare in caso di battery scarica...
CMq ora nn ho il portatile sotto mano quindi quando arrivo a casa ti dico meglio.

Ciao ciao
_________________
God Is Real... Unless Declared As Integer...

Provoca Il Più Bravo... Morirai Come Uno Schiavo!!!

Hai Evocato Il Tuono!!! Ora Raccogli Tempesta!!!
Back to top
View user's profile Send private message
quantumwire
Guru
Guru


Joined: 15 Oct 2003
Posts: 403
Location: Lausanne

PostPosted: Tue Feb 17, 2004 2:55 pm    Post subject: Reply with quote

Io non uso ne' Gnome ne' KDE ma BlackBox.
Comunque vorrei non essere obbligato a lanciare X per attivare il controllo dello stato della batteria per l'esecuzione dello shutdown.

Forse devo smanettare un po' con acpid...
_________________
HOWTO 1: Spegnere il laptop!
HOWTO 2: Comprimere i DVDs!
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Tue Feb 17, 2004 3:28 pm    Post subject: Reply with quote

In questo post

https://forums.gentoo.org/viewtopic.php?t=106835&start=0&postdays=0&postorder=asc&highlight=acpi+centrino+travelmate

c'e' una configurazione che uso io per acpid, puoi basarti su quella magari per ottenere il risultato che cerchi !

Fede
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
quantumwire
Guru
Guru


Joined: 15 Oct 2003
Posts: 403
Location: Lausanne

PostPosted: Tue Feb 17, 2004 4:07 pm    Post subject: Reply with quote

Ok... ho dato un'occhiata sia alla man page di acpid sia al link fornitomi da Fedrico. Quello che mi serve e' dunque la lista dei possibili eventi relativi all'alimentazione che vengono mandati sul file /proc/acpi/event.
Non l'ho trovata... magari averla completa di tutti i possibili eventi che vengono rilevati non sarebbe male cosi' posso inventarmi qualcos'altro tipo... passa qualcuno vicino al mio lap? --> YES = il lap saluta con un bel "ciao!" via speeker; NO = niente.
Che ne dite :D !

Shcerzi a parte: qualcuno sa indicarmi la lista completa di eventi mandati sul file /proc/acpi/event?
_________________
HOWTO 1: Spegnere il laptop!
HOWTO 2: Comprimere i DVDs!
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Tue Feb 17, 2004 4:40 pm    Post subject: Reply with quote

Io ho fatto cosi', ho messo in ascolto un tail sul logger e mi son messo a premere tutti i tastini, chiudere il monitor e cose del genere per vedere che eventi venivano generati.
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
quantumwire
Guru
Guru


Joined: 15 Oct 2003
Posts: 403
Location: Lausanne

PostPosted: Tue Feb 17, 2004 4:43 pm    Post subject: Reply with quote

Posso allora provare a staccare l'alimentazione da rete e vedere che eventi vengono generati durante la scarica della batteria...
_________________
HOWTO 1: Spegnere il laptop!
HOWTO 2: Comprimere i DVDs!
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Wed Feb 18, 2004 5:40 pm    Post subject: Reply with quote

Già visto QUI ?
_________________
Ciao da me!
Back to top
View user's profile Send private message
quantumwire
Guru
Guru


Joined: 15 Oct 2003
Posts: 403
Location: Lausanne

PostPosted: Sun Feb 22, 2004 8:03 pm    Post subject: Reply with quote

randomaze wrote:
Già visto QUI ?


Non avevo visto ed ora gli ho dato una occhiata... direi che e' fatto molto bene anche se l'implementazione nello script (al quale vengono passati tutti gli eventi "/etc/acpi/action.sh") del riconoscimento dell'evento e' diversa.
Mi rimane comunque il problema di trovare la lista degli eventi.
Ho provato a staccare la mia batteria e riattaccarla ma l'evento ottenuto e' completamente diverso da quello descritto in quel file relativo alla batteria.
Infatti io ottengo un "hotkey HTK xxx xxx" e non un bel "battery BAT0 xxx xxx"... mi sembra un po' strana la cosa!!!
Tanto per essere chiari ecco qua uno spaccato del mio /var/log/acpid:
Code:

[Sun Feb 22 22:43:55 2004] received event "hotkey HOTK 00000057 0000000a"
[Sun Feb 22 22:43:55 2004] notifying client 5718[1000:100]
[Sun Feb 22 22:43:55 2004] executing action "/etc/acpi/default.sh hotkey HOTK 00000057 0000000a"
[Sun Feb 22 22:43:55 2004] BEGIN HANDLER MESSAGES
[Sun Feb 22 22:43:55 2004] END HANDLER MESSAGES
[Sun Feb 22 22:43:55 2004] action exited with status 0
[Sun Feb 22 22:43:55 2004] completed event "hotkey HOTK 00000057 0000000a"
[Sun Feb 22 22:43:55 2004] received event "hotkey HOTK 00000069 00000014"
[Sun Feb 22 22:43:55 2004] notifying client 5718[1000:100]
[Sun Feb 22 22:43:55 2004] executing action "/etc/acpi/default.sh hotkey HOTK 00000069 00000014"
[Sun Feb 22 22:43:55 2004] BEGIN HANDLER MESSAGES
[Sun Feb 22 22:43:55 2004] END HANDLER MESSAGES
[Sun Feb 22 22:43:55 2004] action exited with status 0
[Sun Feb 22 22:43:55 2004] completed event "hotkey HOTK 00000069 00000014"

... e non vedo "battery BAT0...." eppure stacco e riattacco l'alimentazione... e la stacco e poi aspetto un bel po' prima di riattaccarla non compare comunque nessun evento relativo alla batteria... ma il modulo nel kernel e' compilato!
_________________
HOWTO 1: Spegnere il laptop!
HOWTO 2: Comprimere i DVDs!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum