A screen saver for the terminal 🌃

Overview

tnap - Let's take a nap 💤

Demo

tnap is a screen saver for the terminal. You can rest the terminal in a secure.

Lang License Release

Features

  • Display images in the terminal and use it as a screen saver
  • Convert images to ASCII art
  • Use images generated using DALL-E 3
  • Generate by simply specifying a key in config.toml without thinking a prompt
  • Of course, you can also generate images by specifying a prompt

Screenshots

girl_with_headphone girl_with_headphone_ascii

Usage

Option Description Type Required?
--theme <THEME> Use the sample theme without generating images String No
--key <KEY> Generate images by a default prompt in config.toml String No
--prompt <PROMPT> Generate images with a user's prompt String No
--ascii Convert an image to ASCII art bool No

Installation

You can install tnap by following these steps:

gh repo clone pigeon-sable/tnap
cd tnap
cargo install --path .
export TNAP_ROOT=`pwd`

Acknowledgements

License

🪪 Apache-2.0

Authors

GitHub

Comments
  • Tasks related to screen buffer

    Tasks related to screen buffer

    • [x] Add slide show of sample images
    • [x] Support imgcat
    • [x] Improve image rendering
    • [x] Add slide show of generated images
    • [x] Add progress indicator
    • [x] Support switching between ASCII art and images with keystrokes
    • [x] Add processing when the "Q" key is pressed while generating an image
    enhancement 
    opened by 4n12i 2
  • A function to use default prompts in the TOML config file

    A function to use default prompts in the TOML config file

    Assumed User Scenarios

    • If the user doesn't have an OpenAI API Key (doesn't generate images), uses the sample images for imgcat or ASCII art.
    • If the user has an OpenAI API Key but doesn't generate images (doesn't create prompts), uses the prompts in config.toml with options.
    • If the user has an OpenAI API Key and wants to generate images, enter the prompt as an option.
    enhancement 
    opened by shuheykoyama 1
  • ✨ feat: logging is performed

    ✨ feat: logging is performed

    Closes #16

    Use env_logger for logging. Debugging output by executing "$ RUST_LOG=info cargo run -- -t girl -a". However, in order to avoid being covered by ascii art, it is better to do "$RUST_LOG=info cargo run -- -t girl -a 2>info.log".

    opened by Kobayashi123 0
  • Image and config path is hard-coded

    Image and config path is hard-coded

    The path to the images and config.toml is hard-coded, so tnap cannot read them if the current directory is not the tnap directory.
    One workaround is to save the path in an environment variable such as TNAP.

    bug 
    opened by 4n12i 0
  • Images drawn to the screen buffer remain on terminal after tnap exits if terminal resized

    Images drawn to the screen buffer remain on terminal after tnap exits if terminal resized

    If you run tnap and resize the terminal, the images (both ASCII art and non-ASCII art) drawn to the screen buffer will remain on the terminal screen after tnap exits.

    bug help wanted 
    opened by 4n12i 0
Releases(1.0.0)
  • 1.0.0(Feb 25, 2024)

    What's Changed

    • Test by @4n12i in https://github.com/pigeon-sable/tnap/pull/1
    • add image generation function by @shuheykoyama in https://github.com/pigeon-sable/tnap/pull/3
    • Feature/generate image by @4n12i in https://github.com/pigeon-sable/tnap/pull/4
    • Update README.md and .gitignore by @4n12i in https://github.com/pigeon-sable/tnap/pull/2
    • convert img to ascii by @Gteruya in https://github.com/pigeon-sable/tnap/pull/5
    • Add a function convert image to ASCII art using Rust by @shuheykoyama in https://github.com/pigeon-sable/tnap/pull/6
    • create display_img.py by @Gteruya in https://github.com/pigeon-sable/tnap/pull/12
    • Add .better-commits.json by @4n12i in https://github.com/pigeon-sable/tnap/pull/15
    • Update README.md, draw based on the terminal size, and adjust the ratio by @shuheykoyama in https://github.com/pigeon-sable/tnap/pull/14
    • Open buffer screen and display ASCII art by @4n12i in https://github.com/pigeon-sable/tnap/pull/7
    • Rename project by @4n12i in https://github.com/pigeon-sable/tnap/pull/24
    • Refactor ASCII art drawing by @4n12i in https://github.com/pigeon-sable/tnap/pull/25
    • Enable to generate an image with a prompt from config.toml by @shuheykoyama in https://github.com/pigeon-sable/tnap/pull/28
    • Fine-tune display_image() in main.rs by @shuheykoyama in https://github.com/pigeon-sable/tnap/pull/29
    • Render non-ascii image by @4n12i in https://github.com/pigeon-sable/tnap/pull/27
    • Consider whether image data can be read from image_url by @shuheykoyama in https://github.com/pigeon-sable/tnap/pull/32
    • Render generated image and support switching between ascii and non-ascii by @4n12i in https://github.com/pigeon-sable/tnap/pull/35
    • Enhance README by @shuheykoyama in https://github.com/pigeon-sable/tnap/pull/37
    • ✨ feat: logging is performed by @Kobayashi123 in https://github.com/pigeon-sable/tnap/pull/38
    • Draw an ASCII art at the center by @shuheykoyama in https://github.com/pigeon-sable/tnap/pull/41
    • Render generated images by @4n12i in https://github.com/pigeon-sable/tnap/pull/40
    • ✨ feat: finds the file path from an env variable or current directory by @Kobayashi123 in https://github.com/pigeon-sable/tnap/pull/44
    • Draw an image at the center by @shuheykoyama in https://github.com/pigeon-sable/tnap/pull/47
    • Output a message if the app exits before image generation is complete by @4n12i in https://github.com/pigeon-sable/tnap/pull/46
    • Add test by @4n12i in https://github.com/pigeon-sable/tnap/pull/48
    • make unit test dir and code by @Gteruya in https://github.com/pigeon-sable/tnap/pull/42
    • Update installation by @4n12i in https://github.com/pigeon-sable/tnap/pull/49
    • Release what works. by @Kobayashi123 in https://github.com/pigeon-sable/tnap/pull/50

    New Contributors

    • @4n12i made their first contribution in https://github.com/pigeon-sable/tnap/pull/1
    • @shuheykoyama made their first contribution in https://github.com/pigeon-sable/tnap/pull/3
    • @Gteruya made their first contribution in https://github.com/pigeon-sable/tnap/pull/5
    • @Kobayashi123 made their first contribution in https://github.com/pigeon-sable/tnap/pull/38

    Full Changelog: https://github.com/pigeon-sable/tnap/commits/1.0.0

    Source code(tar.gz)
    Source code(zip)
    tnap(8.50 MB)
