You are not logged in.
Pages: 1
Well, as the title says, acpid doesnt really do anything.
By writing $* to a file from the acpi/eventhandler.sh script, I've confirmed that the script does indeed receive events, and that they have the same names as the cases in the switch-case statement in the script
Iv'e also added this to the top of the script:
function echoTest {
local bool=`[ "$1" -eq "ac_adapter" ] && echo true || echo false`
echo $1 >> $TESTFILE
echo "$1 matches ac_adapter: $bool" >> $TESTFILE
echo "" >> $TESTFILE
}
echoTest $1 the contents of the testfile (atfer plugging/unplugging the power coord) are this:
ac_adapter
ac_adapter matches ac_adapter: false
battery
battery matches ac_adapter: falsewhich makes me think the problem lies with some bash syntax I don't know about. (some kind of string expansion perhaps?)
Does anybody have a take on this? ![]()
Last edited by Bladtman242 (2012-04-04 15:30:22)
Offline
Update: I tried putting an echo "FINE" >> $TESTFILE at the end of file.
I figured since there are no "exit" or "exec" commands in the script, it should reach the bottom of the file at some point.
It doesn't however.
So maybe some other kind of syntactical error? or maybe something else exits the script, without my knowledge?
Here is the script , in its current form: http://pastebin.com/kBtYhSih.
Last edited by Bladtman242 (2012-04-04 14:22:36)
Offline
Hah! Turned out to be the untimely comment in line 31.
I still don't get why
$1=ac_adapter
[ "$1" -eq "ac_adapter" ] && echo true || echo falseechos false?
But at least it works now ![]()
Perhaps because "-eq" does integer comparison, so I was supposed to use "=" instead?
Anywho, closing the topic ![]()
Last edited by Bladtman242 (2012-04-04 15:29:55)
Offline
Try "=="
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Nah, its '='.
But thanks anyway, it surprised me as well ![]()
Offline
Pages: 1