10-29-2021, 08:01 AM
I stand on :
loginctl show-seat $(loginctl list-seats --no-pager --no-legend) -p ActiveSession --value|xargs -iX loginctl unlock-session X
or faster :
loginctl unlock-sessions
when connected in ssh.
From what i understood, systemd-logind take the hand when the power on button is pressed, then it communicates directly with PAM. I found no way to add a second handler on the press button or redirect the existing one.
udevadm trigger -v -n -g power-switch
returns
/sys/devices/platform/gpio-keys/input/input0/event0
...
Then
udevadm info /sys/devices/platform/gpio-keys/input/input0/event0
seems to correspond to the power button (but not sure - if somebody could confirm)
So we have the command to run and (perhaps) the button, and now ?
loginctl show-seat $(loginctl list-seats --no-pager --no-legend) -p ActiveSession --value|xargs -iX loginctl unlock-session X
or faster :
loginctl unlock-sessions
when connected in ssh.
From what i understood, systemd-logind take the hand when the power on button is pressed, then it communicates directly with PAM. I found no way to add a second handler on the press button or redirect the existing one.
udevadm trigger -v -n -g power-switch
returns
/sys/devices/platform/gpio-keys/input/input0/event0
...
Then
udevadm info /sys/devices/platform/gpio-keys/input/input0/event0
seems to correspond to the power button (but not sure - if somebody could confirm)
So we have the command to run and (perhaps) the button, and now ?