├── .github ├── FUNDING.yml └── workflows │ └── build-and-release.yaml ├── .gitignore ├── CHANGELOG.md ├── LICENSE.txt ├── README.md ├── doc ├── spacebar.1 └── spacebar.asciidoc ├── examples └── spacebarrc ├── flake.lock ├── flake.nix ├── makefile └── src ├── application.c ├── application.h ├── application_manager.c ├── application_manager.h ├── bar.c ├── bar.h ├── bar_manager.c ├── bar_manager.h ├── display.c ├── display.h ├── display_manager.c ├── display_manager.h ├── event.c ├── event.h ├── event_loop.c ├── event_loop.h ├── manifest.m ├── message.c ├── message.h ├── misc ├── dnd.c ├── hashtable.h ├── helpers.h ├── log.h ├── macros.h ├── memory_pool.h ├── notify.h ├── sbuffer.h ├── socket.c ├── socket.h └── timing.h ├── process_manager.c ├── process_manager.h ├── spacebar.c ├── window.c ├── window.h ├── workspace.h └── workspace.m /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [cmacrae] 2 | -------------------------------------------------------------------------------- /.github/workflows/build-and-release.yaml: -------------------------------------------------------------------------------- 1 | name: Build & Release 2 | 3 | on: 4 | push: 5 | branches: [] 6 | tags: 7 | - 'v*' 8 | - "testing" 9 | paths: 10 | - 'src/**' 11 | - '.github/**' 12 | 13 | jobs: 14 | build-and-release: 15 | runs-on: macos-11 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v2 19 | with: 20 | # Flakes don't work on shallow clones 21 | fetch-depth: 0 22 | 23 | - name: Configure Git 24 | run: | 25 | git config user.name "$GITHUB_ACTOR" 26 | git config user.email "$GITHUB_ACTOR@users.noreply.github.com" 27 | 28 | - name: Install Nix 29 | uses: cachix/install-nix-action@v16 30 | with: 31 | extra_nix_config: | 32 | experimental-features = nix-command flakes 33 | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 34 | 35 | - name: Build 36 | id: build-bin 37 | run: | 38 | make all 39 | 40 | - name: Check execution & get version 41 | id: check-bin 42 | run: | 43 | echo "::set-output name=version::$(./bin/spacebar --version | cut -d- -f2)" 44 | 45 | - name: Build with Nix 46 | run: | 47 | nix build . 48 | 49 | - name: Get the current tag name 50 | if: ${{ startsWith(github.ref, 'refs/tags/') }} 51 | run: | 52 | echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV 53 | 54 | - name: Check bin version before release 55 | if: ${{ startsWith(github.ref, 'refs/tags/') && !startsWith(github.ref, 'refs/tags/testing') }} 56 | run: | 57 | [[ "$RELEASE_VERSION" == ${{ steps.check-bin.outputs.version }} ]] 58 | 59 | - name: Create release archive 60 | if: ${{ startsWith(github.ref, 'refs/tags/') }} 61 | id: archive 62 | run: | 63 | tar czvf spacebar-$RELEASE_VERSION.tar.gz bin/spacebar doc examples 64 | echo "::set-output name=file::spacebar-$RELEASE_VERSION.tar.gz" 65 | echo "::set-output name=sha::$(shasum -a 256 spacebar-$RELEASE_VERSION.tar.gz | cut -d" " -f1)" 66 | 67 | - name: Create release 68 | if: ${{ startsWith(github.ref, 'refs/tags/') }} 69 | id: create-release 70 | uses: actions/create-release@v1 71 | env: 72 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 73 | with: 74 | draft: ${{ startsWith(github.ref, 'refs/tags/testing') }} 75 | tag_name: ${{ github.ref }} 76 | release_name: ${{ env.RELEASE_VERSION }} 77 | body: | 78 | [Changelog](https://github.com/cmacrae/spacebar/blob/master/CHANGELOG.md) 79 | 80 | You can find a precompiled release tarball in the release assets below. 81 | SHA-256 checksum: 82 | `${{ steps.archive.outputs.sha }}` 83 | 84 | - name: Upload release archive 85 | if: ${{ startsWith(github.ref, 'refs/tags/') }} 86 | id: upload-release-asset 87 | uses: actions/upload-release-asset@v1 88 | env: 89 | GITHUB_TOKEN: ${{ github.token }} 90 | with: 91 | upload_url: ${{ steps.create-release.outputs.upload_url }} 92 | asset_path: ${{ steps.archive.outputs.file }} 93 | asset_name: ${{ steps.archive.outputs.file }} 94 | asset_content_type: application/gzip 95 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /archive 3 | /.idea 4 | result 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [Unreleased](https://github.com/cmacrae/spacebar/compare/v1.4.0...HEAD) 8 | 9 | ## [1.4.0](https://github.com/cmacrae/spacebar/releases/tag/v1.4.0) - 2022-02-14 10 | **Changed** 11 | - Fixed a bug that caused segfaults & rendering issues on Monterey (thanks [@cxa](https://github.com/cxa)!) 12 | - Use Big Sur for CI builds 13 | 14 | **Added** 15 | - Support Apple Silicon for Nix package/flake 16 | 17 | ## [1.3.0](https://github.com/cmacrae/spacebar/releases/tag/v1.3.0) - 2020-04-25 18 | **Changed** 19 | - Fixed a bug introduced in Big Sur where buffer reads were incorrect 20 | - Improved efficiency of bar's initialisation 21 | - Fixed DoNotDisturb indicator on Big Sur 22 | 23 | **Added** 24 | - New `left|center|right` shell sections: display custom text based on shell pipelines 25 | - Option to turn focused window title display on or off (thanks [@Norviah](https://github.com/Norviah)!) 26 | - Option to turn the spaces indicator on or off 27 | - Option to turn the clock on or off 28 | - Option to turn the power indicator on or off 29 | - Option to turn the DoNotDisturb indicator on or off 30 | - Option to set the padding between the first/last item and the left/right edge of the display 31 | - Default to "Solid" style of Font Awesome 5 Free icon font 32 | - Option to display spaces for all displays, including: optional separator, secondary & tertiary space indicator colours in relation to display 33 | - Option to specify only drawing one bar on the main display or multiple bars, one for each display (this aligns with yabai's `external_bar` option) 34 | - Provide a [Nix Flake](https://nixos.wiki/wiki/Flakes) 35 | 36 | ## [1.2.1](https://github.com/cmacrae/spacebar/releases/tag/v1.2.1) - 2020-11-18 37 | 38 | **Changed** 39 | - Fixed a bug where querying for the value of `space_icon_strip` would set it to default (thanks [@jraregris](https://github.com/jraregris)) 40 | 41 | ## [1.2.0](https://github.com/cmacrae/spacebar/releases/tag/v1.2.0) - 2020-11-18 42 | 43 | **Added** 44 | - Spacing configuration options 45 | 46 | ## [1.1.1](https://github.com/cmacrae/spacebar/releases/tag/v1.1.1) - 2020-07-21 47 | 48 | **Changed** 49 | - Fixed a bug where long window titles would draw over the right status area 50 | - Padding between items in the status area based on current values 51 | 52 | ## [1.1.0](https://github.com/cmacrae/spacebar/releases/tag/v1.1.0) - 2020-07-17 53 | 54 | **Added** 55 | - Height configuration option 56 | 57 | ## [1.0.0](https://github.com/cmacrae/spacebar/releases/tag/v1.0.0) - 2020-07-16 58 | 59 | **Added** 60 | - Option to position at the top or bottom of the screen 61 | - Individual colour settings for each icon in the right strip (`dnd`, `power`, `clock`) 62 | - DoNotDisturb indicator 63 | 64 | **Changed** 65 | - Current space indicated by colouring the glyph 66 | - Removal of underlines 67 | - Fixed flicker bug when changing monitor focus (thanks [@tom-auger](https://github.com/tom-auger)) 68 | 69 | ## Pre-1.0.0 70 | This changelog was not kept up to date prior to `1.0.0`. 71 | See the commit log for more information. 72 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Calum MacRae 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

