You are not logged in.
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
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
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
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
[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 524.08 KiB (Peak: 528.51 KiB) ]