The way in order to refresh Dolphin is to press F5. However, this would be manual.
In order to continuously refresh, an automatic solution, create a bash script that runs on boot. This bash script should press F5 every five seconds if Dolphin is open. Create a file named dolphin-update in /usr/local/bin with the following contents:
#!/bin/bash
while true; do
PID=$(pgrep "dolphin")
if [ "$?" -ne "0" ]; then
xdotool key 'F5'
fi
sleep 5
done
You may need to first create it as root and then change the owner to your user:
sudo chown username:username /usr/local/bin/dolphin-update
Ensure that it has executable permissions:
chmod +x /usr/local/bin/dolphin-update
Now we need that to run on boot. To do that run sudo crontab -e and add the following line to the end of the file:
@reboot /usr/local/bin/dolphin-update
This script will run on boot.
You should now have a continuously refreshing Dolphin!
There are some caveats to this script.
- If you open Dolphin, go to another application where F5 triggers something, (eg Chromium refreshes the page), the script will still run and be a constant annoyance. Solution: Close Dolphin when not actively using it.
- As a
cron job is used, if your computer crashes, the script will not run on boot. However this is a problem with cron not the script.
What the script means, line by line:
#!/bin/bash - shebang to run with bash
while true; do - run continuously
PID=$(pgrep "dolphin") - find the process ID of a dolphin instance. This is purely there to check whether there is even a instance of Dolphin running.
if [ "$?" -ne "0" ]; then - check the result of whether there is a Dolphin instance running. If there is, then ...
xdotool key 'F5' - press F5
fi - end the if block
sleep 5 - wait 5 seconds before repeating the process
done - end the while block