~rjarry/aerc-discuss

5 3

Using terminal bell when composing new message through mailto:

Details
Message ID
<CZ9XIB2J43B2.KMHFW29ZZAX4@tmpod.dev>
DKIM signature
pass
Download raw message
Hello!

I've been using aerc as my daily driver for quite a while now, and
finally got around to submitting this idea to the mailing list :P

In essence, my problem is that, after clicking on `mailto:` links, I have
to go find my terminal window with aerc to start composing the message.
Since I make heavy use of workspaces (and I'm not always consistent with
window positioning; my bad!), it would help quite a bit if aerc issued a
bell command, that makes the terminal window request attention.

Another idea would be to add some flag for opening `mailto:` requests in
a separate window, loading just the compose tab (and maybe the composing
account?). That way you had a one-shot window, like you do in
Thunderbird, for example.

Just some ideas to tackle a slight inconvenience I've been facing :)

Cheers,
~tmpod
Details
Message ID
<CZAF2N5LPG5P.YKKHM1N6U2C4@posteo.net>
In-Reply-To
<CZ9XIB2J43B2.KMHFW29ZZAX4@tmpod.dev> (view parent)
DKIM signature
pass
Download raw message
I think what you want is a custom handler for the
`x-scheme-handler/mailto` XDG mime type. The XDG MIME type specification
[1] in (most) Linux systems defines the mapping between types of files
(and things like mailto: links) and default applications.

The way I personally handle custom MIME mappings is by writing them to
my `$HOME/.config/mimeapps.list` (or `$XDG_CONFIG_HOME/mimeapps.list`).
This is a key=val config file where keys specify MIME types and values
are the default program (handler). I'm not sure where all the MIME types
are specified, I think they can be dynamically registered, but based on
an SO post [2] I believe the one you want is `x-scheme-handler/mailto`.
For me, `xdg-mime query default 'x-scheme-handler/mailto'` returns
`aerc.desktop`. I think you could write a custom `.desktop` file that
e.g. opens a terminal and an aerc instance inside, and assign that
handler to the mailto MIME type.

[1]: https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html
[2]: https://superuser.com/a/559270
Details
Message ID
<CZASMDGT4F3V.3E9JXBR25RSKU@jasoncarloscox.com>
In-Reply-To
<CZAF2N5LPG5P.YKKHM1N6U2C4@posteo.net> (view parent)
DKIM signature
pass
Download raw message
On Tue Feb 20, 2024 at 9:55 PM EST, adigitoleo (Leon) wrote:
> I think what you want is a custom handler for the
> `x-scheme-handler/mailto` XDG mime type. The XDG MIME type specification
> [1] in (most) Linux systems defines the mapping between types of files
> (and things like mailto: links) and default applications.

Even with a mailto handler setup, aerc by default uses IPC to compose
the email in an existing aerc instance rather than using the new one. It
sounds to me like what tmpod wants is the ability to either (1) ring the
bell in that existing aerc instance so that it can be brought into
focus, or (2) skip the IPC and just compose the email directly in the
new aerc instance.

I also feel like the current behavior is confusing -- I sometimes click
on a mailto link and think nothing has happened, only to eventually
realize that I have aerc open somewhere already. Option 2 above sounds
the most appealing to me. There's been talk of adding a --no-sock option
to achieve this behavior.
Details
Message ID
<CZBS3Y11R2N4.FHL58PH17QZC@jasoncarloscox.com>
In-Reply-To
<CZASMDGT4F3V.3E9JXBR25RSKU@jasoncarloscox.com> (view parent)
DKIM signature
pass
Download raw message
Hi tmpod,

I just sent a patch set implementing a --no-ipc flag and some options
that should make opening mailto links in a new aerc instance possible:

https://lists.sr.ht/~rjarry/aerc-devel/patches/49744
Details
Message ID
<CZCFM3GC8IXZ.2FW9H195GNKPP@tmpod.dev>
In-Reply-To
<CZASMDGT4F3V.3E9JXBR25RSKU@jasoncarloscox.com> (view parent)
DKIM signature
pass
Download raw message
> It sounds to me like what tmpod wants is the ability to either (1)
> ring the bell in that existing aerc instance so that it can be brought
> into focus, or (2) skip the IPC and just compose the email directly in
> the new aerc instance.
>
> I also feel like the current behavior is confusing -- I sometimes
> click on a mailto link and think nothing has happened, only to
> eventually realize that I have aerc open somewhere already.

Yes, this is exactly it!
Details
Message ID
<CZCFNNT30DW5.2ME0IGZCRZ3G1@tmpod.dev>
In-Reply-To
<CZBS3Y11R2N4.FHL58PH17QZC@jasoncarloscox.com> (view parent)
DKIM signature
pass
Download raw message
> https://lists.sr.ht/~rjarry/aerc-devel/patches/49744

Lovely, thank you! 
(just saw the v2 too)
Reply to thread Export thread (mbox)