Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-05-25 15:59:29

tbqhmhsfamilam
Member
Registered: 2018-05-10
Posts: 20

xfce4-panel 4.13.3 panel clock update after suspend

Hello, I was wondering if there's yet a way to get the panel clock to show time correct after system suspend? I've updated to the latest xfce4-panel but the issue still persists where after waking from suspend, the panel clock time is wrong. I work around this by hovering my mouse over the clock which causes it to update. I'm aware I can use orage instead but I prefer the simple clock panel plugin because it supports transparency and is simpler.

Offline

#2 2018-05-25 17:48:29

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,006

Re: xfce4-panel 4.13.3 panel clock update after suspend

It doesn't look like there is anything programmed into the plugin to refresh it.

However, it looks like it might refresh itself when a property is set.

To do this, first get the name of the plugin. Hover over the plugin in your Panel Properties Items tab to get it's name (e.g. clock-7). Replace "clock" with "plugin".

Then go to xfce4-settings-editor and in the xfce4-panel channel under the plugins branch, find this plugin. There should be an associated format settings (e.g. digital-format) with a value (e.g.  %r).

Format an xfconf-query command to write to this channel with the same data. With my examples, it would be:

xfconf-query -c xfce4-panel -p /plugins/plugin-7/digital-format -s %r

Test it first by leaving the command ready to go in a terminal window and suspend your computer. Wait a few minutes and resume. Immediately run that command to see if the clock refreshes.

If it works, you just need to add running this command (with the proper X/DBUS variables exported) to your resume hooks.

Last edited by ToZ (2018-05-25 17:49:26)


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

#3 2018-05-25 18:18:37

tbqhmhsfamilam
Member
Registered: 2018-05-10
Posts: 20

Re: xfce4-panel 4.13.3 panel clock update after suspend

Hm, very cool, good idea, unfortunately doesn't work. I know I've got the correct command as I can use it to change the date format, but it hasn't an effect running immediately after suspend.

edit- It does seem to be working if I actually reset it first though- for example,

xfconf-query -c xfce4-panel -p /plugins/plugin-8/digital-format -r && xfconf-query -c xfce4-panel -p /plugins/plugin-8/digital-format -n -t string -s %I:%M\ %p

I'll test a little further...

Last edited by tbqhmhsfamilam (2018-05-25 18:34:34)

Offline

#4 2018-05-25 19:53:26

tbqhmhsfamilam
Member
Registered: 2018-05-10
Posts: 20

Re: xfce4-panel 4.13.3 panel clock update after suspend

Yep, it's working! Thanks Toz, you are a genie! For the record, I created and made executable file /lib/systemd/system-sleep/xfclock.sh (location may be different on non-debian system, I think it would be /usr/lib/... elsewhere) containing:

#!/bin/bash
case $1 in
        post)
                su rich -c "
                DISPLAY=:0
                xfconf-query -c xfce4-panel -p /plugins/plugin-8/digital-format -r && xfconf-query -c xfce4-panel -p /plugins/plugin-8/digital-format -n -t string -s %I:%M\ %p"
                ;;
esac

(I put my own username in there, season to taste wink)

Offline

Board footer

Powered by FluxBB