You are not logged in.

#21 2020-10-08 08:09:06

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: bl-reload-gtk23 and xsettingsd

Now seems to be working well, except for the two deprecated toolbar properties I mention on GitHub, and, I don't know how important it is, but some boolean properties seem to be ignored, always mapping to 0.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#22 2020-10-08 20:56:28

nobody
The Great
Registered: 2015-08-10
Posts: 3,655

Re: bl-reload-gtk23 and xsettingsd

johnraff wrote:

Now seems to be working well, except for the two deprecated toolbar properties I mention on GitHub, and, I don't know how important it is, but some boolean properties seem to be ignored, always mapping to 0.

Thanks John for testing. I addressed both problems here https://github.com/BunsenLabs/bunsen-ut … -705819931 .

Offline

#23 2020-10-14 06:59:30

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: bl-reload-gtk23 and xsettingsd

^ The script now tests out OK, and does a great job. cool

I've left a couple of small suggestions for you, quite optional though:
https://github.com/BunsenLabs/bunsen-ut … -708202800


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#24 2020-10-15 16:04:54

nobody
The Great
Registered: 2015-08-10
Posts: 3,655

Re: bl-reload-gtk23 and xsettingsd

OK, I added a few refactor changes and merged into lithium. Feel free to give it a final spin before bumping the version on that package. Since bl-obthemes/BLOB integrates with the tool, we could also announce this new feature.

Offline

#25 2020-10-16 07:05:54

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: bl-reload-gtk23 and xsettingsd

Thanks!

There's also a menu item "Reload GTK" that will come to life with the new script - if you click it after making a change with lxappearance then the effect is seen immediately. cool

In future, lxappearance could be launched via a wrapper script that did that automatically, or just by

sh -c 'lxappearance; bl-reload-gtk23'

as the menu entry. Or even by running an inotify daemon on ~/.config/gtk-3.0/settings.ini

---
I've hit a glitch with jgmenu though. It seems sometimes to miss a gtk theme change when applied this way. (In BLOB 'jgmenu_run init --apply-gtktheme' is called directly so that's OK.) I've found 'touch ~/.config/gtk-3.0/settings.ini' gets it, so it looks as if its watch on that file isn't always catching changes. Needs more research before reporting a bug to Johan...


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#26 2020-10-16 09:08:09

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: bl-reload-gtk23 and xsettingsd

Another app that doesn't seem to be reset by xsettingsd: xfce4-notifyd
Maybe another GTK Property/xsetting needs to be set to change the xfce4-notifyd theme?

It can be switched via xfconf-query (already in BL) though.
Test command (assuming currently using GTK theme BL-Lithium):

notify-send "Hello theme BL-Lithium-light"; xfconf-query -c xfce4-notifyd -p /theme -s BL-Lithium-light; sleep 10; xfconf-query -c xfce4-notifyd -p /theme -s BL-Lithium

...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#27 2020-10-16 16:06:50

nobody
The Great
Registered: 2015-08-10
Posts: 3,655

Re: bl-reload-gtk23 and xsettingsd

The XFCE situation is complicated. As far as I understand it works like this in the XFCE version included in Buster

 owns xsettings selection  + forwards property changes using xfce-specific protocol channel
      xfsettingsd -------------------------------------------------------------------------------> xfconfd
                                                                                                     |   
                                                                                                     |   
                                                                                                     |
                                                                                                  notifies
                                                                                                     |   
                                                                                                     ↓
                                                                                                xfce clients

xfconf includes an experimental gsettings backend in the upstream repository, but that is not a part
of the Debian version in Buster (apt-get source). So it's not available.

Which means, currently, xfsettingsd in Buster is the XFCE stand-in for xsettingsd and is not
compatible with it, because xfsettingsd only can propagate property changes to xfconfd over the
XFCE-specific protocol (probably something via Dbus, have to look), and two xsettingsds cannot run
at the same time.

In turn, some XFCE stuff that is not strictly a GTK3 app (perhaps only the notifyd, maybe someting
else too) is listening only capable of receiving property updates such as theming over the xfconf
channel.

This means, in order to support fixing xfce4-notifyd, we'd need to:

  * Implement, additionally, the XFCE notification protocol in order to tell xfconfd directly to push changes to clients
  * Still script around it in bl-obthemes
  * Use xfsettingsd as the xsettings daemon instead of xsettingsd. Needs to be validated to work
    with non-XFCE gtk3 apps

It might be that xfsettingsd expects an extra slash as the property prefix or not (/Gtk/Theme
instead of Gtk/Theme) but that needs to be found out/validated; the code anyway wants only xsettings
properties like /Gtk/foo, /Gdk/bar and so on, see https://github.com/xfce-mirror/xfce4-se … settings.c. Maybe this is a
noop and the / root path is implicit in xsettingsd.

The source of xfconf is here by the way.

