Git Product home page Git Product logo

theme.sh's Introduction

What

One theme script to rule them all.

Features

  • 270+ preloaded themes.
  • Works on any terminal with OSC 4/11 support (e.g kitty, osx term)
  • Small, self contained and POSIX compliant.
  • Interactive theme selection (requires fzf)

Demo

Why?

  • Lets you easily switch themes inside of an open terminal.
  • Lets you configure st's colour theme without recompiling it :P
  • Lets you keep your shell's init file as the single source of truth.
  • Lets you script theme changes

Usage

Put theme.sh somewhere in your $PATH

Then:

> theme.sh -l
  
  zenburn
  gruvbox
  solarized-dark
  ...

> theme.sh zenburn

or

> theme.sh -i #Interactive theme selection (requires fzf)

Once you find something you like simply put

theme.sh <theme>

in your ~/.bashrc

If $THEME_HISTFILE is set then the path is contains will be used to store recently selected themes. To load the most recently selected theme automatically you can put

export THEME_HISTFILE=~/.theme_history
[ -e "$THEME_HISTFILE" ] && theme.sh "$(theme.sh -l|tail -n1)"

# Optional  

bind -x '"\x0f":"theme.sh $(theme.sh -l|tail -n2|head -n1)"' #Binds C-o to the previously active theme.
alias th='theme.sh -i'

in your ~/.bashrc.

Supported Terminals

Below is a list of terminals on which theme.sh is known to work:

  • kitty (The linux terminal, not the PUTTY fork.)
  • gnome-terminal
  • terminator
  • st
  • Terminal.app (osx)
  • iTerm2
  • alacritty
  • urxvt (non interactively unless the truecolor patch is installed)
  • any libvte based terminal

Caveats

  • Requires a shell that properly implements OSC 4/11.
  • Interactive mode also requires TRUECOLOR support (though the theme can still be set without it.)
  • May cause an imperceptible flash when you start your terminal.
  • Will not help you achieve enlightenment or improve your marriage.
  • May cause epilepsy.

Known issues

  • Will not work in screen (tmux uses the same TERM variable)

theme.sh's People

Contributors

dinkelspiel avatar lemnos avatar metalelf0 avatar napcok avatar rahumba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.