Small Script to Change XFCE Desktop Font Color

Moderator: Forum moderators

Post Reply
User avatar
rockedge
Site Admin
Posts: 5746
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2023 times
Been thanked: 2110 times
Contact:

Small Script to Change XFCE Desktop Font Color

Post by rockedge »

There doesn't seem to be an easy way to change the desktop font color. This script does that. It does not have the set a shadow and the specs function yet.
Some more refinement from better coders will get this in KLV as a utility perhaps.

deskfontcolor.sh

Code: Select all

#! /bin/bash
#
# Xfce script for changing desktop font color
# name : deskfontcolor
# made by : secureIT modifed by : rockedge Dec-15-2022
# script needs these dependencies : yad
# put it in /usr/local/bin
# make it executeable and append it to a launcher
#
cd ~/.config/gtk-3.0/
#
# next command will look if the entry still exists
# if so, it will delete the entry and the 3 following lines that belongs to it
#
sed -i '/XfdesktopIconView.label {/,+3 d' ./gtk.css
#
# select font-color and write to variable color
#
color=`yad --title="Select FontColor" --color --center --button=OK:0`
#

# write entry to gtk.css
#
echo -e "XfdesktopIconView.label { 
color: $color; 
text-shadow: none; }" >> gtk.css
#
# Informs about the execution and asks if the user wants to log out
#
if yad \
    --image "dialog-question" \
    --title "Changes Done !" \
    --button=gtk-yes:0 \
    --button=gtk-no:1 \
    --text "Done ! The changes will take effect the next time you log in. Would you like to log out now ?"
then
    xfce4-session-logout
else
    exit 1
fi
Attachments
deskfontcolor.sh.gz
remove fake ".gz"
(1.03 KiB) Downloaded 22 times
User avatar
Sofiya
Posts: 1824
Joined: Tue Dec 07, 2021 9:49 pm
Has thanked: 1210 times
Been thanked: 1090 times

Re: Small Script to Change XFCE Desktop Font Color

Post by Sofiya »

dark text white shadow
the font is readable with both light and dark wallpapers

Code: Select all

#! /bin/bash
#
# Xfce script for changing desktop font color
# name : deskfontcolor
# made by : secureIT modifed by : rockedge Dec-15-2022
# script needs these dependencies : yad
# put it in /usr/local/bin
# make it executeable and append it to a launcher
#
cd ~/.config/gtk-3.0/
#
# next command will look if the entry still exists
# if so, it will delete the entry and the 3 following lines that belongs to it
#
sed -i '/XfdesktopIconView.label {/,+3 d' ./gtk.css
#
# select font-color and write to variable color
#
color=`yad --title="Select FontColor" --color --center --button=OK:0`
#

