You are not logged in.

#1 2013-06-18 18:16:10

scott_fakename
Member
Registered: 2012-08-15
Posts: 106

Change /etc/acpi/handler.sh to a different language

I have acpid running on my system. I don't like shell scripting so I translated handler.sh's functionality into a ruby script which works fine and which I personally happen to find easier to maintain.

Anyhow, the question I have is, is it possible to have ACPId run a different file than handler.sh? For example, if I wanted to have it run "handler.rb"...

In the mean time I've just named the ruby file "handler.sh" and it works fine, but it feels hacky to have mismatched file extensions like that.

Thanks
--Scott

Offline

#2 2013-06-18 18:25:00

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Change /etc/acpi/handler.sh to a different language

Changing the content of /etc/acpi/hanlder.sh to something like

#! /bin/sh
/path/to/handler.rb

should do the trick.

Edit: don't forget to hand over the input of handler.sh to handler.rb.

Last edited by cookies (2013-06-18 18:27:19)

Offline

#3 2013-06-18 18:29:01

scott_fakename
Member
Registered: 2012-08-15
Posts: 106

Re: Change /etc/acpi/handler.sh to a different language

True, that's another option but it would entail loading up a (bourne) shell only to load up another (ruby) shell, which I was hoping to avoid

Turns out you can specify rules like this in /etc/acpi/events... So that's what I'll do. It wasn't in the man pages but it was on the internet.

Oh well. Sorry. And thanks.

Last edited by scott_fakename (2013-06-18 18:31:18)

Offline

Board footer

Powered by FluxBB