Giter Site home page Giter Site logo

despell's Introduction

despell puts icons in tmux's status line

Installing

Screenshot

Homebrew

# Install
brew install bensadeh/despell/despell

# Test
despell zsh

With Go Install

Make sure that $GOPATH/bin is in your PATH variable.

# Install
go install github.com/bensadeh/despell@latest

# Test
despell zsh

From source

Make sure that $GOPATH/bin is in your PATH variable.

# Install
go install

# Test
despell zsh

Dependencies

despell requires your terminal to use a Nerd Fonts-patched font.

How does it work?

At its core, despell is a just a hash map lookup table. It takes a string (process name) as input and returns a string (icon) as output.

Enabling despell

How to use

despell was created to add a corresponding Nerd Font icon next to the currently running command in tmux's status line. To use despell, edit the following segments in your ~/.tmux.conf:

  • window-status-current-format (active window)
  • window-status-format (inactive window)

Inside these segments, call #(despell #W) to map the command name to their respective icons.

Have a look at the layouts below for an example of the configuration used in the screenshot.

Settings

Update frequency

To configure how often tmux refreshes its status line, add the following command to your ~/.tmux.conf:

# Update the status line every X seconds
tmux set -g status-interval 5

Per-icon colors

To let despell set the icon color and override your theme settings, run despell with the -c flag:

#(despell -c #W)

Emojis

To use emojis instead of Nerd Fonts, run despell with the -e flag:

#(despell -e #W)

Examples

Overriding and adding icons

Override default icons or add new mappings by creating an overrides.json and placing it in ~/.config/despell/overrides.json. You can either use this example file or the snippet below as a starting off point:

unknownCommand is a reserved keyword for commands without mappings.

{
  "unknownCommand": {
    "Icon": "?",
    "Color": "green",
    "Emoji": "โ”"
  },
  "ssh": {
    "Icon": "โ—‡",
    "Color": "red",
    "Emoji": "๐ŸŒ"
  },
  "zsh": {
    "Icon": "โค",
    "Color": "blue",
    "Emoji": "๐Ÿ’™"
  }
}

Is a mapping missing?

Let me know by opening an Issue, Discussion or PR.

Under the hood

Screenshots use:

despell's People

Contributors

bensadeh avatar caarlos0 avatar

Watchers

 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.