Giter VIP home page Giter VIP logo

despell's Introduction

despell maps commands to icons in tmux's status line

Features

  • πŸ—ΊοΈ Map commands to nerdfont icons
  • 🎨 Customization options for colors and emojis
  • πŸ”„ Easy to override default mappings
  • ⚑ Fast (Instant lookup time O(1))
  • πŸ”§ Simple to use and integrate with other themes

Installing

Cargo

cargo install despell

Note Make sure that $HOME/.cargo/bin is in your PATH environment variable

Requirements

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

How does it work?

At its core, despell takes a string (process name) as input and returns a string (icon) as output.

Getting started

To use despell in your existing config, replace all occurrences of

#W

with

#(despell #W) #W

in your ~/.tmux.conf.

If you don't have a ~/.tmux.conf yet, have a look at the example configs below to get started.

Example config

You can start using despell by using the example config from the screenshot. Copy of the config below into your own ~/.tmux.conf to get started.

# Colors
tmux_active_fg=#a6accd
tmux_active_bg=#414863
tmux_inactive_fg=default
tmux_statusbar_bg=#232235

# Window status separator
set-window-option -g window-status-separator ''

# Status bar
set-option -g status-style bg=$tmux_statusbar_bg
set-option -g status-left ""
set-option -g status-right ""

# Justify status bar
set -g status-justify centre

# Active
set-window-option -g window-status-current-format "\
#[bg=$tmux_active_bg] #(despell -c #W)\
#[fg=$tmux_active_fg bg=$tmux_active_bg] #W "

# Inactive
set-window-option -g window-status-format "\
#[fg=$tmux_inactive_fg,bg=$tmux_statusbar_bg] #(despell -c #W)\
#[fg=$tmux_inactive_fg,dim bg=$tmux_statusbar_bg] #W "

Settings

Center alignment

To center the status line instead of left aligned (default), add the following command to your ~/.tmux.conf:

# Set alignment
set -g status-justify centre

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
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 or --color flag:

#(despell -c #W)

Emojis

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

#(despell -e #W)

Overriding and adding icons

To override any of the default mappings, run despell with the -u or --custom flag. Place a config.toml in ~/.config/despell/config.toml with your custom mappings.

All fields are optional, so if you don't use emojis, you can safely omit the fields from the TOML.

[default]
nerdfont = "β—’"
color = "none"
emoji = "🐠"

[icons.command1]
nerdfont = "β—‡"
color = "blue"
emoji = "🌐"

[icons.command2]
nerdfont = "❀"
color = "magenta"
emoji = "πŸ’™"

Is a mapping missing?

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

despell's People

Contributors

bensadeh avatar caarlos0 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

doytsujin norta92

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.