Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-09-18 16:18:17

Tio
Member
Registered: 2021-09-26
Posts: 92

A bit of help with our custom XFCE scripts to sync themes across lib

We, at TROMjaro (tromjaro.com) are trying to find a way to sync the themes across: GTK, GTK+Libadwaita, Qt5, QT6, Flatpaks... And we did it. This is our package https://git.trom.tf/TROMjaro/fixes-pack … ranch/main .

So basically we are able to sync the theme, icons, and font across all of these which is really useful and provides consistency. And it is all done via the XFCE's Appearance tool.

But in order to do this we have to check what users have selected in terms of themes/icons/fonts and push these changes to the other tools we use for QT and such. However we have to make our script run every few seconds....which is quite a bad approach. The best would be to detect when the theme is changed and then trigger our scripts.

So, my question is: is there a way in XFCE to detect when a theme/icon/font is changed and based on that to trigger our scripts? We can't find a way to do this...

Last edited by Tio (2022-09-18 16:18:57)

Offline

#2 2022-09-18 17:25:02

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

Re: A bit of help with our custom XFCE scripts to sync themes across lib

If you are willing to run a script all the time, you can monitor the xsettings channel as react to output as icon,theme, or font change. Something like:

#!/bin/bash

while read -r line; do

    if ( echo $line | grep Icon ); then
        echo "icon theme changed"

    elif ( echo $line | grep Theme ); then
        echo "appearance theme changed"

    elif ( echo $line | grep Font ); then
        echo "font changed"

    fi

done < <(xfconf-query -c xsettings -mv)

exit 0

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

Online

#3 2022-09-18 17:35:31

Tio
Member
Registered: 2021-09-26
Posts: 92

Re: A bit of help with our custom XFCE scripts to sync themes across lib

Amazing thank you very much! We will test this approach for sure! smile - Much appreciated!

Offline

#4 2022-09-18 22:44:32

Tio
Member
Registered: 2021-09-26
Posts: 92

Re: A bit of help with our custom XFCE scripts to sync themes across lib

Works like a charm! Thank you again!

Offline

Board footer

Powered by FluxBB