mirror of
https://github.com/stumpwm/stumpwm-contrib.git
synced 2026-09-10 07:26:25 -04:00
17 lines
368 B
Common Lisp
17 lines
368 B
Common Lisp
;; hostname.lisp
|
|
;;
|
|
;; Put %h in your modeline format string to show your hostname
|
|
;;
|
|
|
|
(defpackage #:hostname
|
|
(:use #:cl :stumpwm))
|
|
|
|
(in-package #:hostname)
|
|
|
|
(defun fmt-hostname (ml)
|
|
"Return hostname"
|
|
(declare (ignore ml))
|
|
(format nil "~a" (car (split-string (machine-instance) ". "))))
|
|
|
|
;; Install formatter
|
|
(add-screen-mode-line-formatter #\h #'fmt-hostname) |