There is a pretty well-known issue in Linux (we'll be using Ubuntu as the example Linux distro in this article, although the problem isn't specific to Ubuntu), where a user-installed theme – which may look great – is not used at all in application opened as Root. This isn't necessarily a problem, of course. Some people have put forth the idea that it's a good thing for your Root applications – which can cause irreparable damage to your system, given the power that Root holds – and should look different, so you're aware of the fact.
However, for the purposes of this article, let's say you're aware of the dangers, and just want your root applications to not stick out. What do we mean by stick out? Let's say you've installed a nice dark theme for your computer. This is your Desktop, with a few applications running.
Now, later on you decide to use Synaptic to install a couple new applications, so you open it up. When it launches, however, it sticks out, because it isn't using the theme. It looks like this.
Ugly! Why does it look like this? Because most themes that the user installs are placed in a hidden folder inside the user's Home directory. This is great for most uses, but for programs launched as Root, the computer doesn't use those themes, or look in that folder. In fact, if you've created a look for your system that includes a theme, icons and even fonts that are user-installed, none of them will be used as Root.
Installing themes into /usr/share/themes/ – the system-wide themes folder, is the simplest solution for this, but has the drawback that the only person able to install themes on a computer is the Administrator. However, it will ensure that all themes work, even when a program is launched as root.
To make sure user-installed themes work as Root, the administrator can take the following steps.
First, launch the Terminal.
Now we have three commands to type. First type sudo ln -s /home/$ USER/.themes /root which will create a symbolic link to the user's hidden .themes folder and place it inside a root folder.
Since the .themes folder is now linked to Root, when an application is launched as Root, it can "see" the theme files and take advantage of them.
The next two commands are similar, linking two other folders, and have the same effect. We'll type sudo ln -s /home/$ USER/.icons /root to link user-installed icon themes to the root account, and sudo ln -s /home/$ USER/.fonts to link user-installed fonts to the Root account.
As you may have noticed (and this should be mentioned), this is something a user with Administrator privileges needs to do. A standard user can't accomplish this fix. This is good, as there is a possible security risk in linking a standard user folder to a root folder, although a small one, as only theme files should be in these folders.
Once you've applied those fixes, launch a program as root. Here's Synaptic once more, launched as root, only now our preferred theme choice was used.
Success! As mentioned, the simplest solution, the one that doesn't have any risk associated with it, is to simply install all your themes, fonts and icons in their shared folders (/usr/share/themes for themes, /usr/share/icons for icons and /usr/share/fonts for fonts). But if you want user-installed themes to be just that (for the users who installed them), then try this out. It works great.
No comments:
Post a Comment