xyb3rt / physlock

Lightweight linux console locking tool
GNU General Public License v2.0
303 stars 36 forks source link

How to run a command after unlock? #95

Open ceremcem opened 4 years ago

ceremcem commented 4 years ago

A workaround for this serious bug is that if we could issue xrandr --auto on the graphical TTY (TTY-7), display starts working. However, this command must be issued after unlocking, not after resuming. So I need to run a command after unlocking. How can I make this happen?

ceremcem commented 4 years ago

As a workaround to this "running command after unlock" issue, I use an infinite loop after pm-suspend until it succeeds:

echo "suspending..."
pm-suspend

echo "Performing workaround for LightDM bug"
while :; do
    xrandr --auto && break 
    sleep 1s
done