Linux Format - UK (2020-03)

(Antfer) #1
72 LXF260 March 2020 http://www.linuxformat.com

TUTORIALS Control config files


LibreOffice also stores some cache data here.
Chrome, the proprietary one, uses .cache/google-
chrome for its cache files, while the profiles that contain
quite a lot of cache information and is stored in your
.config/google-chrome directory.
Chromium has its standard files stored quite a bit
differently. It uses only the .config/chromium
directories to for its settings and cache.
GIMP uses .config/GIMP/ to store user settings,
crash-logs and cache. GIMP clears most of its data out
after it closes, though.
Blender uses .config/blender for your recent files
and user preferences, but has all temporary files in
/tmp and is pretty good at clearing out the space.
Most applications are good at clearing up their
storage in your home directory when quitting, but many
files are retained when uninstalling.

What’s it got in its .config?
Again, this directory is defined by the Freedesktop
standard as a place to put your application settings.
Many applications are already doing this, but not all.
Many of your LibreOffice settings are stored here,
and Blender has its configuration files stored here – one
directory per version!
For Inkscape, you can set your environment by
changing the correct file. That file is, as expected, in
~/.config/, more specifically inkscape/preferences.
xml. You can set all these files with the GUI, so check
what you have defined with Edit > Preferences and then
System inside Inkscape.
Outside of the config, you have many other files, and
some of your applications have both settings and cache
here. Make sure you find the one you have uninstalled
and erase any old files. Some of the stuff that you will
find are described below.

Go Gnome .gconf
The .gconf directories are used to control details about
Gnome. This includes your URL handlers, background
and some applications settings. These and the ones
numbered with a 2 at the end are more settings for your
desktop when you are running Gnome.
You also have all your shell configuration directly in
your home directory. The cache is seldom used, so just
make sure you have all your settings set correctly.
Below are the files for different shells:
Application files
Bash .bashrc, .bash, .profile,
Zsh .zshrc, .zlogin, .zprofile, .zshenv
Fish .config/fish

Other applications can often be a bit of a mess, but
things are looking up. Here is another useful example.
Firefox uses the standard that we know and are
familiar with – you can see the files for it described
below. Here is one example; Firefox has very few
settings in /etc, and most of it is personal settings,
including your profile.
The global files are, rather predictably, located in
/etc/firefox. These files set the global preferences for
how to handle protocols and for choosing a browser
startup homepage. The feature is mostly useful for
businesses or for kiosk settings.

.local files, for local users
The .local/share is a standard that the Freedesktop
organisation has created. It suggests that all
applications use the directory for user data.
This ties in with the rest of the directories defined by
the standard. Those are the ones mentioned earlier;
.config, .cache, and .local. The .local/share directory
is used for many applications, and you can find lots of
your personal data here. If you use mbsync – or most
email clients actually – then you will find all of your
emails here.
The .cache directory is there for non-essential data.
This data must be non-essential because the directory
can simply be emptied at the next boot or for many
other reasons.
Most of the time the .cache directory will not be
emptied, but never assume that it will be there when
you return from your coffee break. A good example are
browsers, which have an option to clear cache. You have
probably heard the advice to clear your cache when
things are going wrong, so be aware that any of your
private creations should never go here.
Many applications often put their non-volatile data in
the .cache directory. This can include downloaded data
that browsers need and also Blender data that’s used
during execution.
The idea is that this only helps your browser run
more smoothly – when data is on a web resource you
may not want to download it each time you are going to
use it. In these cases, the system uses .cache. Not all
applications adhere to this convention, though, so be
aware that it may be placed elsewhere.
Gnome has adopted this standard, so all cache
from Gnome is in its intended directories. This does
not mean that all applications running on Gnome leave
it in the .cache directory, but it is a good place to start
looking for it. Here are how some examples of where
applications store their cache.
LibreOffice stores its temporary files only in
/tmp, which sounds sensible to us. You have the
configuration files in ~/.config/libreoffice/4/.

A PRIMER ON STOW


When you want to keep track of your dotfiles, the hidden ones are
usually in your home directory. You can use several systems. Most of
them require many copy commands integrated into a bunch of
scripts. Some of these are also built with a scripting language you
may or may not use already.
If you have tried some of them, you will find Stow simpler to use
than most; it’s made to handle software packages efficiently, not the
same way your regular package manager does but independently.
It is intended for users who want to try out a new or beta program
without messing up the current installation. Simply put, Stow will
create symlinks to the appropriate place in your directory tree from
the directory you are in.
For the sake of personal configuration files, this is as easy as
creating your ~/dotfiles directory and running Stow from there. With
this system, you can also create one directory for each application
and run Stow from there. To do this, create a directory under ~/
dotfiles/vim. In this directory, copy in the vim dotfiles and run $ stow
vim. All the files in that directory are then symlinked back to your
home directory and everything works as normal.

If you just want
a backup of your
configuration
data and want it
secure, you can
get a Keybase
(https://
keybase.io)
account. It
has a fully
end-to-end
encrypted git
service. There,
you can even
store your new
masterpiece
without
worrying that
someone will
find it.

72 LXF260March 2020 7770March 2It’s0i2t


TUTORIALS Control config files


