Skip to content

jumper047/emacs-appindicator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emacs-Appindicator

Package for Emacs to create and control tray icons.

./screenshot.png

This package contains tiny daemon, written in C, which creates and controls tray icon via appindicator library, and lisp code to interact with it. Daemon can hide/show/change icon, set label (as far as I know, some desktop environments doesn’t support this feature), and set up context menus with lisp callbacks. For now, only Linux bases operation systems supported. Please visit issue if you are interested in support for other systems.

This repository contains library only, check jumper047/emacs-appindicator-modes for various useful minor modes!

Installation

Prerequisites

To build daemon these packages should be installed:

  • make
  • libappindicator3-dev or libayatana-appindicator3-dev (for Ubuntu/Debian, name in your distribution may vary)

Emacs Package

Clone this repository somewhere into your load-path and add to your config

(require 'appindicator)

With use-package you can do something like:

(use-package appindicator
  :load-path "~/paht/to/appindicator/sources")

Or install it with quelpa:

(quelpa '(appindicator :repo "jumper047/emacs-appindicator" :fetcher github :files ("*.el" "appindicator-helper")))

Usage

The entry point is appindicator-create macro - creates functions to control new appindicator-helper instance.

  • appindicator-…-init - starts appindicator-helper process (usually called automatically inside appindicator-create macro)
  • appindicator-…-kill - kill appindicator helper process
  • appindicator-…-set-icon - set tray icon
  • appindicator-…-set-label - set label
  • appindicator-…-set-active - hide/show icon
  • appindicator-…-set-menu - set context menu

Note on the svg icons usage

Function appindicator-NAME-set-icon can set both icons from local filesystem and from online collections supported by svg-lib. Icons from online collections may be used like this: (appindicator-NAME-set-icon "icon-name" "collection-name"). You can check for available collections and icons they contain below:

Example

Code below will create tray icon with context menu:

(require 'appindicator)
(appindicator-create "emacs")
(appindicator-emacs-set-icon "gnuemacs" "simple")
(appindicator-emacs-set-label "emacs")
(appindicator-emacs-set-menu
 '(("Minimize to tray" . iconify-or-deiconify-frame)
   separator
   ("Hide icon" . (lambda () (appindicator-emacs-set-active nil)))))
(appindicator-emacs-set-active 't)
(appindicator-emacs-kill)

Acknowledgements

  • @zevlg for his awesome telega.el, appindicator-helper is heavily inspired by telega-server
  • @lynxr for his contribution (which was as precious as controversial)
  • @rougier for svg-lib which made this package way more convenient

About

Library to create and control tray icons with Elisp

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published