3 | A minimal status bar for macOS 4 |

5 |

6 | 7 | Build Status Badge 8 | 9 | 10 | License Badge 11 | 12 | 13 | Changelog Badge 14 | 15 |

16 |

17 | 18 | Nix Badge 19 | 20 | 21 | GitHub Project Badge 22 | 23 | 24 | Version Badge 25 | 26 | 27 | Discussions Badge 28 | 29 | 30 | Discussions Badge 31 | 32 |

33 | 34 | ## About 35 | spacebar is a minimal status bar for macOS. Ideal for use with tiling window managers like [yabai](https://github.com/koekeishiya/yabai). 36 | 37 |

38 | spacebar demo 39 |

40 | 41 | ## Installation 42 | A package and service to install and manage spacebar is provided in two flavours: [Homebrew](https://brew.sh) & [Nix](https://nixos.org). 43 | There is also a precompiled binary archive available in [the latest release assets](https://github.com/cmacrae/spacebar/releases/tag/v1.4.0). 44 | 45 | ### Homebrew 46 | spacebar can be installed using Homebrew from the `cmacrae/formulae` tap 47 | ``` 48 | brew install cmacrae/formulae/spacebar 49 | brew services start spacebar 50 | ``` 51 | 52 | ### Nix 53 | A package is generally available to Nix users on macOS in the various channels. 54 | A [Flake](https://nixos.wiki/wiki/Flakes) is also available in this repository and can be used like so: 55 | ```nix 56 | { 57 | inputs.darwin.url = "github:lnl7/nix-darwin"; 58 | inputs.spacebar.url = "github:cmacrae/spacebar/v1.4.0"; 59 | 60 | outputs = { self, darwin, spacebar }: { 61 | darwinConfigurations.example = darwin.lib.darwinSystem { 62 | modules = [ 63 | { 64 | nixpkgs.overlays = [ 65 | spacebar.overlay 66 | ]; 67 | } 68 | ]; 69 | }; 70 | }; 71 | } 72 | ``` 73 | Or try it out with `nix run github:cmacrae/spacebar/v1.4.0`! 74 | 75 | spacebar can be configured and managed in a declarative manner using the `services.spacebar` module in [nix-darwin](https://github.com/LnL7/nix-darwin) 76 | 77 | ### Accessibility Permissions 78 | spacebar makes use of the macOS Accessibility APIs - after starting spacebar, you should be prompted to grant access. 79 | Open System Preferences.app and navigate to Security & Privacy, then Privacy, then Accessibility. Click the lock icon at the bottom and enter your password to allow changes to the list. Check the box next to spacebar to allow accessibility permissions. 80 | 81 | ## Configuration 82 | spacebar is configured by setting `config` properties via its messaging socket. Not only does this mean you can try out config changes live, it also means spacebar's configuration file is simply a shell script - usually just a sequence of `spacebar -m config