HydraPaper Randomly Switch Background at Interval

Aug 9, 2020

Run flatpak run org.gabmus.hydrapaper -r to random select a pictures from existing wallpaper folders.

To run it at a fixed interval (e.g. 5 minutes), you need to utlize crontab.

Edit Crontab

crontab -e

Add the following line

*/5 * * * * env DISPLAY=:0 env XDG_CURRENT_DESKTOP=MATE flatpak run org.gabmus.hydrapaper -r

NOTE: Replace the MATE in XDG_CURRENT_DESKTOP=MATE with your current desktop. Check you current desktop session via echo $DESKTOP_SESSION.

NOTE: You need env DISPLAY=:0 env XDG_CURRENT_DESKTOP=MATE to solve the following error

Unable to init server: Could not connect: Connection refused
Traceback (most recent call last):
  File "/app/bin/hydrapaper", line 70, in <module>
    __main__.main()
  File "/app/lib/python3.7/site-packages/hydrapaper/__main__.py", line 190, in main
    application = HydraPaperApplication()
  File "/app/lib/python3.7/site-packages/hydrapaper/__main__.py", line 37, in __init__
    self.window = HydraPaperAppWindow()
  File "/app/lib/python3.7/site-packages/hydrapaper/app_window.py", line 10, in __init__
    super().__init__(**kwargs)
  File "/usr/lib/python3.7/site-packages/gi/overrides/Gtk.py", line 521, in __init__
    "Gtk couldn't be initialized. "
RuntimeError: Gtk couldn't be initialized. Use Gtk.init_check() if you want to handle this case.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.