I am trying to change the powerbutton role of my laptop (ASUS Vivobook). So as on arch wiki I edited the file in /etc/systemd/logind.conf
I modified the entry HandlePowerKey:
HandlePowerKey=suspend
Than I ran:
systemctl kill -s HUP systemd-logind
Which should reload the new configurations, but doing all this isn't helping at all, there are no configuration in directories with higher precedence, so configurations should only load from /etc/systemd/logind.conf.
When checking status of the systemd-logind it shows something like this below:
systemd-logind.service - User Login Management
Loaded: loaded (/usr/lib/systemd/system/systemd-logind.service; static)
Active: active (running) since Thu 2021-05-20 12:14:58 IST; 34min ago
Docs: man:sd-login(3)
man:systemd-logind.service(8)
man:logind.conf(5)
man:org.freedesktop.login1(5)
Main PID: 366 (systemd-logind)
Status: "Processing requests..."
Tasks: 1 (limit: 9345)
Memory: 1.6M
CPU: 99ms
CGroup: /system.slice/systemd-logind.service
└─366 /usr/lib/systemd/systemd-logind
May 20 12:21:35 archlinux systemd-logind[366]: Config file reloaded.
May 20 12:21:50 archlinux systemd[1]: systemd-logind.service: Sent signal SIGHUP to main process 366 (systemd-logind) >
May 20 12:21:50 archlinux systemd-logind[366]: /etc/systemd/logind.conf:8: Assignment outside of section. Ignoring.
May 20 12:21:50 archlinux systemd-logind[366]: Config file reloaded.
May 20 12:22:28 archlinux systemd[1]: systemd-logind.service: Sent signal SIGHUP to main process 366 (systemd-logind) >
May 20 12:22:28 archlinux systemd-logind[366]: /etc/systemd/logind.conf:8: Assignment outside of section. Ignoring.
May 20 12:22:28 archlinux systemd-logind[366]: Config file reloaded.
May 20 12:22:37 archlinux systemd[1]: systemd-logind.service: Sent signal SIGHUP to main process 366 (systemd-logind) >
May 20 12:22:37 archlinux systemd-logind[366]: /etc/systemd/logind.conf:8: Assignment outside of section. Ignoring.
May 20 12:22:37 archlinux systemd-logind[366]: Config file reloaded.
Here it is showing: Assignment outside of section. Ignoring.
I searched on web and found that this may occur due to encoding. I checked my encoding with the command file and these are the results:
file -bi /etc/systemd/logind.conf
text/plain; charset=us-ascii
If this is ascii than it must be utf-8, but it still doesn't work. What else I should do to make it work?
This is portion of my logind.conf file. It containing line 8 with error.
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
HandlePowerKey=suspend
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend-then-hibernate
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#HandleRebootKey=reboot
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no