Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-12-23 18:12:25

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

genmon

I have a genmon applet in my panel for the date/time. Works great (I think this is a TOZ script from this site. Thanks!).

One little thing is that when I click on the time to get a calendar, to get rid of the calendar I need to <click> somewhere (I suspect to unfocus). Clicking "somewhere" means anywhere BUT the calendar or in the panel. Looking at the script and the docs for YAD I see I have the "--close-on-unfocus" option selected and the docs don't seem to have a "--close-on-click" option so I'm probably out of luck on the request.

But, never hurts to ask smile

I'm trying to get actions consistent between things like the genmon calendar and the clipboard app and others.

Last edited by Mellowbob (2021-12-23 18:15:52)

Offline

#2 2021-12-23 19:06:02

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

Re: genmon

I believe you are using the script from here. And if I understand, you would like a second click on the calendar to close it.

To do this with genmon, you will need to create two scripts:

Script 1
This is the script that you assign to genmon. It should look like the following:

#!/bin/bash

# the date format on the panel
d=$(date '+%l:%M%P')

# the date format in the tooltip
t=$(date)

# the genmon command
echo "<txt>$d</txt>"
echo "<txtclick>/path/to/the/second/script</txtclick>"
echo "<tool>$t</tool>"

Make sure you change "/path/to/second/script" to point directly to the second script.

Script 2
This should include the logic to either open or close (using xdotool) the calendar:

#!/bin/bash

[[ $(pgrep -f "yad --calendar") ]] && \
	xdotool key Escape || \
	yad --calendar --geometry +1673+0 --no-buttons --undecorated --close-on-unfocus --skip-taskbar

Note that both scripts need to be executable and that the xdotool package needs to be installed.


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 2021-12-23 21:13:42

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: genmon

Almost perfection!

This works really well. I can no click on the desktop or on the time a 2nd time.

Only thing that doesn't work is clicking somewhere else on the panel ... no big deal.

Thanks!

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 524.08 KiB (Peak: 528.51 KiB) ]