Welcome!
Forum users
  • Please read this before asking for help, and don't forget to add Quick System Info to help requests!
  • Please follow the Forum Rules

Current releases
--MX-21 release info here
--Migration information to MX-21 here
--antiX-21 (Grup Yorum) release info here

Important information
-- Spectre and Meltdown vulnerabilities

News
-- MX Linux on social media: here
-- New Forum Features, Marking Solved and Referencing a User: here

XFCE panel Datetime font color change - how?  [Solved]

Help for Current Versions of MX
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Post Reply
Message
Author
lassehp
Posts: 10
Joined: Sat Jun 11, 2022 7:54 am

XFCE panel Datetime font color change - how?

#1 Post by lassehp »

Okay, another day trying to get my machines running MX Linux smoothly. As I mentioned in my previous (and first) question post, I am a long-time Unix-sysadmin. For a couple of years I have used LMDE with Cinnamon, but before that I used Xubuntu for about a decade, and before that again, I used XFCE 3.8.x on NetBSD.

Although I have a few rather hard preferences (which alas seem to have gone out of vogue), I hate to tinker constantly with Look&Feel stuff.
However, I do prefer dark text and symbols on a a light gray background for "interface" stuff, and white background for content, and a light screen in general, with good contrast. The Greybird-mx theme seems a fair match, and I think Greybird was my preferred before my intermission using LMDE.

SO, I just managed to move the XFCE Panel from the left side to the top, this took a couple of tries, as it seems the "MX Tweak" settings window has some weird interaction with the XFCE4 Panel settings window. That was an hour ago. After setting the theme to Greybird-mx and making the Panel background pale gray, I could not figure out how to change the font color for the Datetime plugin from white (unreadable) to black. Searching everywhere seemed to give old solutions to the opposite problem mostly, and only solutions requiring editing config files. Something I prefer to avoid, as like I said, I don't like to spend much time tinkering with Look&Feel. For now I've switched to the Adwaita theme, although it is slightly brighter than I would like, but I can live with it. But I can't believe there isn't some simple solution to this tiny problem of changing a plugin's font color without going to config files, so I think it is far more likely that I am just missing something obvious. I hope someone can help enlighten me and darken my Datetime font, so I can switch back to the theme that both matches my taste and my own graying beard.

System info provided for completeness, although doubtably relevant.

Code: Select all

System:    Kernel: 5.10.0-15-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.10.0-15-amd64 root=UUID=<filter> ro quiet splash 
           Desktop: Xfce 4.16.0 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.16.1 vt: 7 dm: LightDM 1.26.0 
           Distro: MX-21.1_x64 Wildflower April 9  2022 base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Laptop System: LENOVO product: 20564RG v: ThinkPad T500 serial: <filter> Chassis: type: 10 serial: <filter> 
           Mobo: LENOVO model: 20564RG serial: <filter> BIOS: LENOVO v: 6FET61WW (2.07 ) date: 02/13/2009 
CPU:       Info: Dual Core model: Intel Core2 Duo T9400 bits: 64 type: MCP arch: Penryn family: 6 model-id: 17 (23) 
           stepping: 6 microcode: 60F cache: L2: 6 MiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 ssse3 bogomips: 10107 
           Speed: 981 MHz min/max: 800/2534 MHz Core speeds (MHz): 1: 981 2: 973 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX unsupported 
           Type: l1tf mitigation: PTE Inversion 
           Type: mds status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT disabled 
           Type: meltdown mitigation: PTI 
           Type: spec_store_bypass status: Vulnerable 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Retpolines, STIBP: disabled, RSB filling 
           Type: srbds status: Not affected 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: Intel Mobile 4 Series Integrated Graphics vendor: Lenovo driver: i915 v: kernel bus-ID: 00:02.0 
           chip-ID: 8086:2a42 class-ID: 0300 
           Device-2: Advanced Micro Devices [AMD/ATI] RV635/M86 [Mobility Radeon HD 3650] vendor: Lenovo driver: N/A 
           alternate: radeon bus-ID: 01:00.0 chip-ID: 1002:9591 class-ID: 0300 
           Display: x11 server: X.Org 1.20.11 compositor: xfwm4 v: 4.16.1 driver: loaded: intel display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1680x1050 s-dpi: 96 s-size: 444x277mm (17.5x10.9") s-diag: 523mm (20.6") 
           Monitor-1: LVDS1 res: 1680x1050 hz: 60 dpi: 129 size: 331x207mm (13.0x8.1") diag: 390mm (15.4") 
           OpenGL: renderer: Mesa DRI Mobile Intel GM45 Express (CTG) v: 2.1 Mesa 20.3.5 direct render: Yes 
