anifetch-cli 1.0.0__tar.gz → 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/PKG-INFO +14 -3
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/README.md +13 -2
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/pyproject.toml +1 -1
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch/cli.py +1 -1
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch/core.py +23 -18
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch/keyreader.py +7 -1
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch/renderer.py +4 -2
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch/utils.py +0 -3
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch_cli.egg-info/PKG-INFO +14 -3
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/LICENSE +0 -0
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/setup.cfg +0 -0
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch/__init__.py +0 -0
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch/__main__.py +0 -0
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch/assets/example.mp4 +0 -0
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch_cli.egg-info/SOURCES.txt +0 -0
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch_cli.egg-info/dependency_links.txt +0 -0
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch_cli.egg-info/entry_points.txt +0 -0
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch_cli.egg-info/requires.txt +0 -0
- {anifetch_cli-1.0.0 → anifetch_cli-1.0.1}/src/anifetch_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: anifetch-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Animated terminal fetch with video and audio support.
|
|
5
5
|
Author-email: Notenlish <notenlish@gmail.com>
|
|
6
6
|
Maintainer: Immelancholy
|
|
@@ -65,7 +65,12 @@ winget install chafa ffmpeg fastfetch
|
|
|
65
65
|
|
|
66
66
|
You can install neofetch too but it is deprecated and not recommended. Run this to install: `winget install neofetch`
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
After installing the necessary dependencies using winget/scoop, install anifetch via pip. You can install it via pipx too.
|
|
69
|
+
|
|
70
|
+
```pip install anifetch-cli```
|
|
71
|
+
|
|
72
|
+
> [!WARNING]
|
|
73
|
+
> **Do not** install `anifetch` on pypi, it is not related with this project. Install `anifetch-cli`.
|
|
69
74
|
|
|
70
75
|
### Installation for MacOS with Homebrew
|
|
71
76
|
|
|
@@ -77,8 +82,12 @@ Run this in the terminal after verifying homebrew is installed:
|
|
|
77
82
|
brew install chafa ffmpeg fastfetch
|
|
78
83
|
```
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
After installing the necessary dependencies, install anifetch via pip . You can install it via pipx too.
|
|
81
86
|
|
|
87
|
+
```pip install anifetch-cli```
|
|
88
|
+
|
|
89
|
+
> [!WARNING]
|
|
90
|
+
> **Do not** install `anifetch` on pypi, it is not related with this project. Install `anifetch-cli`.
|
|
82
91
|
|
|
83
92
|
### Manual Installation
|
|
84
93
|
|
|
@@ -309,6 +318,8 @@ As it can be seen, Anifetch is quite fast if you cache the animations.
|
|
|
309
318
|
|
|
310
319
|
Make sure to install the dependencies listed on [Prerequisites](#Prerequisites). If ffmpeg throws an error saying `libxm12.so.16: cannot open shared object file: No such file or directory exists` then you must install `libxm12`. Here's an comment showing how to install it for arch: [https://github.com/Notenlish/anifetch/issues/24#issuecomment-2920189918](solution)
|
|
311
320
|
|
|
321
|
+
If weird characters are appearing in your terminal then your terminals font probably can't render some characters. Consider installling [nerdfonts](https://www.nerdfonts.com/).
|
|
322
|
+
|
|
312
323
|
## Notes
|
|
313
324
|
|
|
314
325
|
Anifetch attempts to cache the animation so that it doesn't need to render them again when you run it with the same file. However, if the name of the file is the same, but it's contents has changed, it won't re-render it. In that case, you will need to add `--force-render` as an argument to `anifetch.py` so that it re-renders it. You only have to do this only once when you change the file contents.
|
|
@@ -38,7 +38,12 @@ winget install chafa ffmpeg fastfetch
|
|
|
38
38
|
|
|
39
39
|
You can install neofetch too but it is deprecated and not recommended. Run this to install: `winget install neofetch`
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
After installing the necessary dependencies using winget/scoop, install anifetch via pip. You can install it via pipx too.
|
|
42
|
+
|
|
43
|
+
```pip install anifetch-cli```
|
|
44
|
+
|
|
45
|
+
> [!WARNING]
|
|
46
|
+
> **Do not** install `anifetch` on pypi, it is not related with this project. Install `anifetch-cli`.
|
|
42
47
|
|
|
43
48
|
### Installation for MacOS with Homebrew
|
|
44
49
|
|
|
@@ -50,8 +55,12 @@ Run this in the terminal after verifying homebrew is installed:
|
|
|
50
55
|
brew install chafa ffmpeg fastfetch
|
|
51
56
|
```
|
|
52
57
|
|
|
53
|
-
|
|
58
|
+
After installing the necessary dependencies, install anifetch via pip . You can install it via pipx too.
|
|
54
59
|
|
|
60
|
+
```pip install anifetch-cli```
|
|
61
|
+
|
|
62
|
+
> [!WARNING]
|
|
63
|
+
> **Do not** install `anifetch` on pypi, it is not related with this project. Install `anifetch-cli`.
|
|
55
64
|
|
|
56
65
|
### Manual Installation
|
|
57
66
|
|
|
@@ -282,6 +291,8 @@ As it can be seen, Anifetch is quite fast if you cache the animations.
|
|
|
282
291
|
|
|
283
292
|
Make sure to install the dependencies listed on [Prerequisites](#Prerequisites). If ffmpeg throws an error saying `libxm12.so.16: cannot open shared object file: No such file or directory exists` then you must install `libxm12`. Here's an comment showing how to install it for arch: [https://github.com/Notenlish/anifetch/issues/24#issuecomment-2920189918](solution)
|
|
284
293
|
|
|
294
|
+
If weird characters are appearing in your terminal then your terminals font probably can't render some characters. Consider installling [nerdfonts](https://www.nerdfonts.com/).
|
|
295
|
+
|
|
285
296
|
## Notes
|
|
286
297
|
|
|
287
298
|
Anifetch attempts to cache the animation so that it doesn't need to render them again when you run it with the same file. However, if the name of the file is the same, but it's contents has changed, it won't re-render it. In that case, you will need to add `--force-render` as an argument to `anifetch.py` so that it re-renders it. You only have to do this only once when you change the file contents.
|
|
@@ -24,7 +24,7 @@ keywords = [
|
|
|
24
24
|
"fastfetch",
|
|
25
25
|
"anifetch",
|
|
26
26
|
]
|
|
27
|
-
version = "1.0.
|
|
27
|
+
version = "1.0.1"
|
|
28
28
|
description = "Animated terminal fetch with video and audio support."
|
|
29
29
|
# If I put everyone here it messes with the "author" meta section.
|
|
30
30
|
authors = [{ name = "Notenlish", email = "notenlish@gmail.com" }]
|
|
@@ -123,7 +123,7 @@ parser.add_argument(
|
|
|
123
123
|
"-nf",
|
|
124
124
|
"--neofetch",
|
|
125
125
|
default=False,
|
|
126
|
-
help="Add this argument if you want to use neofetch instead.",
|
|
126
|
+
help="Add this argument if you want to use neofetch instead. You may need to add --force on some linux distros too.",
|
|
127
127
|
action="store_true",
|
|
128
128
|
)
|
|
129
129
|
parser.add_argument(
|
|
@@ -30,15 +30,11 @@ from .utils import (
|
|
|
30
30
|
args_checker,
|
|
31
31
|
threaded_chafa_frame_gen,
|
|
32
32
|
get_fetch_output,
|
|
33
|
-
center_template_to_animation,
|
|
34
33
|
make_template_from_fetch_lines,
|
|
35
|
-
tput_cup,
|
|
36
|
-
get_lowest_y_pos,
|
|
37
|
-
clear_screen,
|
|
38
34
|
clear_screen_soft,
|
|
39
35
|
)
|
|
40
36
|
from typing import Literal
|
|
41
|
-
from concurrent.futures import ThreadPoolExecutor,
|
|
37
|
+
from concurrent.futures import ThreadPoolExecutor, Future
|
|
42
38
|
|
|
43
39
|
GAP = 2
|
|
44
40
|
PAD_LEFT = 4
|
|
@@ -130,6 +126,9 @@ def run_anifetch(args):
|
|
|
130
126
|
sys.exit(0)
|
|
131
127
|
|
|
132
128
|
filename = pathlib.Path(args.filename)
|
|
129
|
+
IS_GIF = False
|
|
130
|
+
if args.filename:
|
|
131
|
+
IS_GIF = True
|
|
133
132
|
|
|
134
133
|
# If the filename is relative, check if it exists in the assets directory.
|
|
135
134
|
if not filename.exists():
|
|
@@ -271,7 +270,9 @@ def run_anifetch(args):
|
|
|
271
270
|
str(
|
|
272
271
|
min(max(args.quality or 6, 2), 10)
|
|
273
272
|
), # 2-5 high quality, 6-10 lower
|
|
274
|
-
str(CACHE_PATH / "video/%05d.
|
|
273
|
+
str(CACHE_PATH / "video/%05d.png")
|
|
274
|
+
if IS_GIF
|
|
275
|
+
else str(CACHE_PATH / "video/%05d.jpg"),
|
|
275
276
|
],
|
|
276
277
|
stdout=stdout,
|
|
277
278
|
stderr=stderr,
|
|
@@ -336,10 +337,11 @@ def run_anifetch(args):
|
|
|
336
337
|
max_workers: int = max(1, (os.cpu_count() or 2) - 1)
|
|
337
338
|
max_workers = 1
|
|
338
339
|
|
|
340
|
+
chafa_args: str = args.chafa_arguments.strip()
|
|
341
|
+
chafa_args += (
|
|
342
|
+
" --format symbols" # Fixes https://github.com/Notenlish/anifetch/issues/1
|
|
343
|
+
)
|
|
339
344
|
with ThreadPoolExecutor(max_workers=max_workers) as executor:
|
|
340
|
-
chafa_args: str = args.chafa_arguments.strip()
|
|
341
|
-
chafa_args += " --format symbols" # Fixes https://github.com/Notenlish/anifetch/issues/1
|
|
342
|
-
|
|
343
345
|
for i, f in enumerate(animation_files):
|
|
344
346
|
future = executor.submit(
|
|
345
347
|
threaded_chafa_frame_gen,
|
|
@@ -483,18 +485,21 @@ def run_anifetch(args):
|
|
|
483
485
|
|
|
484
486
|
keyboard = Controller()
|
|
485
487
|
|
|
486
|
-
if
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
488
|
+
# needed because if I only enter one key even though the user pressed a bunch of keys the keys will be entered disorderly(only the a single key is not automatically entered and the other keys are entered)
|
|
489
|
+
# so we store the key, go to line start, enter the first key(that the user pressed) and then go to the end of line.
|
|
490
|
+
# that way even if the user presses a bunch of keys, it will all be in order.
|
|
491
|
+
|
|
492
|
+
# start of line
|
|
493
|
+
keyboard.press(Key.home)
|
|
494
|
+
keyboard.release(Key.home)
|
|
490
495
|
|
|
491
|
-
|
|
496
|
+
keyboard.press(renderer.last_key)
|
|
492
497
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
498
|
+
# end of line
|
|
499
|
+
keyboard.press(Key.end)
|
|
500
|
+
keyboard.release(Key.end)
|
|
496
501
|
|
|
497
|
-
|
|
502
|
+
keyboard.release(renderer.last_key)
|
|
498
503
|
|
|
499
504
|
if pathlib.Path(VIDEO_DIR).exists():
|
|
500
505
|
shutil.rmtree(VIDEO_DIR) # no need to keep the video frames.
|
|
@@ -2,6 +2,7 @@ import os
|
|
|
2
2
|
import sys
|
|
3
3
|
import atexit
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
class KeyReader:
|
|
6
7
|
"""
|
|
7
8
|
Cross-platform, non-blocking key reader for terminal animations.
|
|
@@ -9,12 +10,14 @@ class KeyReader:
|
|
|
9
10
|
- macOS/Linux: termios + select
|
|
10
11
|
Restores terminal settings on exit.
|
|
11
12
|
"""
|
|
13
|
+
|
|
12
14
|
def __init__(self):
|
|
13
|
-
self.is_windows =
|
|
15
|
+
self.is_windows = os.name == "nt"
|
|
14
16
|
self._started = False
|
|
15
17
|
|
|
16
18
|
if not self.is_windows:
|
|
17
19
|
import termios
|
|
20
|
+
|
|
18
21
|
self.termios = termios
|
|
19
22
|
self.fd = sys.stdin.fileno()
|
|
20
23
|
self.old_attrs = None
|
|
@@ -26,6 +29,7 @@ class KeyReader:
|
|
|
26
29
|
|
|
27
30
|
if not self.is_windows:
|
|
28
31
|
import tty
|
|
32
|
+
|
|
29
33
|
self.old_attrs = self.termios.tcgetattr(self.fd)
|
|
30
34
|
tty.setcbreak(self.fd) # no-Enter input, but less aggressive than raw
|
|
31
35
|
atexit.register(self.stop)
|
|
@@ -52,6 +56,7 @@ class KeyReader:
|
|
|
52
56
|
|
|
53
57
|
if self.is_windows:
|
|
54
58
|
import msvcrt
|
|
59
|
+
|
|
55
60
|
if not msvcrt.kbhit():
|
|
56
61
|
return None
|
|
57
62
|
ch = msvcrt.getwch()
|
|
@@ -61,6 +66,7 @@ class KeyReader:
|
|
|
61
66
|
return ch
|
|
62
67
|
else:
|
|
63
68
|
import select
|
|
69
|
+
|
|
64
70
|
r, _, _ = select.select([sys.stdin], [], [], 0)
|
|
65
71
|
if not r:
|
|
66
72
|
return None
|
|
@@ -194,7 +194,9 @@ class Renderer:
|
|
|
194
194
|
if self.is_centered:
|
|
195
195
|
# self._some_max_height -1 is needed to properly align it for some reason. Dont question it.
|
|
196
196
|
self.layout["main"]["chafa"].update(
|
|
197
|
-
Align.center(
|
|
197
|
+
Align.center(
|
|
198
|
+
chafa_t, vertical="middle", height=self._some_max_height - 1
|
|
199
|
+
)
|
|
198
200
|
)
|
|
199
201
|
else:
|
|
200
202
|
self.layout["main"]["chafa"].update(chafa_t)
|
|
@@ -266,7 +268,7 @@ class Renderer:
|
|
|
266
268
|
refresh_per_second=20,
|
|
267
269
|
screen=True,
|
|
268
270
|
transient=True, # if false, keep the last frame
|
|
269
|
-
)
|
|
271
|
+
):
|
|
270
272
|
self.draw_loop()
|
|
271
273
|
# enable_autowrap()
|
|
272
274
|
except KeyboardInterrupt:
|
|
@@ -11,8 +11,6 @@ import re
|
|
|
11
11
|
import subprocess
|
|
12
12
|
import os
|
|
13
13
|
import sys
|
|
14
|
-
from importlib.resources import files, as_file
|
|
15
|
-
from importlib.resources.abc import Traversable
|
|
16
14
|
from importlib.metadata import version, PackageNotFoundError
|
|
17
15
|
import shutil
|
|
18
16
|
from copy import deepcopy
|
|
@@ -44,7 +42,6 @@ SYNC_END = ESC + "?2026l"
|
|
|
44
42
|
# Retrieved 2025-12-21, License - CC BY-SA 4.0
|
|
45
43
|
|
|
46
44
|
if os.name == "nt":
|
|
47
|
-
import msvcrt
|
|
48
45
|
import ctypes
|
|
49
46
|
|
|
50
47
|
class _CursorInfo(ctypes.Structure):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: anifetch-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Animated terminal fetch with video and audio support.
|
|
5
5
|
Author-email: Notenlish <notenlish@gmail.com>
|
|
6
6
|
Maintainer: Immelancholy
|
|
@@ -65,7 +65,12 @@ winget install chafa ffmpeg fastfetch
|
|
|
65
65
|
|
|
66
66
|
You can install neofetch too but it is deprecated and not recommended. Run this to install: `winget install neofetch`
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
After installing the necessary dependencies using winget/scoop, install anifetch via pip. You can install it via pipx too.
|
|
69
|
+
|
|
70
|
+
```pip install anifetch-cli```
|
|
71
|
+
|
|
72
|
+
> [!WARNING]
|
|
73
|
+
> **Do not** install `anifetch` on pypi, it is not related with this project. Install `anifetch-cli`.
|
|
69
74
|
|
|
70
75
|
### Installation for MacOS with Homebrew
|
|
71
76
|
|
|
@@ -77,8 +82,12 @@ Run this in the terminal after verifying homebrew is installed:
|
|
|
77
82
|
brew install chafa ffmpeg fastfetch
|
|
78
83
|
```
|
|
79
84
|
|
|
80
|
-
|
|
85
|
+
After installing the necessary dependencies, install anifetch via pip . You can install it via pipx too.
|
|
81
86
|
|
|
87
|
+
```pip install anifetch-cli```
|
|
88
|
+
|
|
89
|
+
> [!WARNING]
|
|
90
|
+
> **Do not** install `anifetch` on pypi, it is not related with this project. Install `anifetch-cli`.
|
|
82
91
|
|
|
83
92
|
### Manual Installation
|
|
84
93
|
|
|
@@ -309,6 +318,8 @@ As it can be seen, Anifetch is quite fast if you cache the animations.
|
|
|
309
318
|
|
|
310
319
|
Make sure to install the dependencies listed on [Prerequisites](#Prerequisites). If ffmpeg throws an error saying `libxm12.so.16: cannot open shared object file: No such file or directory exists` then you must install `libxm12`. Here's an comment showing how to install it for arch: [https://github.com/Notenlish/anifetch/issues/24#issuecomment-2920189918](solution)
|
|
311
320
|
|
|
321
|
+
If weird characters are appearing in your terminal then your terminals font probably can't render some characters. Consider installling [nerdfonts](https://www.nerdfonts.com/).
|
|
322
|
+
|
|
312
323
|
## Notes
|
|
313
324
|
|
|
314
325
|
Anifetch attempts to cache the animation so that it doesn't need to render them again when you run it with the same file. However, if the name of the file is the same, but it's contents has changed, it won't re-render it. In that case, you will need to add `--force-render` as an argument to `anifetch.py` so that it re-renders it. You only have to do this only once when you change the file contents.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|