A modern, feature-rich mode line for Emacs
❤️ Please sponsor me if you like this package
- 🎨 Highly customizable appearance
- 👿 Evil/Meow mode integration
- 🎵 Music player integration (Apple Music/Spotify)
- 🌡️ Weather information
- 📊 Git status and branch information
- 🔋 Battery status
- ⌚ Time display
- 🤖 Copilot integration
- ✅ Flycheck integration
- 📝 LSP/Eglot support
- 📋 Task management system
- 🎯 Project awareness
(use-package punch-line
:ensure nil
:after ((after-init . punch-line-mode) ;; Load punch-line
(after-init . punch-weather-update) ;; Load weather
(after-init . punch-load-tasks)) ;; Load saved current tasks
:config
(setq
punch-line-left-separator " "
punch-line-right-separator " "
punch-line-music-info '(:service apple) ;; Music service configuration
punch-line-music-max-length 80)) ;; Max length of artist and song| Feature Toggle | Default | Description |
|---|---|---|
punch-line-show-modal-section |
t | Show Evil/Meow mode states |
punch-line-modal-use-fancy-icon |
t | Use fancy icons for modal states |
punch-show-git-info |
t | Display Git branch and status |
punch-show-project-info |
t | Show current project information |
punch-show-lsp-info |
t | Display LSP/Eglot status |
punch-show-copilot-info |
t | Show Copilot status |
punch-show-battery-info |
t | Display battery status |
punch-show-weather-info |
t | Show weather information |
punch-show-flycheck-info |
t | Display Flycheck status |
punch-show-processes-info |
t | Show active processes |
punch-show-org-info |
t | Display Org-mode information |
punch-show-misc-info |
nil | Show miscellaneous information |
punch-line-show-time-info |
t | Display current time |
punch-show-column-info |
nil | Show column number |
punch-show-buffer-position |
nil | Display buffer position |
punch-show-what-am-i-doing-info |
t | Show current task information |
punch-battery-show-percentage |
t | Display battery percentage |
The built-in task management system helps you keep track of your current activities:
M-x punch-line-what-am-i-doing-next # View next tasks
M-x punch-line-what-am-i-doing-done # Mark current task as completed
M-x punch-line-what-am-i-doing-show-all # Display all tasks
M-x punch-line-what-am-i-doing-next-task # Switch to next task
M-x punch-line-what-am-i-doing-previous-task # Switch to previous task;; Mode line size
(setq punch-line-modal-size 'small) ; Options: 'small, 'medium, 'large
;; Divider style
(setq punch-line-modal-divider-style 'circle) ; Options: 'arrow, 'flame, 'ice, 'circle, 'block
;; Separators
(setq punch-line-left-separator " ")
(setq punch-line-right-separator " ")Customize background colors for individual mode-line sections:
;; Manual colors for specific sections
(setq punch-line-section-backgrounds
'((filename . "#201010")
(battery . "#000000")
(git . "#1a1a2e")
(major-mode . "#16213e")))
;; Automatic tinting - each section gets progressively lighter
(setq punch-line-section-backgrounds 'auto)
(setq punch-line-section-background-tint-step 5) ; 5% lighter each section
;; Automatic with darker progression
(setq punch-line-section-backgrounds 'auto)
(setq punch-line-section-background-tint-step -5) ; 5% darker each sectionAvailable sections:
- Left side:
filename,major-mode,project,flycheck,what-am-i-doing,process - Right side:
music,system-monitor,column,position,copilot,term,misc,git,weather,battery
Note: Evil/Meow status and time sections maintain their own styling and are excluded from section backgrounds.
Block - Wraps modal and time in a solid block background with padding on all sides
(setq punch-show-weather-info t
punch-weather-latitude "56.7365"
punch-weather-longitude "16.2981")(setq punch-line-music-info '(:service apple) ; or 'spotify
punch-line-music-max-length 80);; Update intervals in seconds
(setq punch-git-cache-update-interval 5
punch-battery-cache-update-interval 60
punch-flycheck-cache-interval 3)The weather module includes robust error handling and caching:
;; Weather fetch settings
(setq punch-weather-update-interval 3600 ; Update every hour (seconds)
punch-weather-request-timeout 10 ; Request timeout (seconds)
punch-weather-max-retries 3) ; Max retry attemptsM-x punch-weather-cleanup ; Clean up timers and buffers
M-x punch-weather-force-update ; Force immediate weather update- Fixed: "Selecting deleted buffer" errors during long Emacs sessions
- Fixed: Race conditions with buffer lifecycle management
- Added: Fetch guard to prevent multiple simultaneous API requests
- Improved: Timeout handling with proper buffer cleanup
- Improved: Error handling in async callbacks
- Fixed: Buffer lifecycle issues in process sentinel
- Improved: Timeout handler now uses proper closure with process parameter
- Improved: More robust buffer existence checks before operations
Contributions are welcome! Please feel free to submit a Pull Request.









