Integrate desktop environment’s taskbar/dock with Emacs.
Any dock supporting Unity’s Launcher API should be compatible. Those confirmed to work well include:
- KDE’s taskbar
- Gnome Shell with “Dash to Dock” extension
Simple configuration for init.el could be something like this:
(use-package dock
:init
;; Request user's attention when compilation is finished.
;; Do nothing if Emacs frame has focus.
(add-hook 'compilation-finish-functions
(lambda (_buf _msg) (dock-set-needs-attention))))The package is intended to be used as a library and you can integrate it with any workflow you have. After requiring it, dock-track-urgency-mode is activated. It provides very minimal, but expected behavior:
- It automatically removes urgent status when an Emacs frame gains focus.
- It prevents setting urgent status if the frame already has focus when `dock-set-needs-attention’ is called.
Here is the list of functions you can use:
dock-set-needs-attention: Request attention for the Emacs Dock icondock-remove-needs-attention: Remove the ‘needs attention’ statedock-set-count-badge: Set the count badgedock-remove-count-badge: Remove the count badgedock-set-progress: Set the progress indicatordock-remove-progress: Remove the progress indicator
Also, there is one important variable dock-desktop-entry which specifies what entry on the Dock will be targeted. It is set to “emacs”, so “emacs.desktop” entry receives the commands. In case you use separate desktop files for different instances of Emacs you might want to set it accordingly. For example, you might have a desktop file for Org mode saved as “org-mode.desktop” shown below. In this case, set the variable to “org-mode”.
[Desktop Entry]
Categories=Utility
Comment=Get Things Done with org-mode
Exec=emacs --name org-mode --eval "(org-agenda-list)"
Icon=org-mode-unicorn
Name=GTD
StartupNotify=true
StartupWMClass=org-mode
Terminal=false
Type=Application- org-agenda-dock: Number of TODOs on the Dock