Tweaking some mailcap definitions.
This commit is contained in:
3
mailcap
3
mailcap
@@ -24,6 +24,7 @@ image/*; feh -g 640x480 '%s'; test=test -n "$DISPLAY"
|
||||
# Youtube videos are assigned a custom mime-type, which can be streamed with
|
||||
# vlc or youtube-dl.
|
||||
video/x-youtube; vlc '%s'; test=test -n "$DISPLAY"
|
||||
video/x-youtube; youtube-dl -q -o - '%s' | mpv -; test=test -n "$DISPLAY"
|
||||
|
||||
# Mpv is a simple and effective video streamer
|
||||
video/webm; mpv '%s'; test=test -n "$DISPLAY"
|
||||
@@ -43,6 +44,6 @@ image/x-imgur-album; echo
|
||||
image/*; curl -s '%s' | convert - jpg:/tmp/rtv.jpg && img2txt -f utf8 /tmp/rtv.jpg; needsterminal; copiousoutput
|
||||
|
||||
# Ascii videos
|
||||
video/x-youtube; youtube-dl -q -o - "%s" | mplayer -cache 8192 -quiet -
|
||||
video/x-youtube; youtube-dl -q -o - '%s' | mplayer -cache 8192 -vo caca -quiet -; needsterminal
|
||||
video/*; wget '%s' -O - | mplayer -cache 8192 -vo caca -quiet -; needsterminal
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ class ImgurAlbumMIMEParser(BaseMIMEParser):
|
||||
urls.append('http:' + div.find('img').get('src'))
|
||||
|
||||
if urls:
|
||||
return "' '".join(urls), 'image/x-imgur-album'
|
||||
return " ".join(urls), 'image/x-imgur-album'
|
||||
else:
|
||||
return url, None
|
||||
|
||||
|
||||
@@ -354,21 +354,25 @@ class Terminal(object):
|
||||
return self.open_browser(url)
|
||||
|
||||
_logger.info('Executing command: %s', command)
|
||||
if 'copiousoutput' in entry:
|
||||
# TODO: open in pager
|
||||
pass
|
||||
elif 'needsterminal' in entry:
|
||||
needs_terminal = 'needsterminal' in entry
|
||||
copious_output = 'copiousoutput' in entry
|
||||
|
||||
if needs_terminal or copious_output:
|
||||
# Blocking, pause rtv until the process returns
|
||||
with self.suspend():
|
||||
os.system('clear')
|
||||
p = subprocess.Popen(
|
||||
[command], stderr=subprocess.PIPE,
|
||||
universal_newlines=True, shell=True)
|
||||
code = p.wait()
|
||||
if copious_output:
|
||||
six.moves.input('Press any key to continue')
|
||||
if code != 0:
|
||||
_, stderr = p.communicate()
|
||||
_logger.warning(stderr)
|
||||
self.show_notification(
|
||||
'Program exited with status=%s\n%s' % (code, stderr))
|
||||
|
||||
else:
|
||||
# Non-blocking, open a background process
|
||||
with self.loader('Opening page', delay=0):
|
||||
|
||||
Reference in New Issue
Block a user