Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
somdoron committed Mar 29, 2020
0 parents commit 7724fb9
Show file tree
Hide file tree
Showing 46 changed files with 4,576 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/bin
/archive
/.idea
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: c
os: osx
compiler: clang
script: make install
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

[Unreleased]: https://github.com/somdoron/spacebar/compare/master...HEAD
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019 Åsmund Vikane

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!-- Please be careful editing the below HTML, as GitHub is quite finicky with anything that looks like an HTML tag in GitHub Flavored Markdown. -->
<p align="center">
<b>Status Bar for the Mac.</b>
</p>
<p align="center">
<a href="https://travis-ci.org/somdoron/spacebar">
<img src="https://travis-ci.org/somdoron/spacebar.svg?branch=master" alt="CI Status Badge">
</a>
<a href="https://github.com/somdoron/spacebar/blob/master/LICENSE.txt">
<img src="https://img.shields.io/github/license/somdoron/spacebar.svg?color=green" alt="License Badge">
</a>
<a href="https://github.com/spacebar/blob/blob/master/CHANGELOG.md">
<img src="https://img.shields.io/badge/view-changelog-green.svg" alt="Changelog Badge">
</a>
<a href="https://github.com/somdoron/spacebar/releases">
<img src="https://img.shields.io/github/commits-since/somdoron/spacebar/latest.svg?color=green" alt="Version Badge">
</a>
</p>

## About

spacebar is a status bar for [&nearr;&nbsp;yabai][gh-yabai] tiling window management.

## Installation and Configuration

- TODO: release package

- Sample configuration files can be found in the [&nearr;&nbsp;examples][spacebar-examples] directory. Refer to the [&nearr;&nbsp;documentation][spacebar-docs].


## Requirements and Caveats

Please read the below requirements carefully.
Make sure you fulfil all of them before filing an issue.

|Requirement|Note|
|-:|:-|
|Operating&nbsp;System|macOS Catalina 10.15.0+ is supported.|
|Accessibility&nbsp;API|spacebar must be given permission to utilize the Accessibility API and will request access upon launch. The application must be restarted after access has been granted.|

Please also take note of the following caveats.

|Caveat|Note|
|-:|:-|
|Code&nbsp;Signing|When building from source (or installing from HEAD), it is recommended to codesign the binary so it retains its accessibility and automation privileges when updated or rebuilt.|
|Mission&nbsp;Control|In the Mission Control preferences pane in System Preferences, the setting "Automatically rearrange Spaces based on most recent use" should be disabled.|

## License and Attribution

spacebar is licensed under the [&nearr;&nbsp;MIT&nbsp;License][spacebar-license], a short and simple permissive license with conditions only requiring preservation of copyright and license notices.
Licensed works, modifications, and larger works may be distributed under different terms and without source code.

Thanks to [@koekeishiya][gh-koekeishiya] for creating yabai.

## Disclaimer

Use at your own discretion.
I take no responsibility if anything should happen to your machine while trying to install, test or otherwise use this software in any form.

<!-- Project internal links -->
[spacebar-license]: LICENSE.txt
[spacebar-examples]: https://github.com/somdoron/spacebar/tree/master/examples
[spacebar-docs]: https://github.com/somdoron/spacebar/blob/master/doc/spacebar.asciidoc

