forked from tembokk/telescope-media-files.nvim
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from dharmx/fix-ueberzug
feat: fixed #28
- Loading branch information
Showing
2 changed files
with
36 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,25 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
import time | ||
from sys import argv | ||
from time import sleep | ||
|
||
import ueberzug.lib.v0 as ueberzug | ||
from ueberzug.lib.v0 import Canvas, ScalerOption, Visibility | ||
|
||
if __name__ == "__main__": | ||
with ueberzug.Canvas() as canvas: | ||
path = sys.argv[1] | ||
x = int(sys.argv[2]) | ||
y = int(sys.argv[3]) | ||
width = int(sys.argv[4]) | ||
height = int(sys.argv[5]) | ||
with Canvas() as canv: | ||
place = canv.create_placement( | ||
identifier="tele.media.files", | ||
path=argv[1], | ||
x=argv[2], | ||
y=argv[3], | ||
width=argv[4], | ||
height=argv[5], | ||
scaler=ScalerOption.CONTAIN.value, | ||
visibility=Visibility.VISIBLE | ||
) | ||
|
||
placement = canvas.create_placement( | ||
identifier="telescope-media-files.nvim", | ||
width=width, | ||
height=height, | ||
x=x, | ||
y=y, | ||
scaler=ueberzug.ScalerOption.CONTAIN.value, | ||
visibility=ueberzug.Visibility.VISIBLE, | ||
path=path | ||
) | ||
|
||
while True: | ||
with canvas.lazy_drawing: | ||
pass | ||
time.sleep(1) | ||
while True: | ||
with canv.lazy_drawing: | ||
pass | ||
sleep(1) | ||
|
||
# vim:filetype=python |