I've bashed around on this one for awhile, no pun intended. I just want to open my todo list url in my browser every time my computer wakes from suspend. The command to do this normally is easy:
xdg-open https://complice.co/
...but that doesn't work, because "Please start Google Chrome as a normal user." Same if I try sensible-browser
.
So then I try
sudo -H -u malcolm bash -c 'sensible-browser "https://complice.co/" >> "$LOGFILE"'
...and this totally works if I'm just in a terminal as root, but if I try to put it in a /etc/pm/sleep.d/
script, then it fails silently. I tried
sudo -H -u malcolm bash -c 'sleep 10; sensible-browser "https://complice.co/" >> "$LOGFILE"'
...but it seems that the process is killed before sleep 10 finishes. (Based on trying sleep 10; echo "WAT" >> "$LOGFILE";
)
This feels like it should be simple, but I'm pretty stuck.