Owner
pigeon-sable
pigeon-sable
A Ratatui widget to turn any image to a splash screen in your terminal ✨

ratatui-splash-screen A Ratatui widget to turn any image to a splash screen in your terminal ✨ See the demo of gpg-tui for a real world example. Featu

Orhun Parmaksız 57 Jul 25, 2024
Standard Graphics is a command-line tool for printing 2D graphics from any language to any screen.

2D graphics in any programming language with just print statements!

Caleb Winston 123 Nov 20, 2022
A small utility that moves the start menu to the top-center of the screen in Windows 11.

TopCenterStart11 A small utility that moves the start menu to the top-center of the screen in Windows 11. As of right now, this application can only p

Ryan de Jonge 12 Nov 12, 2022
A library to capture the Screen on Linux, MacOS and Windows.

Captis - A library for capturing the screen on Linux, MacOS and Windows It's a fairly simple library that performs good enough, the OS level APIs that

CrewNew.com 17 Dec 23, 2022
a FREE and MODERN split-screen tetris game WITHOUT ADS

tetr:: A ✨ modern ✨ Tetris game made in OpenGL and Rust Gameplay tetr:: is an implementaion of modern Tetris, and essentially a clone of tetr.io. This

Adam Harmansky 3 Sep 10, 2022
Adapt the screen's color spectrum according to the hour of the day in order to improve your sleep

circadianlight What It Is Circadian Light is a program, currently only working on Linux with X, that controls the color spectrum of your screen accord

null 7 Dec 28, 2022
High performance wlroots screen recording, featuring hardware encoding

wl-screenrec High performance wlroots based screen recorder. Uses dma-buf transfers to get surface, and uses the GPU to do both the pixel format conve

Russell Greene 32 Jan 21, 2023
on-screen keyboard display for your coding streams.

⌨ OSKD (On-screen key display) OSKD is an on-screen keyboard display that can be used during streams. It provides an intuitive and easy-to-use interfa

Sammwy 46 May 6, 2023
👀Little program I made in 🦀Rust that reminds me every 20 minutes to look away from my computer 🖥screen.

?? eye break Little program I made in ?? Rust that reminds me every 20 minutes to look away from my computer ?? screen. I stay way too long on the com

Goldy 3 Apr 9, 2023
Windows Capture Simple Screen Capture for Windows 🔥

Windows Capture   Windows Capture is a highly efficient Rust library that enables you to effortlessly capture the screen using the Graphics Capture AP

null 3 Sep 24, 2023
A grub theme in the style of the Minecraft singleplayer (sp) world selection screen!

Minecraft World Selection Grub Theme Wowie, another Minecraft grub theme! But this time it's in the style of the singleplayer world selection menu, wh

null 3 Oct 8, 2023
A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.

Terminal Media Player View images, videos (files or YouTube links), webcam, etc directly in the terminal as ASCII. All images you see below are just m

Max Curzi 36 May 8, 2023
ask.sh: AI terminal assistant that can read and write your terminal directly!

ask.sh: AI terminal assistant that read from & write to your terminal ask.sh is an AI terminal assistant based on OpenAI APIs such as GPT-3.5/4! What'

hmirin 5 Jun 20, 2023
A simple and efficient terminal UI implementation with ratatui.rs for getting quick insights from csv files right on the terminal

CSV-GREP csv-grep is an intuitive TUI application writting with ratatui.rs for reading, viewing and quickly analysing csv files right on the terminal.

Anthony Ezeabasili 16 Mar 10, 2024
:large_orange_diamond: Build beautiful terminal tables with automatic content wrapping

Comfy-table Comfy-table tries to provide utility for building beautiful tables, while being easy to use. Features: Dynamic arrangement of content to a

Arne Beer 525 Jan 8, 2023
🛎 60+ Elegant terminal spinners for Rust

Spinners - ?? 60+ Elegant terminal spinners for Rust ❤️ Shameless plug Charts, simple as a URL. No more server-side rendering pain, 1 url = 1 chart Lo

Francois-Guillaume Ribreau 435 Dec 26, 2022
Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Terminal CLI Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you. Example, output only

HashMismatch 47 Nov 25, 2022
Rust library for ANSI terminal colours and styles (bold, underline)

rust-ansi-term This is a library for controlling colours and formatting, such as red bold text or blue underlined text, on ANSI terminals. View the Ru

Benjamin Sago 407 Jan 2, 2023
Cross-platform Rust library for coloring and formatting terminal output

Coloring terminal output Documentation term-painter is a cross-platform (i.e. also non-ANSI terminals) Rust library for coloring and formatting termin

Lukas Kalbertodt 75 Jul 28, 2022