# write entry to gtk.css
#
echo -e "XfdesktopIconView.label { 
color: $color; 
text-shadow: 1 1 alpha (#ffffff, 0.8); }" >> gtk.css
#
# Informs about the execution and asks if the user wants to log out
#
if yad \
    --image "dialog-question" \
    --title "Changes Done !" \
    --button=gtk-yes:0 \
    --button=gtk-no:1 \
    --text "Done ! The changes will take effect the next time you log in. Would you like to log out now ?"
then
    xfce4-session-logout
else
    exit 1
fi
Attachments
deskfontcolor.sh.gz
(1.05 KiB) Downloaded 17 times
out1.jpg
out1.jpg (20.2 KiB) Viewed 189 times
Last edited by Sofiya on Fri Jan 13, 2023 11:23 am, edited 1 time in total.

Vanilla Dpup 9.2.X - KLV-Airedale - KLA-OT2
PUPPY LINUX Simple fast free

User avatar
Sofiya
Posts: 1824
Joined: Tue Dec 07, 2021 9:49 pm
Has thanked: 1210 times
Been thanked: 1090 times

Re: Small Script to Change XFCE Desktop Font Color

Post by Sofiya »

out of the box gtk-theme-config . also changes the font color on the desktop
the program creates a gtk.css file /root/.config/gtk-3.0/gtk.css

Code: Select all

/* Custom styles */

/* select-on */
@define-color selected_bg_color #ffffff;
@define-color selected_fg_color #000000;
@define-color theme_selected_bg_color @selected_bg_color;
@define-color theme_selected_fg_color @selected_fg_color;
/* select-on */

/* panel-off
@define-color panel_bg_color #cccccc;
@define-color panel_fg_color #333333;

PanelWidget,
PanelApplet,
PanelToplevel,
PanelSeparator,
PanelApplet > GtkMenuBar.menubar,
PanelApplet > GtkMenuBar.menubar.menuitem,
PanelMenuBar.menubar,
PanelMenuBar.menubar.menuitem,
PanelAppletFrame,
UnityPanelWidget,
.gnome-panel-menu-bar,
.unity-panel {
	background-image: -gtk-gradient(linear,left top,left bottom,from(shade(@panel_bg_color,1.2)),to(shade(@panel_bg_color,0.8)));
	color: @panel_fg_color;
}

.unity-panel.menuitem,
.unity-panel .menuitem {
	color: @panel_fg_color;
}

.unity-panel.menubar.menuitem:hover,
.unity-panel.menubar .menuitem *:hover {
	border-color: shade(@panel_bg_color, 0.7);
	border-image: none;
	background-image: -gtk-gradient(linear,left top,left bottom,from(shade(@panel_bg_color, 0.97)),to(shade(@panel_bg_color, 0.82)));
	color: @panel_fg_color;
}

PanelApplet .button {
	border-color: transparent;
	border-image: none;
	background-image: -gtk-gradient(linear,left top,left bottom,from(shade(@panel_bg_color,1.2)),to(shade(@panel_bg_color,0.8)));
	color: @panel_fg_color;
	box-shadow: none;
	text-shadow: none;
	-unico-inner-stroke-width: 0;
}

PanelApplet .button:active {
	border-color: shade(@panel_bg_color,0.8);
	border-image: none;
	background-image: -gtk-gradient(linear,left top,left bottom,from(shade(shade(@panel_bg_color,1.02),0.9)),to(shade(shade(@panel_bg_color,1.02),0.95)));
	color: @panel_fg_color;
	box-shadow: none;
	text-shadow: none;
	-unico-inner-stroke-width: 0;
}

PanelApplet .button:prelight {
	border-color: transparent;
	border-image: none;
	background-image: -gtk-gradient(linear,left top,left bottom,from(shade(@panel_bg_color,1.2)),to(shade(@panel_bg_color,1.0)));
	color: @panel_fg_color;
	box-shadow: none;
	text-shadow: none;
	-unico-inner-stroke-width: 0;
}

PanelApplet .button:active:prelight {
	border-color: shade(@panel_bg_color,0.8);
	border-image: none;
	background-image: -gtk-gradient(linear,left top,left bottom,from(shade(shade(@panel_bg_color,1.02),1.0)),to(shade(shade(@panel_bg_color,1.02),1.05)));
	color: @panel_fg_color;
	box-shadow: none;
	text-shadow: none;
	-unico-inner-stroke-width: 0;
}

WnckPager,
WnckTasklist {
	background-color: @panel_bg_color;
}

panel-off */

/* menu-off
@define-color menu_bg_color #eeeeee;
@define-color menu_fg_color #333333;

GtkTreeMenu.menu,
GtkMenuToolButton.menu,
GtkComboBox .menu {
	background-color: @menu_bg_color;
}

.primary-toolbar .button .menu,
.toolbar .menu,
.toolbar .primary-toolbar .menu,
.menu {
	border-style: none;
	background-image: none;
	background-color: @menu_bg_color;
	color: @menu_fg_color;
	box-shadow: none;
	text-shadow: none;
	-unico-inner-stroke-width: 0;
}

.menu.button:hover,
.menu.button:active,
.menu.button:active:insensitive,
.menu.button:insensitive,
.menu.button {
	background-color: @menu_bg_color;
	background-image: none;
}

GtkTreeMenu .menuitem * {
	color: @menu_fg_color;
}

.menuitem,
.menu .menuitem {
	background-color: transparent;
}

.menu .menuitem:active,
.menu .menuitem:hover {
	background-color: @theme_selected_bg_color;
}

.menuitem.check,
.menuitem.radio,
.menuitem.check:hover,
.menuitem.radio:hover,
.menuitem.check:active,
.menuitem.radio:active {
	background-color: transparent;
}

.menu .menuitem:insensitive,
.menu .menuitem *:insensitive {
	color: mix(@menu_fg_color,@menu_bg_color,0.5);
}

.menuitem.arrow {
	color: alpha(@menu_fg_color, 0.6);
}

.menuitem .entry {
	border-color: shade(@menu_bg_color,0.7);
	border-image: none;
	background-color: @menu_bg_color;
	background-image: none;
	color: @menu_fg_color;
}

.menuitem .accelerator {
	color: alpha(@menu_fg_color,0.6);
}

.menuitem .accelerator:insensitive {
	color: alpha(mix(@menu_fg_color,@menu_bg_color,0.5),0.6);
	text-shadow: none;
}

.menuitem.separator {
	background-color: transparent;
	color: shade(@menu_bg_color, 0.9);
}

.menuitem GtkCalendar,
.menuitem GtkCalendar.button,
.menuitem GtkCalendar.header,
.menuitem GtkCalendar.view {
	border-color: shade(@menu_bg_color,0.8);
	border-image: none;
	background-color: @menu_bg_color;
	background-image: none;
	color: @menu_fg_color;
}

.menuitem GtkCalendar:inconsistent {
	color: mix(@menu_fg_color,@menu_bg_color,0.5);
}

menu-off */
Attachments
Screenshot.jpg
Screenshot.jpg (20.2 KiB) Viewed 107 times
Screenshot.jpg
Screenshot.jpg (38.39 KiB) Viewed 136 times

Vanilla Dpup 9.2.X - KLV-Airedale - KLA-OT2
PUPPY LINUX Simple fast free

Post Reply

Return to “KL-Dev_Work”