LibreOfficealsostoressomecachedatahere.
Chrome,theproprietaryone,uses.cache/google-
chromeforitscachefiles,whiletheprofilesthatcontain
quitealotofcacheinformationandisstoredinyour
.config/google-chromedirectory.
Chromiumhasitsstandardfilesstoredquiteabit
differently.Itusesonlythe.config/chromium
directoriestoforitssettingsandcache.
GIMPuses.config/GIMP/tostoreusersettings,
crash-logsandcache.GIMPclearsmostofitsdataout
afteritcloses,though.
Blenderuses.config/blenderforyourrecentfiles
anduserpreferences,buthasalltemporaryfilesin
/tmpandisprettygoodatclearingoutthespace.
Mostapplicationsaregoodatclearinguptheir
storageinyourhomedirectorywhenquitting,butmany
filesareretainedwhenuninstalling.

What’sitgotinits.config?
Again,thisdirectoryisdefinedbytheFreedesktop
standardasaplacetoputyourapplicationsettings.
Manyapplicationsarealreadydoingthis,butnotall.
ManyofyourLibreOfficesettingsarestoredhere,
andBlenderhasitsconfigurationfilesstoredhere–one
directoryperversion!
ForInkscape,youcansetyourenvironmentby
changingthecorrectfile.Thatfileis,asexpected,in
~/.config/,morespecificallyinkscape/preferences.
xml.YoucansetallthesefileswiththeGUI,socheck
whatyouhavedefinedwithEdit>Preferencesandthen
SysteminsideInkscape.
Outsideoftheconfig,youhavemanyotherfiles,and
someofyourapplicationshavebothsettingsandcache
here.Makesureyoufindtheoneyouhaveuninstalled
anderaseanyoldfiles.Someofthestuffthatyouwill
findaredescribedbelow.

GoGnome.gconf
The.gconfdirectoriesareusedtocontroldetailsabout
Gnome.ThisincludesyourURLhandlers,background
andsomeapplicationssettings.Theseandtheones
numberedwitha 2 attheendaremoresettingsforyour
desktopwhenyouarerunningGnome.
Youalsohaveallyourshellconfigurationdirectlyin
yourhomedirectory.Thecacheisseldomused,sojust
makesureyouhaveallyoursettingssetcorrectly.
Belowarethefilesfordifferentshells:
Application files
Bash .bashrc,.bash,.profile,
Zsh .zshrc,.zlogin,.zprofile,.zshenv
Fish .config/fish

Other applications can often be a bit of a mess, but
things are looking up. Here is another useful example.
Firefox uses the standard that we know and are
familiar with – you can see the files for it described
below. Here is one example; Firefox has very few
settings in /etc, and most of it is personal settings,
including your profile.
The global files are, rather predictably, located in
/etc/firefox. These files set the global preferences for
how to handle protocols and for choosing a browser
startup homepage. The feature is mostly useful for
businesses or for kiosk settings.

.local files, for local users
The .local/share is a standard that the Freedesktop
organisation has created. It suggests that all
applications use the directory for user data.
This ties in with the rest of the directories defined by
the standard. Those are the ones mentioned earlier;
.config, .cache, and .local. The .local/share directory
is used for many applications, and you can find lots of
your personal data here. If you use mbsync – or most
email clients actually – then you will find all of your
emails here.
The .cache directory is there for non-essential data.
This data must be non-essential because the directory
can simply be emptied at the next boot or for many
other reasons.
Most of the time the .cache directory will not be
emptied, but never assume that it will be there when
you return from your coffee break. A good example are
browsers, which have an option to clear cache. You have
probably heard the advice to clear your cache when
things are going wrong, so be aware that any of your
private creations should never go here.
Many applications often put their non-volatile data in
the .cache directory. This can include downloaded data
that browsers need and also Blender data that’s used
during execution.
The idea is that this only helps your browser run
more smoothly – when data is on a web resource you
may not want to download it each time you are going to
use it. In these cases, the system uses .cache. Not all
applications adhere to this convention, though, so be
aware that it may be placed elsewhere.
Gnome has adopted this standard, so all cache
from Gnome is in its intended directories. This does
not mean that all applications running on Gnome leave
it in the .cache directory, but it is a good place to start
looking for it. Here are how some examples of where
applications store their cache.
LibreOffice stores its temporary files only in
/tmp, which sounds sensible to us. You have the
configuration files in ~/.config/libreoffice/4/.

A PRIMERONSTOW


When you want to keep track of your dotfiles, the hidden ones are
usually in your home directory. You can use several systems. Most of
them require many copy commands integrated into a bunch of
scripts. Some of these are also built with a scripting language you
may or may not use already.
If you have tried some of them, you will find Stow simpler to use
than most; it’s made to handle software packages efficiently, not the
same way your regular package manager does but independently.
It is intended for users who want to try out a new or beta program
without messing up the current installation. Simply put, Stow will
create symlinks to the appropriate place in your directory tree from
the directory you are in.
For the sake of personal configuration files, this is as easy as
creating your ~/dotfiles directory and running Stow from there. With
this system, you can also create one directory for each application
and run Stow from there. To do this, create a directory under ~/
dotfiles/vim. In this directory, copy in the vim dotfiles and run $ stow
vim. All the files in that directory are then symlinked back to your
home directory and everything works as normal.

If youjustwant
a backupofyour
configuration
dataandwantit
secure,youcan
geta Keybase
(https://
keybase.io)
account.It
hasa fully
end-to-end
encryptedgit
service.There,
youcaneven
storeyournew
masterpiece
without
worryingthat
someonewill
findit.
Free download pdf