I have set up my ACPI to handle Fn+F* keys and the events get intercepted, i.e. ACPI works. I have a different shell script that is supposed to toggle between my notebook's internal and external screen - this script when run by itself from XTerm works as well. However, I cannot get it to execute properly in the ACPI script.
After a few tries I realized that none of the calls to xrandr or lspci from my script get executed. As a simple test, here is what I have so far:
case $3 in
/usr/local/sbin/test >> /etc/acpi/test.txt # the "test" script just says: echo "Test World!"
echo "TOGGLE?" >> /etc/acpi/test.txt
xrandr >> /etc/acpi/test.txt
After I press the key combination, /etc/acpi/test.txt contains:
So ACPI works because it triggered on the correct code and just piping echo into a file and piping the output of my own custom script into a file worked. (Obviously, since the ACPI script is non-interactive I have to pipe echo into a file.) But trying to call anything remotely useful, like xrandr, lspci, etc. just does nothing! I tried full paths, "su root -c `<command>`" and "sh -c `<command>`" (which and without the `), but nothing seems to be working.
What am I doing wrong?