<!-- Links to other GitHub projects/users -->
[gh-koekeishiya]: https://github.com/koekeishiya
[gh-yabai]: https://github.com/koekeishiya/yabai
123 changes: 123 additions & 0 deletions doc/spacebar.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
'\" t
.\" Title: spacebar
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.10
.\" Date: 2020-03-29
.\" Manual: Spacebar Manual
.\" Source: Spacebar
.\" Language: English
.\"
.TH "SPACEBAR" "1" "2020-03-29" "Spacebar" "Spacebar Manual"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
spacebar \- status bar for yabai tile window management utility
.SH "SYNOPSIS"
.sp
\fBspacebar\fP [\fB\-v\fP,\fB\-\-version\fP|\fB\-V\fP,\fB\-\-verbose\fP|\fB\-m\fP,\fB\-\-message\fP \fImsg\fP|\fB\-c\fP,\fB\-\-config\fP \fIconfig_file\fP]
.SH "DESCRIPTION"
.sp
\fBspacebar\fP is a tiling window manager for macOS based on binary space partitioning.
.SH "OPTIONS"
.sp
\fB\-v\fP, \fB\-\-version\fP
.RS 4
Print the version and exit.
.RE
.sp
\fB\-V\fP, \fB\-\-verbose\fP
.RS 4
Output debug information to stdout.
.RE
.sp
\fB\-m\fP, \fB\-\-message\fP \fI<msg>\fP
.RS 4
Send message to a running instance of spacebar.
.RE
.sp
\fB\-c\fP, \fB\-\-config\fP \fI<config_file>\fP
.RS 4
Use the specified configuration file.
.RE
.SH "CONFIG"
.SS "General Syntax"
.sp
spacebar \-m config <setting>
.RS 4
Get or set the value of <setting>.
.RE
.SS "Settings"
.sp
\fBdebug_output\fP [\fI<BOOL_SEL>\fP]
.RS 4
Enable output of debug information to stdout.
.RE
.sp
\fBstatus_bar_text_font\fP [\fI<font_family>:<font_style>:<font_size>\fP]
.RS 4
Specify name, style and size of font to use for drawing text.
.br
Use \fIFont Book.app\fP to identify the correct name.
.RE
.sp
\fBstatus_bar_icon_font\fP [\fI<font_family>:<font_style>:<font_size>\fP]
.RS 4
Specify name, style and size of font to use for drawing icon symbols.
.br
Use \fIFont Book.app\fP to identify the correct name.
.RE
.sp
\fBstatus_bar_background_color\fP [\fI<COLOR>\fP]
.RS 4
Color to use for drawing status bar background.
.RE
.sp
\fBstatus_bar_foreground_color\fP [\fI<COLOR>\fP]
.RS 4
Color to use for drawing status bar elements.
.RE
.sp
\fBstatus_bar_space_icon_strip\fP [\fI<sym_1> <sym_2> <sym_n>\fP]
.RS 4
Specify symbols separated by whitespace to be used for visualizing spaces.
.RE
.sp
\fBstatus_bar_power_icon_strip\fP [\fI<sym_battery> <sym_ac>\fP]
.RS 4
Specify two symbols separated by whitespace.
.br
The first symbol represents battery power and the second symbol indicates AC.
.RE
.sp
\fBstatus_bar_space_icon\fP [\fI<sym>\fP]
.RS 4
Specify a general symbol to use for any given space that does not have a match in \fIstatus_bar_space_icon_strip\fP.
.RE
.sp
\fBstatus_bar_clock_icon\fP [\fI<sym>\fP]
.RS 4
Specify a symbol to represent the current time.
.RE
.SH "EXIT CODES"
.sp
If \fBspacebar\fP can\(cqt handle a message, it will return a non\-zero exit code.
.SH "AUTHOR"
.sp
Doron Somech <somdoron at gmail.com>
98 changes: 98 additions & 0 deletions doc/spacebar.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
:man source: Spacebar
:man version: {revnumber}
:man manual: Spacebar Manual

ifdef::env-github[]
:toc:
:toc-title:
:toc-placement!:
:numbered:
endif::[]

spacebar(1)
===========

ifdef::env-github[]
toc::[]
endif::[]

Name
----

spacebar - Status bar for mac

Synopsis
--------

*spacebar* [*-v*,*--version*|*-V*,*--verbose*|*-m*,*--message* 'msg'|*-c*,*--config* 'config_file']

Description
-----------

*spacebar* is a tiling window manager for macOS based on binary space partitioning.

Options
-------
*-v*, *--version*::
Print the version and exit.

*-V*, *--verbose*::
Output debug information to stdout.

*-m*, *--message* '<msg>'::
Send message to a running instance of spacebar.

*-c*, *--config* '<config_file>'::
Use the specified configuration file.

Config
------

General Syntax
~~~~~~~~~~~~~~

spacebar -m config <setting>::
Get or set the value of <setting>.

Settings
~~~~~~~~

*debug_output* ['<BOOL_SEL>']::
Enable output of debug information to stdout.

*status_bar_text_font* ['<font_family>:<font_style>:<font_size>']::
Specify name, style and size of font to use for drawing text. +
Use 'Font Book.app' to identify the correct name.

*status_bar_icon_font* ['<font_family>:<font_style>:<font_size>']::
Specify name, style and size of font to use for drawing icon symbols. +
Use 'Font Book.app' to identify the correct name.

*status_bar_background_color* ['<COLOR>']::
Color to use for drawing status bar background.

*status_bar_foreground_color* ['<COLOR>']::
Color to use for drawing status bar elements.

*status_bar_space_icon_strip* ['<sym_1> <sym_2> <sym_n>']::
Specify symbols separated by whitespace to be used for visualizing spaces.

*status_bar_power_icon_strip* ['<sym_battery> <sym_ac>']::
Specify two symbols separated by whitespace. +
The first symbol represents battery power and the second symbol indicates AC.

*status_bar_space_icon* ['<sym>']::
Specify a general symbol to use for any given space that does not have a match in 'status_bar_space_icon_strip'.

*status_bar_clock_icon* ['<sym>']::
Specify a symbol to represent the current time.

Exit Codes
----------

If *spacebar* can't handle a message, it will return a non-zero exit code.

Author
------

Doron Somech <somdoron at gmail.com>
12 changes: 12 additions & 0 deletions examples/spacebarrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh

spacebar -m config status_bar_text_font "Helvetica Neue:Bold:12.0"
spacebar -m config status_bar_icon_font "FontAwesome:Regular:12.0"
spacebar -m config status_bar_background_color 0xff202020
spacebar -m config status_bar_foreground_color 0xffa8a8a8
spacebar -m config status_bar_space_icon_strip I II III IV V VI VII VIII IX X
spacebar -m config status_bar_power_icon_strip  
spacebar -m config status_bar_space_icon 
spacebar -m config status_bar_clock_icon 

echo "spacebar configuration loaded.."
46 changes: 46 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FRAMEWORK_PATH = -F/System/Library/PrivateFrameworks
FRAMEWORK = -framework Carbon -framework Cocoa -framework CoreServices -framework SkyLight -framework ScriptingBridge -framework IOKit
BUILD_FLAGS = -std=c99 -Wall -DDEBUG -g -O0 -fvisibility=hidden -mmacosx-version-min=10.13
BUILD_PATH = ./bin
DOC_PATH = ./doc
SCRIPT_PATH = ./scripts
ASSET_PATH = ./assets
SMP_PATH = ./examples
ARCH_PATH = ./archive
SPACEBAR_SRC = ./src/manifest.m
BINS = $(BUILD_PATH)/spacebar

.PHONY: all clean install sign archive man

all: clean $(BINS)

install: BUILD_FLAGS=-std=c99 -Wall -DNDEBUG -O2 -fvisibility=hidden -mmacosx-version-min=10.13
install: clean $(BINS)

stats: BUILD_FLAGS=-std=c99 -Wall -DSTATS -DNDEBUG -O2 -fvisibility=hidden -mmacosx-version-min=10.13
stats: clean $(BINS)

man:
asciidoctor -b manpage $(DOC_PATH)/spacebar.asciidoc -o $(DOC_PATH)/spacebar.1

icon:
python $(SCRIPT_PATH)/seticon.py $(ASSET_PATH)/icon/2x/[email protected] $(BUILD_PATH)/spacebar

archive: man install sign icon
rm -rf $(ARCH_PATH)
mkdir -p $(ARCH_PATH)
cp -r $(BUILD_PATH) $(ARCH_PATH)/
cp -r $(DOC_PATH) $(ARCH_PATH)/
cp -r $(SMP_PATH) $(ARCH_PATH)/
tar -cvzf $(BUILD_PATH)/$(shell $(BUILD_PATH)/spacebar --version).tar.gz $(ARCH_PATH)
rm -rf $(ARCH_PATH)

sign:
codesign -fs "spacebar-cert" $(BUILD_PATH)/spacebar

clean:
rm -rf $(BUILD_PATH)

$(BUILD_PATH)/spacebar: $(SPACEBAR_SRC)
mkdir -p $(BUILD_PATH)
clang $^ $(BUILD_FLAGS) $(FRAMEWORK_PATH) $(FRAMEWORK) -o $@
Loading

0 comments on commit 7724fb9

Please sign in to comment.