Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-10-07 18:13:13

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

adding themes

I see Settings > Appearance show a small selection of themes and Settings > Window Manager show a different selection, what's the difference?  Also, in 'user/share/themes' there's maybe a dozen showing, but not all are displayed by xfce in either of the Settings windows above.  How can I add some of these new themes, or will that not be possible?  In the 'Appearance' window there's the option to add themes, but navigating to 'user/share/themes/...' doesn't seem to find anything that can be used.

Offline

#2 2022-10-08 00:21:21

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: adding themes

The Appearance (Gtk) themes must have a "gtk-3.0" folder off the theme's root for it to be recognized and displayed in the list. The Window Manager theme needs to have an "xfwm4" folder for it to be recognized  and displayed in that list. You can also have  other themes: "xfce4-notify-4.0" for notification themes, and cursor themes. All of these may be listed in /usr/share/themes, but will only display on the appropriate dialog screens.

The "Add Theme" button in appearance is a quick way to select and install compressed theme packages (e.g. theme.tar.gz) that can be downloaded from the internet. These will be installed into ~/.themes.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2022-10-08 00:33:18

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: adding themes

Thanks.  I'm deciphering some of that information right now.  Where's the best place to download some of these packages?  I modified a theme once, but I've long since forgotten how I did it.  I want wider scrollbars and a more visible slider, is that going to be in /xfwm4 or in /gtk-3.0?  Funny the later directory seems to contain almost nothing in all themes I've checked so far:

0 /usr/share/themes/Adwaita/gtk-3.0 4 $ cat gtk.css
/* Adwaita is now part of GTK+ 3, this file is no longer used */

Offline

#4 2022-10-08 01:52:56

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: adding themes

rayandrews wrote:

Where's the best place to download some of these packages?

xfce4-look.org is a good place. 

I modified a theme once, but I've long since forgotten how I did it.  I want wider scrollbars and a more visible slider, is that going to be in /xfwm4 or in /gtk-3.0?

The scrollbar is part of the GTK Appearance theme. Here are some helpful links:
- add steppers to the scrollbar
- remove overlay (hiding) scrollbars
- scrollbar tweaking
- wider scrollbar
- scrollbar slider width and steppers
See if any of these work as a start.

0 /usr/share/themes/Adwaita/gtk-3.0 4 $ cat gtk.css
/* Adwaita is now part of GTK+ 3, this file is no longer used */

Adwaita is actually the default built-in theme of GTK3 - meaning the gtk.css is embedded directly into GTK3. There is a coded Adwaita theme that you can install - it would be in a package like gnome-themes-extra (but your distro might package it under a different name).


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2022-10-08 18:30:59

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: adding themes

Thanks.  Much to learn.  It seems the themes we see are all variations on some other something because Awaita in particular, the files in the directory contain almost nothing.  I suppose I'll be adding modifications.  Yeah, I hate the tiny scrollbars and I want to see them all the time, even on unfocused windows.

Offline

#6 2022-10-09 00:55:44

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: adding themes

Those tweeks give me something to chew on.  I'll fiddle around a bit then ask how I can change the slider colors and the color of the menubar of the active window, I want a bit more contrast ... but let me see what I can do myself :-)

Offline

#7 2022-10-09 03:12:39

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: adding themes

Sheesh, it takes so long by trial and error, you hafta restart xfce after every change to see the effect.

