[xmonad] How to trigger Xmonad.Prompt.AddFile on recurrent times?

Brandon Allbery allbery.b at gmail.com
Wed Apr 22 16:11:09 UTC 2020


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 <platon7pronko at gmail.com> wrote:

> 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-ServerMode.html
>
> 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 at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20200422/48882de9/attachment.html>


More information about the xmonad mailing list