mirror of
https://github.com/1j01/textual-paint.git
synced 2024-09-11 15:56:03 +03:00
Add less
pager to sample gallery command
It fails to display the 4x4_font_template.ans but other than that it's fine, and that's not really an artwork anyways.
This commit is contained in:
parent
65ef282148
commit
3b42656f48
@ -152,7 +152,7 @@ cat samples/ship.ans
|
|||||||
To view all the sample files, run:
|
To view all the sample files, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
find samples -type f -exec file --mime-type {} \; | grep -v -e "image/png" -e "image/svg" | cut -d: -f1 | sort | xargs -I{} sh -c 'echo "File: {}"; cat "{}"; echo "\n-----------------------\n"'
|
find samples -type f -exec file --mime-type {} \; | grep -v -e "image/png" -e "image/svg" | cut -d: -f1 | sort | xargs -I{} sh -c 'echo "File: {}"; cat "{}"; echo "\n-----------------------\n"' | less --RAW-CONTROL-CHARS
|
||||||
```
|
```
|
||||||
<details>
|
<details>
|
||||||
<summary>Command Explanation</summary>
|
<summary>Command Explanation</summary>
|
||||||
@ -166,9 +166,11 @@ Let's break down the command:
|
|||||||
|
|
||||||
4. `sort`: This sorts the file paths alphabetically.
|
4. `sort`: This sorts the file paths alphabetically.
|
||||||
|
|
||||||
5. `xargs -I{} sh -c 'echo "File: {}"; cat "{}"; echo "\n-----------------------\n"'`: Finally, this executes the `sh -c` command for each file, echoing the filename, catting its content, and adding a separator line.
|
5. `xargs -I{} sh -c 'echo "File: {}"; cat "{}"; echo "\n-----------------------\n"'`: This executes the `sh -c` command for each file, outputting the filename, followed by the file's content, followed by a separator line.
|
||||||
|
|
||||||
This command will sort and display the content of all non-PNG files within the "samples" folder and its subdirectories. Remember to run this command in the directory where the "samples" folder is located.
|
6. `less --RAW-CONTROL-CHARS`: This allows you to scroll through the output with Up/Down/PageUp/PageDown. The `--RAW-CONTROL-CHARS` option is needed for the ANSI art to be displayed correctly.
|
||||||
|
|
||||||
|
This command will sort and display the content of all non-PNG/SVG files within the "samples" folder and its subdirectories. It must be run from the repository root folder.
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
To preview ANSI art files in file managers like Nautilus, Thunar, Nemo, or Caja, you can install the [ansi-art-thumbnailer](https://github.com/1j01/ansi-art-thumbnailer) program I made to go along with this project.
|
To preview ANSI art files in file managers like Nautilus, Thunar, Nemo, or Caja, you can install the [ansi-art-thumbnailer](https://github.com/1j01/ansi-art-thumbnailer) program I made to go along with this project.
|
||||||
|
Loading…
Reference in New Issue
Block a user