# Didn't figure out what this does:
scrollbar button {padding: 0}
# One of these guys throws an error:
{
        -XfceTasklist-max-button-length: 1500;
        -GtkScrollbar-has-backward-stepper: true;
        -GtkScrollbar-has-forward-stepper: true;
}
# This works:
scrollbar slider {
     min-width: 20px;
}
# Didn't figure out what this does:
scrollbar slider:disabled { background-color: #ff00ff; }

# These are imported from my home-made theme, just to see what they'd do and they do turn an active slider blue:

@define-color scrollbar_slider #ff00ff;
@define-color scrollbar_slider_prelight #00ff00;
/* no effect */
@define-color scrollbar_slider_active #0000ff;
@define-color scrollbar_slider_insensitive #ffff00;

/*@define-color scrollbar_slider_unfocused @theme_unfocused_bg_color;*/
/* no effect */
@define-color scrollbar_slider_unfocused #ff0000;

/*@define-color switch_slider_color #eeeeec;*/
@define-color switch_slider_color #ff0000;
------------------------------
... I was commenting them out one at a time looking for action, but it's such slow going.

There's a contribution to the project coming down the wire if you can show me how to:

-Get the active window title bar bright blue (say).  One of the themes already does that.  Nice to be sure what's active, I want it to stand out.

-The four icons at the right, it would be nice to have them bigger.

Scroll bars:

-Up and down arrows.  (Are these 'steppers'?)

-Scroll bars wider (like the 20px in the sample above)

-Scroll bars *always* visible, active window or not.

-Four colors if possible (this worked in my theme, but my theme doesn't really work anymore, it seems things have changed too much.)

-Inactive window, some light color
-Active window, something darker
-Mouse pointer on the scrollbar, some bright color
-Scrollbar active -- left button down and slider moving -- some other bright color.

... if the above can be done I'll be happy as a clam.  I'm running out of issues! :-)

Offline

#8 2022-10-09 12:17:10

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: adding themes

rayandrews wrote:

# One of these guys throws an error:
{
        -XfceTasklist-max-button-length: 1500;
        -GtkScrollbar-has-backward-stepper: true;
        -GtkScrollbar-has-forward-stepper: true;
}

Add the scrollbar designator to the beginning (also remove the tasklist entry):

scrollbar {
        -GtkScrollbar-has-backward-stepper: true;
        -GtkScrollbar-has-forward-stepper: true;
}

-Get the active window title bar bright blue (say).  One of the themes already does that.  Nice to be sure what's active, I want it to stand out.

Depends on the type of window. If it is a SSD window (not GTK3 CSD), then you would make the change in the xfwm4 theme. If it is a GTK3 CSD window, then you would target the ".csd" "headerbar" and ".default-decoration" elements/assets.

-The four icons at the right, it would be nice to have them bigger.

Which four icons are you referring to?

Scroll bars:

Have a look at this page for a good example.

-Scroll bars *always* visible, active window or not.

Add the following to ~/.config/gtk-3.0/settings.ini:

gtk-overlay-scrolling = false

Make sure that the first line of this file reads:

[Settings]

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2022-10-09 12:59:11

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: adding themes

"Depends on the type of window."

Sheesh, where does one learn all this?  I mean a 'window' at the level of xfce itself, that will always have the same title bar, borders and standard icons -- the four you always see at the very right of the title bar: minimize, maximize, close, and ... don't know the name of the other one, but they are always the same four.  I remember that I changed those at the '/xfce4' location but I forget how I edited the little graphics. The whole thing was so experimental at the time that I neglected to take proper notes cuz I wasn't sure what was going to work at all.  Seems '/xfce4' is graphics, and the 'other stuff' is more like 'instructions'.  God knows how it all comes together.  I'd do my own research if I was sure of the right doc -- up to date, relevant and complete.  The problem with internet searches is that you get 10  million hits and 999,990 of them are junk.

Offline

#10 2022-10-09 17:24:33

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: adding themes

Prior to Xfce 4.14, Xfce components and apps used "Server Side Decorations" - meaning the window manager managed the window decorations (titlebar, min/max/close buttons, titlebar icon). Gnome, in version 3 introduced the concept of "Client Side Decorations" - the big difference being that the applications itself (not the window manager) now drew those same decorations and the window manager had no access to them.

Xfce 4.14 started to introduce some client side decorations in its dialogs boxes and some apps. Xfce 4.18 will include a flag to disable these. Nevertheless, most distros now use a combination of SSD, and CSD windows in the apps and components that they deliver, which makes theming more difficult.

If you are looking to theme, you'll need to consider both of these scenarios.
- SSD windows are themed, in Xfce, via the xfwm4 (window manager) theming functionalist (the theme's xfwm4 folder and .xpm/.png files). 
- CSD windows are themed via css directives in files like gtk.css.

Yes, its confusing. But there are some good themes out there that have figured it out (e.g. Greybird, Arc, to name a couple but there are more) and it might be a good idea to start with one of theme as a base and tweak from there.

Also, if interested, you can grab the source of the default Adwaita theme with something like this:

gresource extract $(locate -l 1 libgtk-3.so.0) /org/gtk/libgtk/theme/Adwaita/gtk-contained.css

Note: there are some utilities available like gtk-nocsd (that disable all CSD windows in GTK) and the environment variable "GTK_CSD=1" (that forces every window to have a CSD window) in case you are looking for consistency of window decoration management.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#11 2022-10-09 22:35:56

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: adding themes

"the big difference being that the applications itself (not the window manager) now drew those same decorations and the window manager had no access to them."

That would explain why Firefox is ignoring all my experiments but the xterm is obeying them.

"SSD, and CSD"  now I know what those expand to.  Anyway the previous set of changes do what I want, the main thing left is color for the scrollbars and the titlebar.  This winter I think I'll dive into this theming stuff in earnest.

Offline

#12 2022-10-10 22:18:42

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: adding themes

So I find out there's 'rc' files involved too, that expect shell syntax, not C syntax.  But good things there, like "inactive_text_color=#00ffff".  The only thing left is to control the slider colors and I can't poach the information anywhere. Complicated!

Offline

#13 2022-10-11 15:24:54

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: adding themes

Ok I figured it out with mostly trial and error.  Didn't help that *now* I learn that gtk2 uses a different syntax than gtk3 sad  Just in case some other guy wants to do the same sort of thing: In ~/.config/gtk-3.0/gtk.css:

scrollbar
{
    -XfceTasklist-min-button-length: 3000;
    /* Needed or else no buttons! */
    -GtkScrollbar-has-backward-stepper: true;
    -GtkScrollbar-has-forward-stepper: true;
}
scrollbar slider { min-width: 20px; }
scrollbar button {padding: 6px}

/* dark green: pointer is not in the active window */
scrollbar slider:backdrop { background-color: #00aa00; }
scrollbar button:backdrop { color: #00aa00; }

/* green: pointer is in the active window but not on the slider/button */
scrollbar slider { background-color: #00ff00; }
scrollbar button { color: #00ff00; }

/* dark red: pointer is hovering over slider/button, but mouse button not pressed */
scrollbar slider:hover { background-color: #aa0000; }
scrollbar button:hover { color: #aa0000; }

/* red: slider/button is active */
scrollbar slider:hover:active { background-color: #ff0000; }
scrollbar button:active { color: #ff0000; }

/* slider maxed out, window active */
scrollbar button:disabled { color: white; }

/* slider maxed out, window inactive */
scrollbar button:backdrop:disabled { color: white; }

/* What is this? */
scrollbar button:checked { color: black; }

... Improvements welcome.

Offline

#14 2022-10-11 16:22:25

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: adding themes

Thanks for sharing the solution.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#15 2022-10-11 17:20:02

rayandrews
Member
From: Vancouver B.C. Canada
Registered: 2011-12-30
Posts: 177

Re: adding themes

Thanks for getting me pointed in something like the right direction.  But I couldn't find anything like a nice gtk tutorial, or some caveats, like that gtk2 has a totally different syntax, sheesh, my cutting and pasting crashed and burned over that many times.  I'd still like an overview of the whole subject.  Like why some config files use shell syntax.  But at least my scrollbars stay visible, and they aren't dull grey.  Dunno, these gtk people, they seem to think that because a window isn't active, that you don't care what's on it.  The titlebar greys out to the point that you can't see the title, why?  And I always want to know where I'm scrolled to on a doc in every window, focused or not. Why hide information? 

Oh, one remaining mystery is how to speed up scrolling using the steppers.  But I'm 99% happy.

Offline

Board footer

Powered by FluxBB