Log

Table of Contents

A log of somewhat notable events

[2026-10-23 Fri] Bluetooth emacs polybar integration

I finally integrated some bluetooth support in my emacs - polybar setup.

icons

Thanks to the emacs bluetooth package it was easy to put together some gluecode to display the currently connected devices. I already had a function that could toggle bluetooth on my machine but now that I configured polybar to actually show the current status helps a lot.

Right click on the icons shown above brings up the bluetooth list of devices known to my machine:

device-list

My general setup is running emacs as server (thus being able to use emacsclient to access the same instance), exwm as window manager and polybar as a status bar.

For some of the custom display within polybar I use the custom/script type of polybar:

[module/bluetooth]
type = custom/script
exec = ~/.config/polybar/bluetooth-status.sh
click-right = ~/.config/polybar/bluetooth-list-devices.sh
interval = 15

Within the executed shell scripts I simply call emacs-client, since I centralize the functionality in emacs itself, using then emacs-script to do the actual processing.

#!/usr/bin/env sh
RUNNING_EMACS=$(pgrep -a "emacs$" 2>/dev/null)
if [ "$RUNNING_EMACS" == "" ]; then
  exit 1
fi
RESULT=$(emacsclient -e '(gb/bluetooth-status-execute)' 2>/dev/null)
RESULT_CLEANED=$(echo "${RESULT}" | cut -d "\"" -f 2)

echo "${RESULT_CLEANED}"

and

#!/usr/bin/env sh
RUNNING_EMACS=$(pgrep -a "emacs$" 2>/dev/null)
if [ "$RUNNING_EMACS" == "" ]; then
  exit 1
fi
RESULT=$(emacsclient -e '(bluetooth-list-devices)' 2>/dev/null)

My emacs-lisp (glue) code now provides me with the right string to display within polybar.

(require 'bluetooth)
(defun get-bluetooth-device-name (ble)
  (car (mapcar #'identity (car(cdr ble)))))

(defun get-bluetooth-device-names ()
  (mapcar #'get-bluetooth-device-name
          (bluetooth--list-entries)))

(defconst bluetooth-mapped-devices
  (list '("Fairbuds XL" . "🎧")
        '("FILCO Bluetooth Keyboard" . "🄰")))
(defun bluetooth-cleanup-name (name)
  "provide cleanup names for bluetooth devices"
  (let ((replaced (assoc name bluetooth-mapped-devices)))
    (if replaced
        (cdr replaced)
      name)))

(defun get-bluetooth-device-names-connected () 
  (mapcar #'get-bluetooth-device-name
          (cl-remove-if-not
           (lambda (it) (get-bluetooth-conn-status it))
           (bluetooth--list-entries))))

(defun get-bluetooth-conn-status (ble)
  (string-equal 
   "yes"
   (nth 2 (mapcar #'identity (car(cdr ble))))))

(defun bluetooth-on-p ()
  (length>
   (string-trim
    (shell-command-to-string
     "bluetoothctl show | grep 'Controller'"))
   0))

(defun gb/bluetooth-status-execute ()
  "provide a status string for polybar.
- list connected devices if on
- a blue B if on, but no connected devices
- a gray b if off"      
  (if (bluetooth-on-p)
      (progn
        (unless bluetooth--initialized
          (bluetooth-init))
        (let ((connected-devices
               (string-join
                (mapcar #'bluetooth-cleanup-name
                        (get-bluetooth-device-names-connected))
                ", ")))
          (if (length> connected-devices 0)
              connected-devices
            "%{F#22F}B")))
    "%{F#444}b"))

In order to have the icons work in polybar, make sure to configure the respective font with the polybar configuration.

font-0 = Hack:size=8;0
font-1 = unifont:size=8;0
font-2 = NotoSansSymbols2-Regular:size=8;0
font-3 = NotoSansMonoCJKjp-Regular:size=8;0 

That is it for today.

[2026-10-16 Fri] Today I want my name to be added to the Human-Emacs list.

Let's see whether my post to the mailing list worked.

Even though I understand that given the current state of affairs, companies use the leverage of AI to provide somewhat useful functionality to customers/users quickly, I do think there are several severe reasons to not use AI.

Especially in open source projects and their associated communities, which are essential for these open source projects to flourish, the use of AI is disruptive to the skill level of all programmers and to several essential processes within these communities. Given the additional environmental impact of all that is done to provide AI services, it always is a good idea to not use it.

I therefore fully agree with the stated intent to keep emacs free of LLM generated content.

Emacs 30.2 (Org mode 10.0-pre)