Page 1 of 1

GTK-3.0 Themes - discussion, demos

Posted: Mon 01 Apr 2013, 21:32
by 01micko
Disclaimer

Puppy uses GTK-2.0 only as standard. This will not likely change in the immediate future. This info is provided FYI only and is "as is". ***NO WARRANTY***

Thunor has introduced gtk-3.0 support into gtkdialog and also briefly discussed themes. Thanks Thunor!

This thread is to discuss, improve and whatever else to do with gtk-3.0 support in puppy. to keep pollution out of the gtkdialog thread.

I have some tools to get you started

Download link

In there there is:
  • a hacked pet for chtheme, the prog we use to change gtk themes in puppy.. Thanks to pemasu for improvements. I have no idea if it works in Lupu, Racy whatever other than Slacko and I believe Upup-Raring.
  • some pets built by Thunor and myself for themes. There are some gtk-2.0 ones there, also some require clearlooks and murrine engines. Note, clearlooks is cut down, so if you want the full version make it yourself, Note: pets compiled in slacko so YMMV in other based pups. I'm sure some distro devs will pop in soon with links to distro specific themes/engines whatever.
  • Note: you will get many errors in your xerrs.log as many themes are incompatible with different versions of gtk3. Messy? Yes! Those skilled in CSS may want to go through and tidy some themes up, or roll your own. Not that difficult.
There will be no hand holding here. You are on your own to a certain degree.

-------------------------------------------------------------------------------------------------------

GTK3 themes use style sheets (css). Here's some info. Search for more.


--------------------------------------------------------------------------------------------------------

Here is a really basic script demonstrating how you can theme on the fly if you have a certain app that needs it's own theme (think along the lines of gtkdialog-splash).

NOTE: only a demo, and also I rename the executable to gtk3dialog, you do what you see fit.

Code: Select all

#!/bin/sh

# test for a new idea for on the fly gtk3 theming

ORIG_XDG=$XDG_CONFIG_HOME

[ -d /tmp/gtk3-theme/gtk-3.0 ] || mkdir -p  /tmp/gtk3-theme/gtk-3.0

XDG_CONFIG_HOME=/tmp/gtk3-theme

echo $XDG_CONFIG_HOME

text="$1"
color="$2"
fontsize="$3"
[ "$text" ] || text="Hello World"
[ "$color" ] || color=red
[ "$fontsize" ] || fontsize=20 

cat > /tmp/gtk3-theme/gtk-3.0/gtk.css <<_THEME
@define-color bg_color $color;

* {
    background-color: @bg_color;
    font: Dejavu Sans $fontsize;
}

_THEME

echo "<vbox>
  <text><label>\"$text\"</label></text>
  <hbox><button ok></button></hbox>
</vbox>"|gtk3dialog -s -c

XDG_CONFIG_HOME=$ORIG_XDG
echo $XDG_CONFIG_HOME
As usual.. have fun!

Posted: Mon 01 Apr 2013, 22:02
by pemasu
Hi 01micko. I tested your revisited gtk_chtheme_wrapper. It didnt work for me until I changed the gtk3 part as below:

Code: Select all

if [ "$GTK3THEME" ];then 
  [ -h ${XDG_CONFIG_HOME}/gtk-3.0 ] && rm -f ${XDG_CONFIG_HOME}/gtk-3.0
  ln -s "$GTK3THEME" ${XDG_CONFIG_HOME}/gtk-3.0
fi 
then the symlink swapping to the new choice worked.

I attach my found Gtk2-gtk3 matching themes

I am gonna include that Shimmer ie birdies themes....Graybird one to next Upup Raring as default theme for gtk3. It needs gtk2 murrine engine...no need for gtk3 engine. It is close enough of gtk2 Aurora2 theme.
Murrine engine is not included in the pet.

The theme name Shimmer comes from the Ubuntu repo naming....in fact there is Graybird, Bluebird, Blackbird and Albatross gtk2 and gtk3 themes.
Cheers

Posted: Mon 01 Apr 2013, 22:11
by 01micko

Code: Select all

if [ "$GTK3THEME" ];then
  [ -h ${XDG_CONFIG_HOME}/gtk-3.0 ] && rm -f ${XDG_CONFIG_HOME}/gtk-3.0
  ln -s "$GTK3THEME" ${XDG_CONFIG_HOME}/gtk-3.0
fi 
pemasu, that is already in the pet! (not an edit :wink: ). I only just uploaded it.
01micko wrote:a hacked pet for chtheme, the prog we use to change gtk themes in puppy.. Thanks to pemasu for improvements.
:)

