https://github.com/simulatedgreg/electron-touchbar-shortcuts
A simple electron app built specifically for a TouchBar focused "shortcuts" application.
https://github.com/simulatedgreg/electron-touchbar-shortcuts
electron macos touchbar
Last synced: 3 months ago
JSON representation
A simple electron app built specifically for a TouchBar focused "shortcuts" application.
- Host: GitHub
- URL: https://github.com/simulatedgreg/electron-touchbar-shortcuts
- Owner: SimulatedGREG
- Created: 2018-09-06T04:24:57.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-06T05:02:39.000Z (almost 7 years ago)
- Last Synced: 2025-01-14T01:49:15.374Z (5 months ago)
- Topics: electron, macos, touchbar
- Language: JavaScript
- Size: 22.5 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# electron-touchbar-shortcuts
> A bare bones setup for creating _shortcut_ touch bar applications using `electron`.
### Overview
In order to create `TouchBar` items within `electron`, an instance of a `BrowserWindow` _must_ be focused in order for the items to show. This project satisfies that requirement by creating a dummy/invisible browser window that can be focused on-demand via a `globalShortcut`. Once you activate your touch bar action you can hide the application using `app.hide()` or by hitting esc. Doing so will restore focus to the previous application.The default `globalShortcut` for opening the touch bar app is Command + Shift + 2.
### What's Included
This setup doesn't include too much, but gets you up and running with a nice development environment with support for `electron` reloading via `nodemon` and ES Module support thanks to `esm`.```bash
# clone down the project
git clone https://github.com/SimulatedGREG/electron-touchbar-shortcuts.git# install dependencies
yarn# run development setup
yarn serve
```### How can I add my own functionalties?
It's rather simple. All files within the `actions` directory are all individual TouchBar items, and each file is expected to export one of the supported `TouchBar` item types.* TouchBarButton
* TouchBarColorPicker
* TouchBarGroup
* TouchBarLabel
* TouchBarPopover
* TouchBarScrubber
* TouchBarSegmentedControl
* TouchBarSlider
* TouchBarSpacerSee full documentation at https://electronjs.org/docs/api/touch-bar.
### That's it
There really isn't much more to this project. Now it's your turn to make your own actions that fit your workflow. Have fun!#### Todo
* Packaging with `electron-builder`