Project

General

Profile

Feature #241

XEmbed MIME viewer

Added by Charles Lehner about 7 years ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Category:
Sylpheed
Target version:
-
Start date:
07/06/2015
Due date:
% Done:

0%

Estimated time:

Description

Patch 1 changes the behavior of selecting text or HTML attachments. Currently in the attachments pane, the first text/plain attachment is selected. With the handling of text/html attachments in patch 2, it becomes desirable to select the HTML part. So we change the behavior to select the first HTML part if the preference "Prefer HTML in multipart/alternative for display" is set.

Patch 2 adds an attachment viewer EmbedView which uses XEmbed to display the attachment in the message window using an external application. MimeView is changed to use EmbedView for attachments of type HTML, PDF, audio, video, and GIF (for animated GIF support). A preference item mime_embed_command is added to specify a program to launch to render the attachment, like the mime_command preference. The program is passed the mime type, xid (xembed window ID), and filename. An example program is the following script:

# using preference mime_embed_command=/usr/local/bin/mime-xembed-open '%s' %d '%s'
cat /usr/local/bin/mime-xembed-open 
#!/bin/sh
test -z "$3" && echo "usage: ${0##*/} mime/type xid filename" >&2 && exit 1
case "$1" in
        text/html) exec dillo -f -x $2 "$3";;
        application/pdf) exec zathura -e $2 "$3";;
        audio/*) exec xterm -into $2 -e mpv --pause "$3";;
        video/*) exec mpv --pause --wid=$2 "$3";;
        image/*) exec display -backdrop -window $2 "$3";;
        multipart/*) exit 1;;
        *) exec gvim --socketid $2 "$3";;
esac

Other programs that can be used are surf -e and uzbl -s for web pages, gnome-mplayer --window or mplayer -wid for media, xli -windowid for images, and urxvt -embed or st -w for terminals.

I don't consider requiring the user to set up a shell script to launch the embedded viewers to be the most user-friendly option, but it was the easiest to implement. Another option would be to have a set of preferences for each mime type, like there is now for launching audio and images. This has the disadvantage of requiring a restart after changing any option. The mailcap database doesn't know which applications are XEmbed-aware so it is of limited utility. So I'm not sure what would be best here, but I wanted to share these patches since I've been using them for a while with some success. I'm also not sure about Windows support - I don't know if GtkSocket works on Windows. Also, I sometimes see "leaked" dillo processes after quitting Sylpheed while using this patch, so there should probably be some more code added to handle cleaning up the embed viewer processes.


Files

0001-Use-preference-for-preferring-html-or-text-alt.patch (1.82 KB) 0001-Use-preference-for-preferring-html-or-text-alt.patch Follow preferences for selecting text or HTML message parts Charles Lehner, 07/06/2015 05:01 AM
0002-Add-EmbedView-view-MIME-attachments-using-XEmbed.patch (15.4 KB) 0002-Add-EmbedView-view-MIME-attachments-using-XEmbed.patch Add XEmbed MIME viewer Charles Lehner, 07/06/2015 06:06 AM
#1

Updated by Charles Lehner about 7 years ago

Note: the EmbedView patch uses procmime_get_multipart from #240 but can be changed to use procmime_get_part instead if #240 is not applied.

#2

Updated by Civillain Pelicandy over 1 year ago

Charles Lehner wrote:

Patch 1 changes the behavior of selecting text or HTML attachments. Currently in the attachments pane, the first text/plain attachment is selected. With the handling of text/html attachments in patch 2, it becomes desirable to select the HTML part. So we change the behavior to select the first HTML part if the preference "Prefer HTML in multipart/alternative for display" is set.

Patch 2 adds an attachment viewer EmbedView which uses XEmbed to display the attachment in the message window using an external application. MimeView is changed to use EmbedView for attachments of type HTML, PDF, audio, video, and GIF (for animated GIF support). A preference item mime_embed_command is added to specify a program to launch to render the attachment, like the mime_command preference. The program is passed the mime type, xid (xembed window ID), and filename. An example program is the following script:

[...]

Other programs that can be used are surf -e and uzbl -s for web pages, gnome-mplayer --window or mplayer -wid for media, xli -windowid for images, and urxvt -embed or st -w for terminals.

I don't consider requiring the user to set up a shell script to launch the embedded viewers to be the most user-friendly option, but it was the easiest to implement. Another option would be to have a set of preferences for each mime type, like there is now for launching audio and images. This has the disadvantage of requiring a restart after changing any option. The mailcap database doesn't know which applications are XEmbed-aware so it is of limited utility. So I'm not sure what would be best here, but I wanted to share these patches since I've been using them for a while with some success. I'm also not sure about Windows support - I don't know if GtkSocket works on Windows. Also, I sometimes see "leaked" dillo processes after quitting Sylpheed while using this patch, so there should probably be some more code added to handle cleaning up the embed viewer processes.

Thanks for the info i will try to figure it out for more

#4

Updated by vapire move 12 months ago

Thanks for the information, I will try to figure it out for more. Keep sharing such informative post keep suggesting such post.
Crediblebhhttps://crediblebh.live/

#5

Updated by vapire move 12 months ago

Thanks for the information, I will try to figure it out for more. Keep sharing such informative post keep suggesting such post.
https://crediblebh.live/

#6

Updated by Harsh James 9 months ago

i WAS looking for this. [[https://my-estub.biz]]

#7

Updated by Harsh James 9 months ago

Keep sharing this was really Informative. [[https://skylightpaycard.cyou]]

#8

Updated by Harsh James 9 months ago

I waas finding this from such a long time. [[https://blankfaxcoversheet.run]]

#9

Updated by replica watches 5 months ago

https://www.bestwatchaaa.com/Graham-replica.html https://www.replicawatchsshop.cc/Omega-Replica.html https://www.allwatchesen.com/ https://www.hotwatchsreplica.com/Alain-Silberstein.html https://www.hotwatchsreplica.com/Parmigiani.html https://www.bestwatchss.com/Glashutte-Replica-Watches.html are https://www.bestwatchaaa.com/Roger-Dubuis-replica.html hottest and the https://www.perfectwatchen.com/ https://www.replicawatchsshop.cc/Invicta-Replica.html in https://www.replicawatchsshop.cc/Seiko-Replica.html online https://www.hotwatchsreplica.com/Dior.html https://www.bestwatchaaa.com/ https://www.hotwatchsreplica.com/rolex.html https://www.bestwatchaaa.com/Michele-replica.html watches https://www.replicawatchsshop.cc/Audemars-Piguet-Replica.html https://www.bestwatchaaa.com/Jaeger-LeCoultre-replica.html https://www.swisswatchesale.com/ https://www.hotwatchsreplica.com/porsche-design.html https://www.replicawatchsshop.cc/Romain-Jerome-Replica.html https://www.bestwatchaaa.com/IWC-replica.html https://www.hotwatchsreplica.com/Anonimo.html https://www.bestwatchss.com/U-Boat-Replica-Watches.html https://www.replicawatchsshop.cc/Movado-Replica.html https://www.replicawatchsshop.cc/Girard-Perregaux-Replica.html https://www.hotwatchsreplica.com/blancpain.html world. https://www.bestwatchaaa.com/Movado-replica.html https://www.bestwatchss.com/Bell-Ross-Replica-Watches.html https://www.bestwatchaaa.com/Technomarine-replica.html the https://www.bestwatchaaa.com/Hamilton-replica.html https://www.replicawatchsshop.cc/Vacheron-Constantin-Replica.html similar https://www.luxuryshopwatch.com/ https://www.bestwatchss.com/ https://www.bestwatchaaa.com/Baume-Mercier-replica.html ones.

#10

Updated by bro coder about 2 months ago

The Alaskas World website includes details about your upcoming flights and other services. In addition, you’ll find details on your benefits and the software you need to keep track of your work schedules on this page.

https://alaskasworld.pics/

Also available in: Atom PDF