Anyway, is it normal for thunar to crash when changing the theme via bl-obthemes?

Offline

#28 2020-10-17 00:19:35

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: bl-reload-gtk23 and xsettingsd

Thanks for looking into this. @hhh ships separate xfce-notify-4.0 directories for xfce4-notifyd in the BL themes, which I guess means it doesn't just follow the GTK theme.

Sorry I'm away for two days, so can't comment further right now, except:

nobody wrote:

Anyway, is it normal for thunar to crash when changing the theme via bl-obthemes?

At the moment, yes, because Thunar runs as a daemon in BL so it had to be restarted to show theme changes. But that becomes unnecessary when xfsettingsd sets the theme in real time, so restartThunar(), and calls to it, can now be removed.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#29 2020-10-19 07:56:38

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: bl-reload-gtk23 and xsettingsd

On reflection, I'd advocate leaving xfce4-notifyd alone in bl-reload-gtk23. It has its own themes (like Openbox) and is perhaps unrelated to GTK. Your script can usefully remain a GTK-only utility?

In BLOB, a line could easily be added:

xfconf-query -c xfce4-notifyd -p /theme -s $THEME

(I guess a test should first be made that a xfce-notify-4.0 directory exists in the chosen GTK theme.)

At other times there is a GUI (Preferences>Notifications) to change the notification settings, including the theme, applied instantaneously.

---
jgmenu also is not using GTK themes directly, though it parses GTK3's settings.ini, triggered by changes.
That triggering I want to test a bit more before possibly filing a bug report...

Last edited by johnraff (2020-10-19 07:58:27)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#30 2020-10-20 08:05:39

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: bl-reload-gtk23 and xsettingsd

johnraff wrote:

In BLOB, a line could easily be added:

xfconf-query -c xfce4-notifyd -p /theme -s $THEME

(I guess a test should first be made that a xfce-notify-4.0 directory exists in the chosen GTK theme.)

In fact this could be improved because it only resets the theme, ignoring any other settings that might have changed in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml

Preferable would be to trigger a restart of xfce4-notifyd (or possibly xfconfd) to make it reload the whole file, but much web searching has so far failed to find anything that works.

xfconf-query does a good job of setting a single property (as the theme above) whose result appears immediately, and in principle it might be possible to parse xfce4-notifyd.xml and call xfconf-query for all the settings there, but I wonder how many users would find this useful? The theme is the most likely thing to be tweaked and stored with BLOB I'd guess. Anyway, all the other settings will be applied on the next login.

FWIW:

john@lithium:~$ cat /usr/lib/systemd/user/xfce4-notifyd.service
[Unit]
Description=XFCE notifications service

[Service]
Type=dbus
BusName=org.freedesktop.Notifications
ExecStart=/usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd

john@lithium:~$ cat /usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service
[D-BUS Service]
Name=org.freedesktop.Notifications
Exec=/usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd
SystemdService=xfce4-notifyd.service

john@lithium:~$ cat /usr/share/dbus-1/services/org.xfce.Xfconf.service
[D-BUS Service]
Name=org.xfce.Xfconf
Exec=/usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd

john@lithium:~$ systemctl --user status xfce4-notifyd
● xfce4-notifyd.service - XFCE notifications service
   Loaded: loaded (/usr/lib/systemd/user/xfce4-notifyd.service; static; vendor pre
   Active: inactive (dead)

john@lithium:~$ pgrep -a xfce4-notifyd
3356 /usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd

john@lithium:~$ pgrep -a xfconfd
7163 /usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd

...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#31 2020-10-22 08:14:31

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: bl-reload-gtk23 and xsettingsd

reload xfconfd

Finally, success! The trick is you need to kill both xfconfd and xfce4-notifyd. The next time you call notify-send both daemons will be restarted automatically, and the notification window will show any changes you've made to ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml cool

Have to go now, so only tested for GTK theme so far, but I'm guessing/hoping it will apply any changes made to that file, and moreover work for other xfce apps & daemons too. I'll test this some more tomorrow, but for now:

john@lithium:~$ notify-send test # see current theme
john@lithium:~$ pkill -x xfconfd
john@lithium:~$ pkill -x xfce4-notifyd
# now edit whatever xfce4 xml config files under ~/.config/xfce4/xfconf/xfce-perchannel-xml/
john@lithium:~$ notify-send test # changes have been applied

Nothing to do with bl-reload-gtk23 but nice to have for BLOB.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#32 2020-10-23 08:40:11

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,557
Website

Re: bl-reload-gtk23 and xsettingsd

Confirmed:
Kill xconfd to reload the xml file in xconf's database on next use of xconf.
Kill xfce4-notifyd to reload the settings form xconf on next call to notify-send.
The daemons are restarted when a notification is sent.
It works for other settings than the theme, eg corner positioning.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

Board footer

Powered by FluxBB