GTK-3.0 Themes - discussion, demos

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

GTK-3.0 Themes - discussion, demos

#1 Post 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!
Attachments
capture4353.png
(4.56 KiB) Downloaded 2178 times
Last edited by 01micko on Tue 02 Apr 2013, 01:08, edited 2 times in total.
Puppy Linux Blog - contact me for access

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#2 Post 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
Attachments
shimmer-themes-gtk2-gtk3-murrine-engine-dependent-0.0.1.pet
(117.38 KiB) Downloaded 640 times

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#3 Post 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.
:)
Puppy Linux Blog - contact me for access

simargl

#4 Post by simargl »

.
Last edited by simargl on Sun 01 Sep 2013, 15:00, edited 1 time in total.

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#5 Post 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
Last edited by pemasu on Mon 01 Apr 2013, 22:34, edited 1 time in total.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#6 Post 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".
Puppy Linux Blog - contact me for access

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#7 Post 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

User avatar
Mobeus
Posts: 94
Joined: Thu 26 Aug 2010, 15:49

#8 Post 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
/root for the home team

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#9 Post 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.
Attachments
MediterraneanTributeBlue-0.1.tar.bz2
(72.4 KiB) Downloaded 461 times
Puppy Linux Blog - contact me for access

simargl

#10 Post by simargl »

.

Post Reply