On my system, sometimes I prefer to use the "Clock" panel plugin instead of the "Orage Panel Clock" plugin because it supports transparent backgrounds and because of its simpler interface (clicking pops up an attached undecorated calender widget instead of opening the whole orage calender application window.) I noticed, however, system time was not being updated upon resuming from suspend. It would hang displaying whatever the time had been when the system suspended for about a minute or until the clock was moused over or clicked. Thankfully, I was given a great tip over on the xfce forum which I'd like to share here.
It was suggested that the clock could be refreshed, and that this could be triggered by default upon resuming from suspend. The exact commands to refresh the clock may vary, but are fairly simple to determine. There are two parts:
1.) Reset the panel clock to default setting.
2.) Set the clock to user preference setting.
First, we must determine how to refer to the clock in our command. To do so we can open the menu and type "Panel" to open the panel preferences. Click on "Items" and hover your mouse over the "Clock" entry (this is assuming you now have the "Clock" panel item listed instead of or in addition to "Orage Panel Clock.") You should see a tooltip displaying something like, "Internal name: clock-8." The plugin number in our commands will be determined by the number shown in this tooltip.
The following command, using my example of panel item number 8, resets the clock configuration to default:
Code: Select all
xfconf-query -c xfce4-panel -p /plugins/plugin-8/digital-format -r
Code: Select all
xfconf-query -c xfce4-panel -p /plugins/plugin-8/digital-format -n -t string -s %I:%M\ %p
Code: Select all
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"
Next, we need to tell the system to run this command upon resume from suspend. In MX Linux, we can place a small script in the /etc/pm/sleep.d/ directory. I have named mine 00_xfclock, so the full name for the following file could be /etc/pm/sleep.d/00_xfclock.
Code: Select all
#!/bin/sh
case $1 in
resume|thaw)
DISPLAY=:0 ; export DISPLAY
su rich -c "
/usr/bin/xfconf-query -c xfce4-panel -p /plugins/plugin-8/digital-format -r && \
/usr/bin/xfconf-query -c xfce4-panel -p /plugins/plugin-8/digital-format -n -t string -s %I:%M\ %p &"
;;
esac
Code: Select all
chmod +x /etc/pm/sleep.d/00_xfclock