How to trigger Xmonad.Prompt.AddFile on recurrent times?

Hello In order to help with my personal productivity. I want to register what I'm doing every 15 minutes or so. And using Xmonad.Prompt.AddFile is very easy. Currently I launch it with a key combination and I can start writing what I'm doing in this moment. However, no I would like to automatically launch AddFile every 15 minutes... Ideally from cron (which I know) or maybe xmonad has a way to do it itself? -- Alejandro García F. (elviejo) Too brief? Here's why! http://emailcharter.org EOM – End Of Message. The whole message is in the subject don't need to open it. NNTR – No Need To Respond. Help cut down on all those “cool” and “thanks” emails. SINGLE SUBJECT. Send one email for one topic, this makes replies easy.. CLEAR CALL TO ACTION: Ask for some specific result very clearly.

Hi! I'm not an expert, but it seems that forking a thread inside XMonad itself wouldn't work - there is no function that will allow you to convert X () back to IO (), thus you can't use the usual forkIO calls. You can probably implement something via X events and server-mode hooks: https://hackage.haskell.org/package/xmonad-contrib-0.16/docs/XMonad-Hooks-Se... But may I suggest using a much simpler approach and skipping XMonad entirely? You can use for example `yad` or `zenity` to display a graphical input box directly from a script. For example something like the following: $ yad --text="Current activity:" --entry >> activity-log.txt Best regards, Platon Pronko On 2020-04-22 18:05, Alejandro Garcia wrote:
Hello In order to help with my personal productivity. I want to register what I'm doing every 15 minutes or so.
And using Xmonad.Prompt.AddFile is very easy. Currently I launch it with a key combination and I can start writing what I'm doing in this moment.
However, no I would like to automatically launch AddFile every 15 minutes... Ideally from cron (which I know) or maybe xmonad has a way to do it itself?

There are also time tracking programs for this.
The way to do this inside xmonad is to send a ClientMessage event which is
handled in the handleEventHook. You could send the event from a cron job,
or fork a thread which opens its own server connection (X11 only pretends
to be thread safe) and sends it after a delay.
On Wed, Apr 22, 2020, 11:53 Platon Pronko
Hi!
I'm not an expert, but it seems that forking a thread inside XMonad itself wouldn't work - there is no function that will allow you to convert X () back to IO (), thus you can't use the usual forkIO calls.
You can probably implement something via X events and server-mode hooks: https://hackage.haskell.org/package/xmonad-contrib-0.16/docs/XMonad-Hooks-Se...
But may I suggest using a much simpler approach and skipping XMonad entirely? You can use for example `yad` or `zenity` to display a graphical input box directly from a script. For example something like the following:
$ yad --text="Current activity:" --entry >> activity-log.txt
Best regards, Platon Pronko
On 2020-04-22 18:05, Alejandro Garcia wrote:
Hello In order to help with my personal productivity. I want to register what I'm doing every 15 minutes or so.
And using Xmonad.Prompt.AddFile is very easy. Currently I launch it with a key combination and I can start writing what I'm doing in this moment.
However, no I would like to automatically launch AddFile every 15 minutes... Ideally from cron (which I know) or maybe xmonad has a way to do it itself?
_______________________________________________ xmonad mailing list xmonad@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad

You could use xdotool, github.com/jordansissel/xdotool, to trigger the
keyboard shortcut.
For example `xdotool key super+f` fakes pressing the super key and f.
On Wed, 22 Apr 2020 at 16:06, Alejandro Garcia
Hello In order to help with my personal productivity. I want to register what I'm doing every 15 minutes or so.
And using Xmonad.Prompt.AddFile is very easy. Currently I launch it with a key combination and I can start writing what I'm doing in this moment.
However, no I would like to automatically launch AddFile every 15 minutes... Ideally from cron (which I know) or maybe xmonad has a way to do it itself?
-- Alejandro García F. (elviejo)
Too brief? Here's why! http://emailcharter.org
EOM – End Of Message. The whole message is in the subject don't need to open it. NNTR – No Need To Respond. Help cut down on all those “cool” and “thanks” emails. SINGLE SUBJECT. Send one email for one topic, this makes replies easy.. CLEAR CALL TO ACTION: Ask for some specific result very clearly. _______________________________________________ xmonad mailing list xmonad@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad

Hi, I used to use arbtt for this kind of thing, you may want to check it out: https://arbtt.nomeata.de/ I only stopped using it because it turned out I didn't much care about the stats after all. But it did in fact work so well that I often forgot it existed. -vrs Quoting Alejandro Garcia (2020-04-22 17:05:42)
Hello In order to help with my personal productivity. I want to register what I'm doing every 15 minutes or so.
And using Xmonad.Prompt.AddFile is very easy. Currently I launch it with a key combination and I can start writing what I'm doing in this moment.
However, no I would like to automatically launch AddFile every 15 minutes... Ideally from cron (which I know) or maybe xmonad has a way to do it itself?
-- Alejandro García F. (elviejo)
Too brief? Here's why! http://emailcharter.org
EOM – End Of Message. The whole message is in the subject don't need to open it. NNTR – No Need To Respond. Help cut down on all those “cool” and “thanks” emails. SINGLE SUBJECT. Send one email for one topic, this makes replies easy.. CLEAR CALL TO ACTION: Ask for some specific result very clearly. _______________________________________________ xmonad mailing list xmonad@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
participants (5)
-
Alejandro Garcia
-
Brandon Allbery
-
Matthew Nicholson
-
Platon Pronko
-
vrs