You are not logged in.

#1 2024-06-06 10:17:34

itarill
Member
Registered: 2020-06-03
Posts: 60

[Solved] (sort of...) Running script on acpid change is not workig

I have acpid installed. Status: active (running).
I have a script that sends me a telegram message. It is working running executed from terminal, the message is sent.

My desire is that when the AC power is out, my notebook would send me a telegram message (the router and therefore the internet is on a separate AC circuit, and the internet is not dropped). Hence, I have modified this part of /etc/acpi/handler.sh:

ac_adapter)
        case "$2" in
            AC|ACAD|ADP0)
                case "$4" in
                    00000000)
                        logger 'AC unpluged'
                        touch /etc/acpi/events/AC_OUT.txt
                        bash /etc/acpi/events/bash_notify_ACoutage.sh
                        ;;
                    00000001)
                        logger 'AC pluged'
                        ;;

Also, "acpi_listen" detects the AC outage.

Neither is the file created nor does the message arrive. What am I doing wrong? Thanks.

Last edited by itarill (2024-06-06 14:26:51)

Offline

#2 2024-06-06 11:20:32

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,893

Re: [Solved] (sort of...) Running script on acpid change is not workig

systemd login manager can interfere with acpi , but that doesn't handle AC related events.

Other candidates are DE power managers.

Append systemd.unit=multi-user.target to your bootcommand line to ensure you're booting to console, reboot with AC plugged in .

( https://wiki.archlinux.org/title/System … _boot_into for details).

DO NOT start graphical stuff, just login to a console as root .
unplug AC, check.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2024-06-06 13:47:01

itarill
Member
Registered: 2020-06-03
Posts: 60

Re: [Solved] (sort of...) Running script on acpid change is not workig

I have modified the default target to multi-user and rebooted. The acpi_listen still identified the unplugged adapter but the touch is still not creating that file in that folder.

Edit: solved. Well, not acpid. But as I'm using KDE, I used the GUI at energy settings. In the end the intended functionality is achieved and I'm happy.

Last edited by itarill (2024-06-06 14:42:44)

Offline

Board footer

Powered by FluxBB