Git Product home page Git Product logo

awesome-tray's Introduction

What's this?

I don't like mode-line, it's too high, affect me to read the code. With Emacs, we only need to focus on very little information, such as time, current mode, git branch. Excessive information can seriously interfere with our attention.

Installation

Clong this repository

$ git clone --depth=1 https://github.com/manateelazycat/awesome-tray.git

Then put awesome-tray.el to your load-path.

The load-path is usually ~/elisp/. It's set in your ~/.emacs like this:

(add-to-list `load-path (expand-file-name "~/elisp"))
(require 'awesome-tray)
(awesome-tray-mode 1)

Customize Mode line.

  • awesome-tray-mode-line-active-color: Use for customize active color.
  • awesome-tray-mode-line-inactive-color: Use for customize inactive color.
  • awesome-tray-mode-line-height: Mode line height, default is 0.1

Customize Module

You can controll modules through option awesome-tray-active-modules.

You can find all modules name in the keys of variable awesome-tray-module-alist. Currently we have:

  • awesome-tab: Show group information of awesome-tab.
  • buffer-name: Show buffer name.
  • circe: Show circe tracking buffer information.
  • date: Show current date.
  • evil: Show evil state.
  • file-path: Show file path with full customizability. When the path is long, it can be shrinked into something like .../.em/el/awesome-tray/awesome-tray.el. See awesome-tray-file-path-*** variables for details.
  • git: Show current branch.
  • last-command: Show last execute command.
  • location: Show point position in buffer.
  • parent-dir: Show direct parent directory.
  • mode-name: Show major mode name.
  • rvm: Show Ruby version information given by rvm-prompt.
  • battery: Show battery status.
  • input-method: Show input method status.
  • buffer-read-only: Show read only status.
  • belong: Show which class/function status, need install tree-sitter first.

Create a Module

Let's create a module that says hello to you. With a module you need:

  • A name. Let's simply call it "hello".

  • A info function that returns the string to be displayed. Here's a simple one

    (defun my-module-hello-info ()
      (concat "Hello " (user-login-name) "!"))

    A complex info function may encounter an error, awesome-tray will handle this and not show any information there.

  • a face. Let's use a simple yet elegant italic style:

    (defface my-module-hello-face
      '((t (:italic t)))
      "Hello module face."
      :group 'awesome-tray)
  • Awesome-tray uses awesome-tray-module-alist to find informations about a module. Let's put ours in it:

    (add-to-list 'awesome-tray-module-alist
               '("hello" . (my-module-hello-info my-module-hello-face)))
  • Now put "hello" in the awesome-tray-active-modules list, and you will see awesome-tray say hello to you!

If you created a module that could be useful to others, please consider contributing it to awesome-tray!

awesome-tray's People

Contributors

manateelazycat avatar amaikinono avatar booaa avatar tomterl avatar ctrl2wei avatar kuxiade avatar zw963 avatar junyi-hou avatar saul-bt avatar feng-qi avatar jaor 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.