DEV Community

Gabriel Alejandro López López
Gabriel Alejandro López López

Posted on • Edited on • Originally published at glpzzz.dev

1

Simple way to set wallpaper on Linux

I don't use any major desktop environment on Linux. Most of these takes care of managing the wallpaper of your session by some functionality in the specific file manager. So, the desktop is treated as another directory by Nautius, Dolphin, Thunar, and others.

This is not the way I do things. I'm more into window managers that regularly don't know anything about wallpaper.

In my case, I use hsetroot, a very small utility, that can be installed on my Ubuntu setup with:

sudo apt install hsetroot
Enter fullscreen mode Exit fullscreen mode

And I just use hsetroot for two very specific actions

Setup a solid color as background

hsetroot -solid "#000000"
Enter fullscreen mode Exit fullscreen mode

Will set black as the solid color background.

Setup an image as wallpaper covering all the screen

hsetroot -cover /path/to/image.jpg
Enter fullscreen mode Exit fullscreen mode

Will expand and/or crop the image to fully cover the screen by respecting its aspect ratio.

Remember between sessions...

hsetroot doesn't store any settings. So, then session is restarted it will not remember the last color/image set. How to fix this? Call hsetroot on session start. I personally do it in my ~/.xsessionrc and with an specific path.

hsetroot -cover ~/.wallpaper.jpg
Enter fullscreen mode Exit fullscreen mode

When I want to set a new wallpaper I replace this file, in the next session that will be the default.

Conclusion

There are more comfortable ways to change your wallpaper, specially for those who do it very frequent. But, for me, who changes it once in months (maybe), hsetroot is perfect:

  • it does just one thing
  • it doesn't have a GUI
  • it's very simple to call in scripts.

And finally, yes, there are other utilities to do the same. feh and xsetroot for example. But, for some reason I have been using hsetroot for a couple of years. It just works!

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (2)

Collapse
 
anirudhrowjee profile image
Anirudh Rowjee

I would suggest using Nitrogen! It's extremely easy to use, and has a GUI.

Collapse
 
glpzzz profile image
Gabriel Alejandro López López • Edited

Yes, I know nitrogen and it have everything I don't want. the GUI and store the last wallpaper setting. I was looking for something simpler.

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more