Skip to content

Add Omarchy actions to the Apple Silicon Touch Bar - #363

Open
austindixson wants to merge 4 commits into
omacom:quattrofrom
austindixson:apple-silicon-touchbar
Open

austindixson wants to merge 4 commits into
omacom:quattrofrom
austindixson:apple-silicon-touchbar

Conversation

@austindixson

Copy link
Copy Markdown

Summary

On M-series MacBooks with a Touch Bar, tiny-dfr already paints the DSI strip, but the stock layout is F1–F12 until you hold Fn. This puts useful Omarchy actions on the default (no-Fn) row and lets users customize it.

Default strip (no Fn): brightness, Omarchy menu, terminal, lock, screenshot, mic mute, media transport, volume.

Fn: F1–F12.

Hardware setup is aarch64 + Apple device-tree only. T2 Macs keep the kernel Boot Camp Touch Bar and do not get tiny-dfr from this leaf.

Customize

Copy shell/plugins/touchbar/layout.json to ~/.config/omarchy/touchbar.json and save. The omarchy.touchbar service regenerates /etc/tiny-dfr/config.toml. Hand-written configs that are not Omarchy-generated are left alone.

Test plan

  • ./test/shell.d/apple-touchbar-test.sh
  • ./test/shell.d/hyprland-binding-conflicts-test.sh
  • Lived on MacBookPro17,1 (M1 13" with Touch Bar): tiny-dfr running, layout installed locally first

Notes

tiny-dfr can only inject keycodes, not shell commands. Menu/terminal/lock are F13/F14/Search plus Hyprland binds in default/hypr/bindings/touchbar.lua.

tiny-dfr already owns the DSI strip on M-series MacBooks with a Touch
Bar, but the stock layout is F1–F12 until Fn is held. Ship a media-layer
default with brightness, the Omarchy menu, terminal, lock, screenshot,
and transport/volume, plus F13/F14/Search Hyprland binds so those keys
do something.

Hardware setup is aarch64 + Apple device-tree only (T2 keeps the kernel
Boot Camp bar). Users override the strip with ~/.config/omarchy/touchbar.json.
@malik-na

malik-na commented Sep 9, 2026

Copy link
Copy Markdown
Member

Saving touchbar.json runs sudo from a detached Quickshell process with no terminal or pkexec, so it will usually fail silently once sudo credentials are cold. Route install/restart through a real privilege prompt and report failures; test this on an existing install too.

Saving ~/.config/omarchy/touchbar.json ran sudo from a detached
Quickshell process, so a cold ticket failed with no prompt and no
error. Use pkexec when there is no TTY, keep sudo for a real terminal,
restart tiny-dfr without swallowing errors, and notify on apply failure.
@austindixson

Copy link
Copy Markdown
Author

Addressed in 815aefc.

Saving ~/.config/omarchy/touchbar.json no longer sudos from the detached Quickshell process. apply.sh uses pkexec (polkit prompt) when there is no TTY, keeps sudo only for a real terminal, and does not swallow tiny-dfr restart failures. The service runs apply as a Process and fires a critical Omarchy notification on a non-zero exit.

Tests cover the detached pkexec path, skipping elevation when /etc/tiny-dfr/config.toml already matches (existing install), and a failed restart.

tiny-dfr emits KEY_F13/KEY_F14, but the default us keymap has no F13/F14
keysyms, so Hyprland never matches o.bind("F13"). Use X11 codes 191/192
(evdev + 8) so term and lock fire on the virtual function row.
@austindixson

Copy link
Copy Markdown
Author

Thank you for the feedback. It is a big accomplishment to be accepted on Omarchy on mac, so i took a look at everything again and discovered some opportunities for meaningful improvement and submitted an update.

@wesleygrimes wesleygrimes added the defer Parked. Needs a decision, or may die with the fork. Do not close or port yet. label Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

defer Parked. Needs a decision, or may die with the fork. Do not close or port yet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants