Showing posts with label lubuntu. Show all posts
Showing posts with label lubuntu. Show all posts

Friday, January 20, 2012

GTK Theme is not being followed by all GTK Applications (on LXDE)

On my LXDE (Ubuntu Oneiric 11.10) setup, I have recently discovered that not all GTK applications are getting themed with the GTK theme (Adwaita) of my preference. 

My first obvious attempt was to reset theme with LXDE Menu > Preferences > Customize Look and Feel. I set Adwaita in the "Gadget" tab. That Didn't help. Many "sudo" applications along with some other normal GTK-3.0 applications (e.g. evince) stills stayed un-themed.


Ubuntu repository apparently has two tools to set GTK-2.0 themes:
  1. gtk-chtheme
  2. gtk-theme-switch
Gtk-chtheme is much better in my opinion. So, I gave it a shot and selected "Adwaita" from the list of installed GTK theme. Still no change.

Then as a last resort, I wanted check which GTK theme files are actually being accessed during the initialization of the applications. For that, I started Evince from the console with strace as below:
strace -e trace=access evince 2>&1 | less
After a quick checking through the output it was obvious that my GTK-3.0 themes are not being found by the applications and the theme files are being searched for both in:
  1. /home/USER-NAME/gtk-3.0
  2. /home/USER-NAME/.config/gtk-3.0
On Ubuntu, GTK themes are installed in /usr/share/themes. So, the quick, easy and clean solution to the problem was to create a sym-link to the GTK-3.0 theme of my preference as shown below:

ln -s /usr/share/themes/THEME-NAME/gtk-3.0 /home/USER-NAME/gtk-3.0
ln -s /usr/share/themes/THEME-NAME/gtk-3.0 /home/USER-NAME/.config/gtk-3.0

After creating the sym-links, I restarted Evince and voila! it's perfectly themed with Adwaita now.


P.S.
If you ware selecting another themes other than Adwaita, make sure /usr/share/themes/THEME-NAME/gtk-3.0 actually exists. Not all themes in /usr/share/themes/ are GTK-3.0 compatible and they will miss the gtk-3.0 directory inside the theme folder.

Tuesday, October 18, 2011

Changing Gnome-Screensaver Background on Lubuntu 11.10 (Oneiric)

I had to find a way on Lubuntu flavoured LXDE to lock/unlock the current running desktop session. The obvious easy way is to use xscreensaver and/or gnome-screensaver and do one of the following:
xscreensaver-command -lock
gnome-screensaver-command --lock
I chose to keep with gnome-screensaver since it is prettier. But immediate annoyance was after locking screen, gnome-screensaver would not retain the same background as current Lubuntu session. After trying so many options (gconf, editing files in /etc), finally I figured - the solution is rather easy.

It appears Lubutu session keeps a separate sets of options from LXDE. When gnome-screensaver is launched, it takes the background option of LXDE (not Lubuntu). To match same background both on LXDE and Lubuntu, which also matches gnome-screensaver background inside Lubuntu session, the steps are below:
  1. Set preferred desktop background on running Lubuntu session by right-click > Desktop Preferences > Background.
  2. Log-out from Lubuntu session.
  3. On the log-in prompt, select LXDE as desktop session to log into.
  4. Once inside LXDE, you'll see the desktop background that gnome-screensaver uses as background.
  5. From the right-click menu, change the background to match your preference.
That's all !!! Now, you can log in back into Lubuntu and lock screen by initiating gnome-screensaver (I use a Compiz command shortcut with Ctrl+Alt+L which triggers "gnome-screensaver-command --lock") and desktop background will match.

LightDM Fails to Load with (L)ubuntu Oneiric (11.10)

After my migration from default Ubuntu with Unity and Gnome3 to Lubuntu with LXDE and OpenBox, I realized I have managed to sacrifice beautiful LightDM, the new default login manager on 11.10 and instead, running not so pretty LXDM.

After realizing that LightDM is missing the first thing to do was obviously:
sudo apt-get install lightdm
Followed by:
sudo dpkg-reconfigure lightdm
sudo service lxde stop
sudo service lightdm start
Not much to my surprise on 11.10, LightDM didn't start. After a little digging through the log files located at /var/log/lightdm, I came across the following:

"lightdm can not write to /var/lib/lightdm/.Xauthority"

Time to check /var/lib/lightdm directory:

[11:13:26] user@machine:[/var/lib/lightdm]$ sudo ls -alh
total 44K
drwxr-x---  9  109  130 4.0K 2011-10-14 20:08 .
drwxr-xr-x 74 root root 4.0K 2011-10-17 16:56 ..
drwx------  4  119  136 4.0K 2011-10-14 15:28 .cache
drwx------  4  119  136 4.0K 2011-10-14 15:28 .config
drwx------  3  119  136 4.0K 2011-10-14 15:28 .dbus
-rw-------  1  119  136   16 2011-10-14 15:32 .esd_auth
drwx------  2  119  136 4.0K 2011-10-14 18:29 .gconf
-rw-------  1  119  136    0 2011-10-14 19:55 .goutputstream-54JJ3V
drwx------  2  119  136 4.0K 2011-10-14 15:28 .gvfs
drwxrwxr-x  3  119  136 4.0K 2011-10-14 15:32 .local
drwx------  2  119  136 4.0K 2011-10-14 16:22 .pulse
-rw-------  1  119  136  256 2011-10-14 15:32 .pulse-cookie
-rw-------  1  119  136    0 2011-10-14 20:08 .Xauthority


After checking /etc/passwd and /etc/group, it confirmed that somehow user-id 119 and groupd-id 136 has gone missing from my system. So, as a quick roll-back, I did the following:

sudo apt-get remove --purge lightdm
sudo mv /var/lib/lightdm /var/lib/lightdm.bak
sudo apt-get install lightdm
sudo service lxdm stop
sudo apt-get remove --purge lxdm
sudo service lightdm start

Voila, LightDM showed up with a nice log-in prompt. Re-installing LightDM, added a new user and group with ids 109 and 130 respectively. Also, the ls output in /var/lib/lightdm looks correct.

[11:33:08] user@machine:[/var/log/lightdm]$ sudo ls -al /var/lib/lightdm/
total 44
drwxr-x---  9 lightdm lightdm 4096 2011-10-18 11:14 .
drwxr-xr-x 74 root    root    4096 2011-10-18 11:15 ..
drwx------  4 lightdm lightdm 4096 2011-10-18 11:14 .cache
drwx------  3 lightdm lightdm 4096 2011-10-18 11:14 .config
drwx------  3 lightdm lightdm 4096 2011-10-18 11:14 .dbus
-rw-------  1 lightdm lightdm   16 2011-10-18 11:14 .esd_auth
drwx------  5 lightdm lightdm 4096 2011-10-18 11:15 .gconf
d?????????  ? ?       ?          ?                ? .gvfs
drwxrwxr-x  3 lightdm lightdm 4096 2011-10-18 11:14 .local
drwx------  2 lightdm lightdm 4096 2011-10-18 11:14 .pulse
-rw-------  1 lightdm lightdm  256 2011-10-18 11:14 .pulse-cookie
-rw-------  1 lightdm lightdm   49 2011-10-18 11:14 .Xauthority



Edit (20 Jan 2012):
I stumbled into another problem with LightDM after uninstalling gnome-settings-daemon. It looks like the background file to set for LightDM is requested through gnome-settings-daemon for some reason on my system. So, if you have the same problem, a quick apt-get install gnome-settings-daemon will solve the problem.