Pages

Showing posts with label gtk. Show all posts
Showing posts with label gtk. Show all posts

August 21, 2015

Fixing Qt5 themes in Xfce

A lot of my Qt apps (e.g., qpdfview, VLC) recently stopped respecting my GTK theme. I did some checking, and it turns out they are all Qt5 apps. Google led me to the QT5 apps don't obey GTK theme settings post at the Manjaro Linux forum, which has some interesting things to say (generally applicable to all distributions).

What I eventually did was add:

# Workaround for Qt5 app theming.
export QT_STYLE_OVERRIDE=gtk


to the end of my my .profile, logout and log back in. Works now.

June 11, 2011

Colorful GNOME-colors

One of my favorite icon sets is the GNOME-colors series. The shapes, contrast, perspectives, and luster (not too shiny) are all just right. One thing that wish it had a bit more of though was color diversity. When you use gnome-brave, for example, things become just a bit too blue for my taste. And I don't mean from just an aesthetic perspective--it impacts usability for me as well.

So, I wrote a little (translation: longish) script that will make a new hybrid icon set from all the icon sets in the whole GNOME-colors pantheon. The script was written for Ubuntu/Debian and is I hope self explanatory. The basic idea is that it makes a copy of one of the sets (I chose gnome-brave because it's closest to what I want) and then selectively copies over the bits from the other sets. Hacking the script for other distributions and/or local installations should be pretty straight forward. The script includes a full list of the icons that are part of the Ubuntu package; ones that do not deviate from the default are commented out.

After running the script, you will have to move the directory it generates to ~/.icons or to /usr/local/share/icons.

Odd and pesky details:
  • Requires at least bash 4.  
  • Assumes you have the gnome-colors package installed.
  • Don't try running this from within Geany. For some reason, Geany chokes on declare -A statements. It works just fine if you run it inside a terminal.
You can download the script from http://download.tuxfamily.org/skinny/misc/make-gnome-colors-hybrid.sh. I would show it here except that I'm tired of fighting Blogger's inability to properly implement pre and code tags or provide some other means of sharing code without messing it up.

June 17, 2010

(No) icons in GTK buttons

I don't know if this has anything to do with the no icons in menus issue, but the solution is darned near the same. I noticed that my Ubuntu Karmic doesn't serve up icons in its buttons with GTK apps in GNOME. The fix comes from someone trying remove his icons:
There is now a new key in GNOME Configurator Editor. Below are the steps to disable buttons on icons in GNOME 2.26 and above.
  1. Press Alt + F2
  2. Type gconf-editor and hit Enter.
  3. Go to Desktop –> GNOME –> Interface
  4. Uncheck the key buttons_have_icons

Just check the box to get your icons back.

November 22, 2009

Different GTK settings for different sessions

Here's the situation:

You like using different window managers for different things. For example, sometimes you want to use IceWM, other times Openbox, etc. This is easy enough to do if you are using GDM, but there's a small thing that bothers you. All the above WMs will use the same configuration files for GTK settings, but you want to use different settings for each. For example, in Openbox you may want to use Tango icons but you like the default Gnome icons better in IceWM.

I describe below a way you can make this happen. It's a tiny bit hackish, but it seems to work just fine. It assumes you are not using gnome-settings-daemon.

GTK settings--the easy way

First of all, make life easy for yourself and install LXAppearance. It is part of the LXDE desktop environment, but many distributions let you install it as a standalone package. It is the best tool I know of to adjust GTK appearance settings. You do not need LXAppearance to do what I describe below, but you will love life a little more if you have it.

Different settings per Window Manager

Here's where the fun begins. This should work with any WM that has a startup script (required) and a shutdown script (strongly recommended but not strictly necessary). I used IceWM to test the idea.

GTK settings are stored in the .gtkrc-2.0 file in your home directory. What we are going to do at startup is redirect this by doing the following:
  • create a file .gtkrc-icewm-2.0 to store the GTK settings for icewm
  • copy the original .gtkrc-2.0 file to a backup location.
  • delete the original .gtkrc-2.0 file
  • then create a link from .gtkrc-2.0 to .gtkrc-icewm-2.0
And at session end, we will:
  • remove the link, and
  • restore the backed up .gtkrc-2.0
There are a few test we should do in the process to make sure we don't mess anything up. Below are experts from my ~/.icewm/startup and ~/.icewm/shutdown files that outline the needed tests.

Excerpt from ~/.icewm/startup:
### This section lets icewm use its own gtk settings ###
# it uses the following files
# .gtkrc-2.0 original gtk settings file
# .gtkrc-icewm-2.0 file where gtk settings for icewm session are stored
# .gtkrc-2.0-orig.BAK file where original .gtkrc-2.0 is stored
#
# if .gtkrc-icewm-2.0 doesn't exist, make it
if [ ! -f ~/.gtkrc-icewm-2.0 ] ; then
if [ -f ~/.gtkrc-2.0 ] ; then
cp ~/.gtkrc-2.0 ~/.gtkrc-icewm-2.0
else
touch ~/.gtkrc-icewm-2.0
fi
fi

# if .gtkrc-2.0 is a regular file, move .gtkrc-2.0 to a backup file,
# then link to .gtkrc-icewm-2.0. (This should be undone in shutdown.)
if [ -f ~/.gtkrc-2.0 ] ; then
cp ~/.gtkrc-2.0 ~/.gtkrc-2.0-orig.BAK
ln -sf ~/.gtkrc-icewm-2.0 ~/.gtkrc-2.0
fi
#
### end gtk settings stuff
Excerpt from ~/.icewm/shutdown:
# if .gtkrc-2.0 is a link then remove link and restore backed up .gtkrc-2.0
if [ -h ~/.gtkrc-2.0 ] ; then
rm ~/.gtkrc-2.0
cp ~/.gtkrc-2.0-orig.BAK ~/.gtkrc-2.0
fi
If you don't do the shutdown bits, then the link to the .gtkrc-icewm-2.0 file will remain in place when you start a session in a different WM. This means that every WM you use that doesn't use gnome-settings-daemon (and maybe xfce-mcs-manager) must do a restore on startup if things are not to get really wonky.