12 lines
268 B
Python
12 lines
268 B
Python
|
|
|
||
|
|
from PIL import Image as _Image
|
||
|
|
import subprocess
|
||
|
|
import os
|
||
|
|
|
||
|
|
def show_image(pathname):
|
||
|
|
if os.getenv('TERM', '') == 'xterm-kitty':
|
||
|
|
p = subprocess.Popen(['kitty', '+kitten', 'icat', pathname])
|
||
|
|
p.wait()
|
||
|
|
else:
|
||
|
|
_Image.open(pathname).show()
|