Thanks Guillaume but that last command didn’t work (at least with zsh (I
don’t use bash)). I managed to get close to what I wanted by writing
qtile.cmd_spawn(“alacritty — hold -e cal -3”)

The only issue that I have with this is the fact that I wanted to open
Alacritty by clicking on the date widget and then have it open cal -3 and
let me write more commands because maybe I want to see more than 3 months
ahead. For now I can only see cal -3 and can’t write any extra commands. I
also wrote a callback for emacs daemon to open calendar which works as
expected because emacs is interactive and lets you jump around months. I
can share it here if someone’s interested.

On Sat, 20 Mar 2021 at 13:47 Guillaume Gelin <[email protected]> wrote:

> Wait no. It should look more like this: qtile.cmd_spawn("alacritty -e
> 'bash -c \"cal; read\"'")
>
> Le sam. 20 mars 2021 à 14:44, Guillaume Gelin <[email protected]> a
> écrit :
>
>> Try this: qtile.cmd_spawn("alacritty -e cal -3 && read", shell=True)
>>
>> Le mar. 2 mars 2021 à 23:29, Vic Perriera <[email protected]> a
>> écrit :
>>
>>> i use pycalendar  and this is how i call it..
>>>
>>> widget.Clock(
>>>                        foreground = colors[9],
>>>                        background = colors[0],
>>>                        mouse_callbacks = {"Button1": calendar},
>>>                        format = "%a, %b %d | %l:%M:%S  ",
>>>                        padding = 5
>>>                        ),
>>>
>>> then i have this in my callbacks..
>>>
>>> def calendar():
>>>     qtile.cmd_spawn("./.config/qtile/scripts/calendar/calendar.sh")
>>>
>>> hope this helps
>>>
>>> On Tue, Mar 2, 2021 at 4:55 PM Kai Stian Olstad <[email protected]>
>>> wrote:
>>>
>>>> On 02.03.2021 21:34, Tycho Andersen wrote:
>>>> > On Tue, Mar 02, 2021 at 12:29:48PM -0800, David Budzynski wrote:
>>>> >> widget.Clock(
>>>> >> format = '%b %d %A %H:%M:%S',
>>>> >> mouse_callbacks = {"Button1": lambda: qtile.cmd_spawn("alacritty -e
>>>> >> cal -3"
>>>> >> )}
>>>> >> )
>>>> >>
>>>> >> when I click on the clock it looks like alacritty opens for a split
>>>> of
>>>> >> a
>>>> >> second and quickly disappears. Any reasons why I cannot get cal
>>>> >> command to
>>>> >> open?
>>>> >
>>>> > It is probably working just fine: alacritty opens, cal runs, exits,
>>>> > and then alacritty closes since the process `cal' exited.
>>>> >
>>>> > Try the equivalent of "sh -c 'cal && sleep 200'".
>>>>
>>>> or just add --hold option to alacritty and it wont close when cal exits.
>>>>
>>>> --
>>>> Kai Stian Olstad
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "qtile-dev" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/qtile-dev/f6ae4b10e4afcbafe8cbb1d00458efbd%40olstad.com
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "qtile-dev" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/qtile-dev/CANFxQgT_jzLVa_SkP8wker9Jayz51ooXr96busR9EP-O2wCZgQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/qtile-dev/CANFxQgT_jzLVa_SkP8wker9Jayz51ooXr96busR9EP-O2wCZgQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Guillaume Gelin
>>
>
>
> --
> Guillaume Gelin
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "qtile-dev" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/qtile-dev/zXYv_1aTf7I/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/qtile-dev/CAPn4x%2BqeEJLbGXRh6M4AQAAG1XFH9vag45Qisdngax54t1vKSg%40mail.gmail.com
> <https://groups.google.com/d/msgid/qtile-dev/CAPn4x%2BqeEJLbGXRh6M4AQAAG1XFH9vag45Qisdngax54t1vKSg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"qtile-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qtile-dev/CAC2Cj8QHFkomnr-n6fkJ2ybBFoDNyuPfuJxw%3Dj3JFWNJKyhQYw%40mail.gmail.com.

Reply via email to