Audio:     Device-1: Intel 82801I HD Audio vendor: Lenovo ThinkPad T400 driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 
           chip-ID: 8086:293e class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.0-15-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Intel 82567LM Gigabit Network vendor: Lenovo ThinkPad T400 driver: e1000e v: kernel port: 1840 
           bus-ID: 00:19.0 chip-ID: 8086:10f5 class-ID: 0200 
           IF: eth0 state: down mac: <filter> 
           Device-2: Intel PRO/Wireless 5100 AGN [Shiloh] Network driver: iwlwifi v: kernel modules: wl port: 2000 
           bus-ID: 03:00.0 chip-ID: 8086:4237 class-ID: 0280 
           IF: wlan0 state: up mac: <filter> 
Bluetooth: Device-1: Broadcom BCM2045B (BDC-2.1) [Bluetooth Controller] type: USB driver: btusb v: 0.8 bus-ID: 4-2:2 
           chip-ID: 0a5c:2145 class-ID: fe01 
           Report: hciconfig ID: hci0 rfk-id: 2 state: up address: <filter> bt-v: 1.2 lmp-v: 2.1 sub-v: 424c hci-v: 2.1 
           rev: 518f 
           Info: acl-mtu: 1021:8 sco-mtu: 64:1 link-policy: rswitch hold sniff park link-mode: slave accept 
           service-classes: rendering, capturing, object transfer, audio 
