Skip to content

konrad1977/punch-line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Punch Line

A modern, feature-rich mode line for Emacs

❤️ Please sponsor me if you like this package

Screenshot of Punch-line and mode line for Emacs.

Features

  • 🎨 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

Installation

(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 Toggles

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

Task Management System

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

Screenshot of a what I am currently working on.

Screenshot of a what I am currently working on.

All tasks.

Customization

Appearance

;; 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 "  ")

Section Backgrounds

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 section

Available 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.

Arrow Arrow

Circle Circle

Flame Flame

Ice Ice

None None

Block - Wraps modal and time in a solid block background with padding on all sides

Weather Configuration

(setq punch-show-weather-info t
      punch-weather-latitude "56.7365"
      punch-weather-longitude "16.2981")

Music Player Integration

(setq punch-line-music-info '(:service apple)  ; or 'spotify
      punch-line-music-max-length 80)

None

Cache Settings

;; Update intervals in seconds
(setq punch-git-cache-update-interval 5
      punch-battery-cache-update-interval 60
      punch-flycheck-cache-interval 3)

Weather Configuration Details

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 attempts

Weather Commands

M-x punch-weather-cleanup       ; Clean up timers and buffers
M-x punch-weather-force-update  ; Force immediate weather update

Changelog

Version 1.1 (2025-01-31)

Weather Module (punch-line-weather.el)

  • 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

Music Module (punch-line-music.el)

  • 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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

A minimal mode-line for emacs which is not highly configurable and doesn't work in terminal

Topics

Resources

Stars

Watchers

Forks