Posted: Mon 01 Apr 2013, 22:19
by simargl
.

Posted: Mon 01 Apr 2013, 22:21
by pemasu

Code: Select all

if [ "$GTK3THEME" ];then 
  [ -h ${XDG_CONFIG_HOME}/gtk-3.0 ] && rm -f ${XDG_CONFIG_HOME}/gtk-3.0/
  ln -s "$GTK3THEME" ${XDG_CONFIG_HOME}/ HERE I ADDED folder
fi 
I had to add to this revisited code the gtk-3.0 folder

It might be my setup which had that need. Anyway...not sure...so I posted.....

The code stucture was a little different in Barry`s upload, this one needed the gtk-3.0 folder addition.

I got this before adding that folder to the end of the line:
rm: cannot remove ‘/root/.config/gtk-3.0/’: Is a directory
ln: failed to create symbolic link ‘/root/.config/gtk-3.0’: File exists

Posted: Mon 01 Apr 2013, 22:26
by 01micko
simargl wrote:Just one suggestion: in first post you linked "Thunor has introduced gtk-3.0 support into gtkdialog" to this post
http://murga-linux.com/puppy/viewtopic. ... 722#695722

instead of what is correct
http://murga-linux.com/puppy/viewtopic. ... 399#695399
I see your point, but because this is more to do with theming I think I'll leave it, maybe change the wording. :wink:
Edit: ok put the link on "themes", not "gtkdialog".

Posted: Wed 03 Apr 2013, 11:24
by thunor
I'm just going to jot some stuff down here as I come across it in the GTK+ 3 Reference Manual.

These are the styling priorities (topmost has highest priority):

GTK_STYLE_PROVIDER_PRIORITY_USER
The priority used for the style information from ~/.gtk-3.0.css (unfortunately I haven't managed to get this to work and it would've been the CSS equivalent to ~/.gtkrc-2.0).

GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
A priority that can be used when adding a GtkStyleProvider for application-specific style information (this translates to using a C function to load a style sheet which I currently have working :) but I haven't committed it to the gtkdialog repository yet).

GTK_STYLE_PROVIDER_PRIORITY_SETTINGS
The priority used for style information provided via GtkSettings (this translates to the files within /etc/gtk-3.0/ or $XDG_CONFIG_HOME/gtk-3.0/ i.e. settings.ini and gtk.css where $XDG_CONFIG_HOME is ~/.config by default).

GTK_STYLE_PROVIDER_PRIORITY_THEME
The priority used for style information provided by themes (i.e. the files within /usr/share/themes/Adwaita/gtk-3.0/ or ~/.themes/Adwaita/gtk-3.0/).

GTK_STYLE_PROVIDER_PRIORITY_FALLBACK
The priority used for default style information that is used in the absence of themes (i.e. the horrid very thick very square very grey look).

There is a reference to ~/.gtkrc-3.0 here but I didn't get it to work and it does say that it's been deprecated and replaced by CSS presumably by ~/.gtk-3.0.css which doesn't work either :P

Posted: Wed 03 Apr 2013, 20:00
by Mobeus
If Puppy is to support gtk3 then maybe it would be a good idea to lock in to a specific gtk3 version and stay there. The reason I say this is that after reading up on themes it seems there are a lot of gnome theme creators that have given up in disgust over the way gtk3 theme support is being broken from version to version, even from 3.6.0 to 3.6.1 apparently. Some even say it is deliberate. Maybe that is why so few themes exist for gtk3 even though it is at v 3.8.0?

I don't know, just my 2 cents

Posted: Wed 03 Apr 2013, 21:02
by 01micko
@Thunor

Thanks for those thoughts and links.

I uploaded a new version of the chtheme pet yesterday that has a really simple method to at least find the background colour in a gtk-2.0 theme that has no gtk-3.0 equivalent (example: our home-grown themes) and apply that to settings.ini using Adwaita's settings.ini as a template. It's not fancy but at least gives some consistency as far as background colour goes. It uses a default "gray" for the widgets, like I said, not fancy!

@Mobeus.

Nice thought but impractical given that every different woofed puppy version (ie slacko based on slackware-14.0, upup based on precise and raring) will get the native gtk3 version respective to it's parent distro, obviously all different.

I did fix one theme for slacko, MediterraneanTributeBlue (see cap) and boy wasn't that a chore! Won't happen again :lol: . I'll attach it, ymmv outside of Slacko 5.5 and derivatives. The package also includes the gtk-2.0 theme dependent upon murrine engine.

Posted: Fri 05 Apr 2013, 16:25
by simargl
.