I want to get rid of the xscreensaver config file in my home .xscreensaver. I read in man xscreensaver, that:

Options to xscreensaver are stored in one of two places: in a .xscreensaver file in 
your home directory; or in the  X  resource  database.   If  the
.xscreensaver file exists, it overrides any settings in the resource database

but I don't understand what that means. What is this X resource database? Where should I put the contents of my $HOME/.xscreensaver, so that this file can be deleted from my home?


The X resource database is a kind of configuration abstraction (somewhat analogous to the MS-Windows registry). You create/manage one or more text configuration files (system wide ones, and ~/.Xdefaults), these are loaded into the X server by during the startup process, and applications can query the relevant settings instead of (though often as well as) custom configuration files.

You need to keep reading that xscreensaver man page, the Configuration section tells you exactly what to do:

The syntax of the .xscreensaver file is similar to that of the .Xdefaults file; for example, to set the timeout parameter in the .xscreensaver file, you would write the following:

 timeout: 5

whereas, in the .Xdefaults file, you would write

 xscreensaver.timeout: 5

If you change a setting in your X resource database, or if you want xscreensaver to notice your changes immediately instead of the next time it wakes up, then you will need to reload your .Xdefaults file, and then tell the running xscreensaver process to restart itself, like so:

xrdb < ~/.Xdefaults
xscreensaver-command -restart

Don't forget the xrdb step, changes to resource files need to be imported.

You don't need to enter every setting into your .Xdefaults, only the changes relative to those set in the (system dependent) app-defaults. xrdb -all -query | grep xscreensaver will help.

Trading one configuration file for another isn't a great leap, but X resource files let you keep any and all resource-aware application settings together, and also offers dynamic configuration by way of pre-processing (e.g. dependent on host and client settings).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.