Touch Bar Enhancer is a simple Touch Bar configurator for Linux, designed specifically for Apple MacBook Pro laptops equipped with a Touch Bar running Linux (T2 Macs).
It provides an intuitive graphical interface to configure layouts, map functions, and deploy settings directly to tiny-dfr, the underlying daemon responsible for rendering the Touch Bar on Linux.
- Visual Layout Editor: Easily add, arrange, and remove Touch Bar buttons visually.
- Dual Layout Support: Configure separate layouts for standard Function Keys (F1-F12) and Media Keys.
- CupertinoIcons Integration: Natively maps Apple's Cupertino icons to rasterized PNGs automatically, ensuring a native macOS look and feel.
- Hardware Toggles: Control critical Touch Bar features such as:
- Show Button Outlines: Toggle visual borders around touch targets.
- Enable Pixel Shift: Hardware burn-in protection for the OLED display.
- Adaptive Brightness: Use the ambient light sensor to adjust Touch Bar brightness.
- One-Click Deployment: Generates
config.toml, handles required PNG icon rendering, and automatically restarts thetiny-dfrdaemon viapkexec(PolicyKit).
Touch Bar Enhancer is built using Python and frameworks:
- Python (>= 3.10): Core programming language.
- PyQt6: The foundation of the graphical user interface, utilizing the modern Fusion style and Wayland support.
- uv: Used for extremely fast dependency management and environment isolation.
- tiny-dfr: The system-level Rust daemon that interfaces with the Touch Bar hardware. This application acts as a high-level frontend for it.
- CupertinoIcons: Embedded TrueType font utilized dynamically to render high-quality PNG icons for
tiny-dfron the fly.
- You must have a compatible MacBook Pro running Linux (T2 Mac).
- Ensure
tiny-dfris installed and enabled on your system (systemctl status tiny-dfr). - Ensure
pkexec(PolicyKit) is installed, as it is required to deploy configurations to system directories (/etc/and/var/lib/).
Clone the repository and run the application using uv:
# Clone the repository
git clone https://github.com/julienbelanger1/T2Linux-Touchbar-Enhancer.git
cd T2Linux-Touchbar-Enhancer
# Run the app directly using uv (it will handle dependencies)
uv run python -m touchbar_enhancer- Select Layout: Choose between editing the
F1-F12layout or theMedia Keyslayout using the top toggle. - Add Buttons: Click items in the Toolbox (right pane) to add them to your active layout.
- Remove Buttons: Click any button on the Active Layout preview (left pane) to remove it.
- Adjust Settings: Toggle Pixel Shift, Adaptive Brightness, and Outlines.
- Deploy: Click Deploy to Touchbar. You will be prompted for your user password via
pkexecto apply the system-wide systemd and tiny-dfr configurations.
- Graphical GUI & Previews: The PyQt6 UI successfully renders your layout exactly as it will appear.
- Icon Generation: Translating vector CupertinoIcons fonts into static PNGs for
tiny-dfrworks flawlessly. - Daemon Management: Safely injecting a
systemddrop-in configuration and restarting thetiny-dfrservice without manual terminal intervention. - Settings Persistence: User configurations are successfully backed up to
~/.config/touchbar-enhancer/config.tomland/var/lib/touchbar-enhancer/.
- Drag-and-Drop Reordering: Currently, you cannot drag items to rearrange them in the active layout. You must remove and re-add them in the correct order.
- Custom SVGs: Importing arbitrary
.svgor.pngfiles from the filesystem is not fully wired up yet; you are limited to the embeddedPRESETSand Cupertino icons. - Non-systemd Init Systems: The deploy script relies entirely on
systemddrop-ins. Systems using OpenRC, runit, or dinit will need to apply the generated/etc/tiny-dfr/config.tomlmanually. - Wayland
pkexecGUI Prompt: Depending on your Wayland compositor,pkexecmight fallback to the terminal or fail if a graphical authentication agent (likepolkit-kde-agentorpolkit-gnome) isn't running.
If you wish to contribute, the following features would be excellent additions:
- Drag-and-Drop Architecture: Refactor the
QBoxLayoutpreview to a list widget or custom canvas that supports Qt Drag & Drop events. - Custom Icon Importer: A file picker dialog allowing users to upload their own
.pngor.svgicons, copy them to/var/lib/touchbar-enhancer/icons, and append them to the toolbox. - Multi-Profile Support: Allow users to save and load different "Layout Profiles" (e.g., "Developer", "Media Editing", "Minimalist") to disk.
- Standalone AppImage / Flatpak: Package the application so users don't need Python or
uvinstalled, easing distribution across Fedora, Arch, and Ubuntu. - Polkit Integration Alternative: Replace
pkexecshell scripts with a native DBus interface orsudofallback to improve compatibility across different desktop environments.
This project is open-source. MIT License.