Created
July 23, 2023 01:54
-
-
Save YUKI2eN3e/4aa4f3f48b62adfd065157d43a2a1a28 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @ECHO OFF | |
| REM You need to first install https://github.com/pnappa/CLImage | |
| IF "%~1"=="" GOTO HELP | |
| FOR /F "usebackq tokens=2* delims=: " %%W IN (`mode con ^| findstr Columns`) DO SET CONSOLE_WIDTH=%%W | |
| SET /a modulo=%CONSOLE_WIDTH% %% 2 | |
| IF NOT [%module%] == [0] ( | |
| GOTO ODD_WIDTH | |
| ) | |
| :RUN | |
| climage "%~1" --unicode --truecolor --cols %CONSOLE_WIDTH% | |
| GOTO END | |
| :ODD_WIDTH | |
| SET /a "CONSOLE_WIDTH=%CONSOLE_WIDTH%-1" | |
| GOTO RUN | |
| :HELP | |
| ECHO Usage: header.cmd image_file | |
| GOTO END | |
| :END |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a silly little script to display an image across the width of your terminal.
(Use
Windows Terminalnot plainCommand Prompt.)