Drives:    Local Storage: total: 149.05 GiB used: 6.94 GiB (4.7%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Hitachi model: HTS725016A9A364 size: 149.05 GiB block-size: physical: 512 B 
           logical: 512 B speed: 3.0 Gb/s type: HDD rpm: 7200 serial: <filter> rev: C70F scheme: MBR 
Partition: ID-1: / raw-size: 103.15 GiB size: 100.97 GiB (97.89%) used: 6.94 GiB (6.9%) fs: ext4 dev: /dev/sda6 maj-min: 8:6 
Swap:      Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 3.9 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sda5 maj-min: 8:5 
Sensors:   System Temperatures: cpu: 65.0 C mobo: 63.0 C 
           Fan Speeds (RPM): fan-1: 2985 
Repos:     Packages: note: see --pkg apt: 2008 lib: 997 flatpak: 0 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mirrors.dotsrc.org/mx-packages/mx/repo/ bullseye main non-free
Info:      Processes: 236 Uptime: 1h 13m wakeups: 3 Memory: 3.74 GiB used: 1.77 GiB (47.3%) Init: SysVinit v: 2.96 runlevel: 5 
           default: 5 tool: systemctl Compilers: gcc: 10.2.1 alt: 10 Shell: Bash v: 5.1.4 
           running-in: quick-system-info-mx inxi: 3.3.06 
Boot Mode: BIOS (legacy, CSM, MBR)

Stuart_M
Posts: 541
Joined: Wed Aug 07, 2019 7:10 pm

Re: XFCE panel Datetime font color change - how?  [Solved]

#2 Post by Stuart_M »

lassehp wrote: Sat Jun 18, 2022 2:10 pm ...I can't believe there isn't some simple solution to this tiny problem of changing a plugin's font color without going to config files...
There is a solution in MX-21 to change the datetime font color but it involves making a little change in ~/.config/gtk-3.0/gtk.css which, if I read your post correctly, you do not want to do based on the above quote.

It's really a simple thing to do and, as far as I know, its the only way to change the "datetime" font color (I prefer MX-19 and that uses the Orage Panel clock that changes both the background color (independent of the Panel color) and font color).

In MX-21, to change the Panel DateTime plugin text color:

1. Go to ~/.config/gtk-3.0/gtk.css and enter the line in the below code window into the gtk.css file. But first you must determine the plugin ID (see step 2) as well as determine the hex color you want the text to be (it is set for black here).

And yes, it starts with the number symbol "#".

Code: Select all

#datetime-1 button label {color: #000000}
2. After "datetime" is "-1" which is the plugin ID for me. There are several ways to see what the plugin ID is for your installation:
  • Panel Properties > Items tab > hover the mouse pointer over the plugin
  • Look in ~/.config/xfce4/panel/
  • Run the following command (MX-21 only):

    Code: Select all

    xfconf-query -c xfce4-panel -lv | grep datetime | awk '{print $1}' | awk -F'-' '{print $2}'
3. Restart the Panel for the change to take effect (or log out/in):

Code: Select all

xfce4-panel -r

lassehp
Posts: 10
Joined: Sat Jun 11, 2022 7:54 am

Re: XFCE panel Datetime font color change - how?

#3 Post by lassehp »

Thank you for your kind assistance. Yes, I strongly prefer to just use the GUI settings windows to change look&feel, and as little as possible, but at the same time I also have a few strong visual preferences, and they do take priority over the inconvenience of config-file tinkering when necessary. Your solution looks simple enough and worthwhile, and very well explained, so it will probably solve my problem.

User avatar
fehlix
Developer
Posts: 10581
Joined: Wed Apr 11, 2018 5:09 pm

XFCE panel Clock and DateTime font color change

#4 Post by fehlix »

Update:
Adjusted to handle both datetime and clock xfce-panel plugins.

Try this:
Xfce Panel DateTime Color Picker:
Save below as text-file with name "DatetimeColorPicker.desktop" on the desktop.

Code: Select all

[Desktop Entry]
# Xfce DateTime Panel Plugin Color Picker
# fehlix : 06-2022
# adjusted to handle clock and datetime plugin
#
# thanks Antediluvian https://forum.mxlinux.org/viewtopic.php?t=70651
#
# based on Stuart_M's proposal: https://forum.mxlinux.org/viewtopic.php?p=687108#p687108
#
Type=Application
Name=DateTime Color
Comment=DateTime Color Picker
Exec=bash -c 'P=(clock datetime); F=~/.config/gtk-3.0/gtk.css; C=$(yad --class=colorpicker --title="DateTime Color Picker" --color) && for p in ${P[*]};do n=$(xfconf-query -c xfce4-panel -lv | grep -oP "/plugins/plugin-\\\\K[0-9]+(?=[[:space:]]+$p\\b)") && ( sed -i "/#$p-$n/d" "$F"; echo "#$p-$n button label {color: $C}" >> "$F"); done && xfce4-panel -r'
Icon=colorpicker
Terminal=false
StartupNotify=false
StartupWMClass=colorpicker
OnlyShowIn=XFCE;
Path=
When clicking an the saved desktop file, it ask one time for permission,
to show a color picker.:
datetime-color-picker.png
The accepted color will be change the displayed DateTime in the panel.
HTH
:puppy:
You do not have the required permissions to view the files attached to this post.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

Stuart_M
Posts: 541
Joined: Wed Aug 07, 2019 7:10 pm

Re: XFCE panel Datetime font color change - how?

#5 Post by Stuart_M »

Thanks fehlix!

I tested the .desktop file as shown in Post #4 on a Live MX-21 Flash Drive and it worked perfectly. Clicking on the DatetimeColorPicker.desktop file brought up the option "Mark as executable" window and then I selected red (#FF0000) as shown in the below image:
datetime_color_change.png

I'm updating my notes file for this.
You do not have the required permissions to view the files attached to this post.

lassehp
Posts: 10
Joined: Sat Jun 11, 2022 7:54 am

Re: XFCE panel Datetime font color change - how?

#6 Post by lassehp »

Thank you too, fehlix. I have now switched a machine from Adwaita to Greybird and used your colorpicker to successfully set the color to a sensible one on a light background. Unfortunately, now I notice that both the "Speaker" icon (PulseAudio Panel Plugin) and the "Battery" icon (Power Manager Plugin) are white, but as they are relatively recognisable, I can live with that. Swithing to different icon sets changes the icons for other panel items, but not for these two. Doesn't matter, I'm happy having Greybird now.

Stuart_M
Posts: 541
Joined: Wed Aug 07, 2019 7:10 pm

Re: XFCE panel Datetime font color change - how?

#7 Post by Stuart_M »

lassehp wrote: Sat Jun 18, 2022 10:37 pm ... now I notice that both the "Speaker" icon (PulseAudio Panel Plugin) and the "Battery" icon (Power Manager Plugin) are white, but as they are relatively recognisable, I can live with that. Swithing to different icon sets changes the icons for other panel items, but not for these two. ...
I think I can change just those two Panel icons which I have easily done in both MX-19 and MX-21, but I need to test first using the icons you mentioned.

If you are open to making that change, which could be easily reverted to the original, I would provide a detailed explanation. The only thing I need is the hex color code of the Panel you are using so I can be sure the new icons I use are suitable. Testing will start once I get that color code (I see is as a challenge even though I have done it before albeit on other Panel icons).


Edit: If anyone is interested, I found a solution to change the PulseAudio (speaker symbol) and "Power Manager Plugin" (battery icon). See https://forum.mxlinux.org/viewtopic.php ... 00#p687300 which is a thread I started "How to change the Panel icon color (+ size)" (20 June 2022) in the "Tips & Tricks by users" category.

lassehp
Posts: 10
Joined: Sat Jun 11, 2022 7:54 am

Re: XFCE panel Datetime font color change - how?

#8 Post by lassehp »

Sorry for not responding sooner, but I am busy settling in with MX Linux and enjoying its features while reestablishing my personal environment, and also enjoying being back on XFCE4. To paraphrase Alan Kay, it is the only desktop that is worth criticising (Well, he said it about Macintosh, and I'm certainly no Alan Kay, and other desktops for Linux probably have their strengths, my experience with them is limited.)

While tinkering with the settings of the Status Tray Plugin I somehow managed to get the Clipman clipboard manager to lose it's icon, showing just a white silhouette, but this seemed to resolve itself after logging out and back in again. This did not change the look of the PulseAudio and Power Manager plugins, though. It suggests some kind of obscure bug to me, but unfortunately I have no idea what I did exactly, so I probably can't reproduce the error. In any case, it's purely "cosmetic".

Thank you - and others who have aided me with my first bumps using MX Linux - for your assistance, and making me feel welcome in this community. It seems likely that MX Linux can be my base platform for many years to come, and I hope that once I've settled in, I can help contributing answers and solutions in return.

Stuart_M
Posts: 541
Joined: Wed Aug 07, 2019 7:10 pm

Re: XFCE panel Datetime font color change - how?

#9 Post by Stuart_M »

lassehp wrote: Tue Jun 21, 2022 8:29 am While tinkering with the settings of the Status Tray Plugin I somehow managed to get the Clipman clipboard manager to lose it's icon, showing just a white silhouette, but this seemed to resolve itself after logging out and back in again. This did not change the look of the PulseAudio and Power Manager plugins, though.
Regarding the first sentence, my initial thought is that if logging out/in got the Clipman Panel icon to be restored in the Panel then resetting the Panel (see below code window) would have the same result but faster and easier.

Code: Select all

xfce4-panel -r
When you said "This did not change the look of the PulseAudio and Power Manager plugins...", are you referring to my Post #4 link (https://forum.mxlinux.org/viewtopic.php ... 00#p687300)? If so, did you reset the panel after the gtk.css file was changed?

If the panel was reset after making the changes without the icon color change, can your post the contents of the gtk.css file with the changes (wrap the text in code tags)?

The changes worked fine for me as shown in the image I posted in the above link. If those same changes to your gtk.css file did not change the icon colors, and after resetting the Panel, then I wonder if you are using a different theme. The themes I used are shown a few lines up from the first code window in the above link and even if you don't want to use that theme(s) it may be worth to at least test it.

Post Reply

Return to “MX Help”