I am running Kubuntu 18.04, and have a simple script to reset the plasmashell every time after suspend/lockscreen since there's a known bug that corrupts folder/file names upon returning from suspend.
#!/bin/bash
dbus-monitor --session "type='signal',interface='org.freedesktop.ScreenSaver'" |
while read x; do
case "$x" in
*"boolean true"*) echo SCREEN_LOCKED;;
*"boolean false"*) killall plasmashell | kstart plasmashell;;
esac
done
This script works fine when run from a terminal.
However, when placed in crontab to load at reboot the process is not loading and can not be found in htop list.
Using crontab -e as the user I've added this in the file
@reboot /home/user/Documents/IK_Scripts/IK_ResetPlasma_BASH.sh > /home/user/Desktop/LogF
The LogF is generated after reboot, but the script does not appear to be loading.
Is this the correct way of having this script running constantly as a background process or is there a correct way of doing that? In essence i would like this script to be loading after reboot and running in the background for whenever i return from lock screen.
Any help will be greatly appreciated!