You are not logged in.
Hi,
I need help customizing Desktop items name lenght, color, text shadow, etc.
I am using XFCE 4.14.
In XFCE 4.10, I used to past this code inside this file:
/usr/share/themes/"THEME-NAME"/gtk-2.0/gtkrc
But that was for GTK2 themes.
But now, in XFCE 4.14, the themes are GTK3 and so the file now is a differente file type (css):
/usr/share/themes/"THEME-NAME"/gtk-3.0/gtk.css
=============================================
This was the specific code I used in XFCE 4.10:
/usr/share/themes/"THEME-NAME"/gtk-2.0/gtkrc
style "xfdesktop-icon-view" {
XfdesktopIconView::label-alpha = 0
XfdesktopIconView::selected-label-alpha = 75
#wrap icon text 0=no, 1=yes
XfdesktopIconView::ellipsize-icon-labels = 0
XfdesktopIconView::tooltip-size = 128
#text shadow (black, in this example; to be readable in white backgrounds)
XfdesktopIconView::shadow-x-offset = 1
XfdesktopIconView::shadow-y-offset = 1
XfdesktopIconView::shadow-color = "#000000"
XfdesktopIconView::selected-shadow-x-offset = 1
XfdesktopIconView::selected-shadow-y-offset = 1
XfdesktopIconView::selected-shadow-color = "#000000"
XfdesktopIconView::cell-spacing = 0
XfdesktopIconView::cell-padding = 2
#text lenght (= 4 times the icon size, in this example)
XfdesktopIconView::cell-text-width-proportion = 4
#text color (white, in this example)
base[NORMAL] = "#FFFFFF"
base[SELECTED] = "#FFFFFF"
base[ACTIVE] = "#FFFFFF"
fg[NORMAL] = "#FFFFFF"
fg[SELECTED] = "#FFFFFF"
fg[ACTIVE] = "#FFFFFF"
}
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"
=============================================
Could someone please help me write the code to achieve this on GTK3,
or give me instructions on how to accomplish this?
Queen - Megadeth - Metallica - 80's
Offline
Bump
Queen - Megadeth - Metallica - 80's
Offline
Have a look at this thread for info on the GTK3 version of those settings to get you started. The color settings are missing from that post, I'll try to document them later.
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
Did some more testing and found out the following.
Consider the following gtk.css snippet:
/* xfdesktop rubberband */
XfdesktopIconView.view .rubberband {
border: 1px solid #1a74d3;
border-radius: 0;
background-color: rgba(26, 116, 211, 0.2); }
/* default state */
XfdesktopIconView.view {
-XfdesktopIconView-ellipsize-icon-labels: 1;
-XfdesktopIconView-tooltip-size: 32;
-XfdesktopIconView-cell-spacing: 4;
-XfdesktopIconView-cell-padding: 12;
-XfdesktopIconView-cell-text-width-proportion: 3.8;
background: transparent;
color: #fcfcfc;
border-radius: 3px; }
/* active (selected) state */
XfdesktopIconView.view:active {
background: rgba(23, 104, 189, 0.5);
text-shadow: 0 1px 1px black; }
/* default label state */
XfdesktopIconView.view .label {
background: rgba(255, 0, 0, 1.0);
text-shadow: 1px 1px 2px black; }
/* active (selected) label state */
XfdesktopIconView.view .label:active {
color: yellow;
background: rgba(255, 0, 0, 0.5);
text-shadow: 1px 3px 3px blue; }
Here is the gtk2 snippet. Towards the right of each tweak is where the corresponding GTK3 snippet is located in the above.
style "xfdesktop-icon-view" {
XfdesktopIconView::label-alpha = 75 // XfdesktopIconView.view .label > background
XfdesktopIconView::selected-label-alpha = 100 // XfdesktopIconView.view .label:active > background
XfdesktopIconView::ellipsize-icon-labels = 1 // -XfdesktopIconView-ellipsize-icon-labels (broken)
XfdesktopIconView::tooltip-size = 128 // -XfdesktopIconView-tooltip-size (only affects icon size)
XfdesktopIconView::shadow-x-offset = 1 // XfdesktopIconView.view .label > text-shadow
XfdesktopIconView::shadow-y-offset = 1 // XfdesktopIconView.view .label > text-shadow
XfdesktopIconView::shadow-color = "#ff0000" // XfdesktopIconView.view .label > text-shadow
XfdesktopIconView::selected-shadow-x-offset = 2 // XfdesktopIconView.view .label:active > text-shadow
XfdesktopIconView::selected-shadow-y-offset = 2 // XfdesktopIconView.view .label:active > text-shadow
XfdesktopIconView::selected-shadow-color = "#00ff00" // XfdesktopIconView.view .label:active > text-shadow
XfdesktopIconView::cell-spacing = 6 // -XfdesktopIconView-cell-spacing
XfdesktopIconView::cell-padding = 6 // -XfdesktopIconView-cell-padding
XfdesktopIconView::cell-text-width-proportion = 2.5 // -XfdesktopIconView-cell-text-width-proportion
base[NORMAL] = "#00ff00" // color & background (dependent on state)
base[SELECTED] = "#5050ff" // color & background (dependent on state)
base[ACTIVE] = "#0000ff" // color & background (dependent on state)
fg[NORMAL] = "#ff0000" // color & background (dependent on state)
fg[SELECTED] = "#ff0000" // color & background (dependent on state)
fg[ACTIVE] = "#ff0000" // color & background (dependent on state)
}
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"
A couple don't seem to work for me anymore: ellipsize and tooltip size. I'll need to look more closely into those.
There is also a new "XfdesktopIconView.view .rubberband" entity that controls the behaviour of the selection box when you drag on the desktop to select multiple icons.
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
Thank you very much, ToZ.
For others wanting the same thing, here is the settings I defined.
They may be useful:
add this to file:
/home/USER/.config/gtk-3.0/gtk.css
or
/usr/share/themes/THEME/gtk-3.0/gtk.css
/* xfdesktop rubberband */
XfdesktopIconView.view .rubberband {
//left-click mouse drag line
border: 1px solid #1a74d3;
border-radius: 0;
background-color: rgba(26, 116, 211, 0.2); }
/* default state */
XfdesktopIconView.view {
-XfdesktopIconView-ellipsize-icon-labels: 1;
-XfdesktopIconView-tooltip-size: 32;
-XfdesktopIconView-cell-spacing: 4;
-XfdesktopIconView-cell-padding: 0;
-XfdesktopIconView-cell-text-width-proportion: 4;
background: transparent;
//letters colors
color: #FFFFFF;
//radius, letter box corners
border-radius: 3px; }
/* active (selected) state */
XfdesktopIconView.view:active {
background: rgba(0, 0, 0, 0);
text-shadow: 0 1px 1px black; }
/* default label state */
XfdesktopIconView.view .label {
background: rgba(0, 0, 0, 0);
text-shadow: 1px 1px 2px black; }
/* active (selected) label state */
XfdesktopIconView.view .label:active {
color: white;
background: rgba(0, 0, 0, 0.2);
text-shadow: 0px 1px 1px black; }
Last edited by jack_the_pirate (2019-08-27 09:36:29)
Queen - Megadeth - Metallica - 80's
Offline
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 545.73 KiB (Peak: 546.57 KiB) ]