├── LICENSE ├── Makefile ├── README.md ├── samplescripts ├── ttyscheme-rand └── ttyscheme-showcase └── ttyscheme /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 kolunmi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PROG=ttyscheme 2 | PREFIX=/usr/local 3 | BINDIR=${PREFIX}/bin 4 | 5 | all: 6 | 7 | install: 8 | chmod 755 ${PROG} 9 | mkdir -p ${DESTDIR}${BINDIR} 10 | cp ${PROG} ${DESTDIR}${BINDIR}/${PROG} 11 | 12 | uninstall: 13 | rm -f ${DESTDIR}${BINDIR}/${PROG} 14 | 15 | .PHONY: all install uninstall 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ttyscheme 2 | 3 | ttyscheme features 200+ popular terminal color schemes tuned specifically for use in the tty. 4 | 5 | ## Installation 6 | ```bash 7 | git clone https://github.com/kolunmi/ttyscheme 8 | cd ttyscheme 9 | make install 10 | ``` 11 | 12 | ## Examples 13 | ```bash 14 | # list all schemes 15 | ttyscheme -l 16 | 17 | # apply a scheme 18 | ttyscheme nord 19 | 20 | # show all tty color combinations 21 | ttyscheme -a 22 | ``` 23 | 24 | ## Persistency 25 | Append the following to your shell's configuration file: 26 | ```bash 27 | if [ "$TERM" = linux ] && command -v ttyscheme >/dev/null; then 28 | ttyscheme "$MY_SCHEME" 29 | fi 30 | ``` 31 | 32 | ## Gallery 33 | powershell 34 | ![screenshot_1](https://user-images.githubusercontent.com/113054217/200143732-222e1d59-d0c9-41ba-a3d7-d80f7c3f37c9.png) 35 | hax0r_gr33n 36 | ![screenshot_2](https://user-images.githubusercontent.com/113054217/200143735-d8a50ba2-af96-4fab-85d1-5b9b0847afa9.png) 37 | c64 38 | ![screenshot_3](https://user-images.githubusercontent.com/113054217/200143751-9fa2f90b-07b6-4774-8578-4d57ed783cea.png) 39 | mono_amber 40 | ![screenshot_4](https://user-images.githubusercontent.com/113054217/200437342-177fd3d7-82a9-4d1f-bee9-71cb7a0f0b70.png) 41 | manpage 42 | ![screenshot_5](https://user-images.githubusercontent.com/113054217/200437349-376b455c-f845-447b-a9f0-ec47129f4a83.png) 43 | cyberpunk 44 | ![screenshot_6](https://user-images.githubusercontent.com/113054217/200437358-058e7f01-3734-4269-bae8-b9e7f38a282f.png) 45 | redsands 46 | ![screenshot_7](https://user-images.githubusercontent.com/113054217/200437367-637d0f29-bece-4361-be30-883ae1c5439b.png) 47 | -------------------------------------------------------------------------------- /samplescripts/ttyscheme-rand: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # apply random colorscheme 4 | 5 | colors=($(ttyscheme -l)) 6 | sel="${colors[$((RANDOM % ${#colors[@]}))]}" 7 | ttyscheme -s "$sel" 8 | echo "$sel" 9 | -------------------------------------------------------------------------------- /samplescripts/ttyscheme-showcase: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shift through available ttyscheme schemes 4 | 5 | colors=($(ttyscheme -l)) 6 | colorsmaxind="$((${#colors[@]}-1))" 7 | i=0 8 | 9 | while true; do 10 | col="${colors[$i]}" 11 | ttyscheme -s "$col" 12 | echo "press h,l to cycle through color schemes" 13 | echo "${i}: ${col}" 14 | read -rsn1 15 | case "$REPLY" in 16 | l) [[ $i -lt $colorsmaxind ]] && ((++i)) ;; 17 | h) [[ $i -gt 0 ]] && ((--i)) ;; 18 | *) exit ;; 19 | esac 20 | done 21 | -------------------------------------------------------------------------------- /ttyscheme: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ########################################################### 4 | # ttyscheme - customize tty with curated color schemes # 5 | # # 6 | # credit to the following projects and their contributors # 7 | # https://mayccoll.github.io/Gogh/ # 8 | # https://windowsterminalthemes.dev/ # 9 | # https://emacsthemes.com/ # 10 | # https://terminalsplash.com/ # 11 | # # 12 | # reverting to default cga palette: 'ttyscheme cga' # 13 | ########################################################### 14 | 15 | help_text () { 16 | while IFS= read -r line; do 17 | echo "$line" 18 | done </dev/null && 304 | clear || 305 | printf '%b' '\033[2J\033[H' 306 | fi 307 | elif [ -n "$1" -o -z "${TTYSCHEME_ARRAY}${TTYSCHEME_ARRAY_SIMPLE}" ]; then 308 | echo 'Invalid color scheme. Pass -l for a list of available schemes or -h for further help.' 1>&2 309 | exit 1 310 | fi 311 | 312 | if [ -n "$TTYSCHEME_ARRAY" ]; then 313 | cnt=0 314 | for bkgrnd in 40 41 42 43 44 45 46 47; do 315 | printf '%b' "\033[${bkgrnd}m" 316 | for bold in 22 1; do 317 | printf '%b' "\033[${bold}m" 318 | for frgrnd in 30 31 32 33 34 35 36 37; do 319 | cntprt="$cnt" 320 | while [ "${#cntprt}" -lt 3 ]; do 321 | cntprt=" ${cntprt}" 322 | done 323 | printf '%b' "\033[${frgrnd}m ${cntprt} " 324 | cnt="$((cnt+1))" 325 | done 326 | done 327 | printf '%b\n' '\033[0m' 328 | done 329 | elif [ -n "$TTYSCHEME_ARRAY_SIMPLE" ]; then 330 | unset str 331 | for bkgrnd in 40 41 42 43 44 45 46 47; do 332 | str="${str}\033[${bkgrnd}m " 333 | done 334 | str="${str}\033[0m" 335 | for i in 1 2 3 4 5 6 7; do 336 | printf '%b\n' "$str" 337 | done 338 | fi 339 | --------------------------------------------------------------------------------