No description
Find a file
Donald Guy 4fafebb542 Only factor in menu-bar height for top bar
use log.c facility for EVENT_HANDLER_MOUSE_UP log/printf
2021-08-18 19:05:45 -04:00
images added image 2021-08-14 02:03:51 +02:00
plugins added click actions and some tweaking to the graph logic 2021-08-17 02:11:40 +02:00
src Only factor in menu-bar height for top bar 2021-08-18 19:05:45 -04:00
.gitignore working prototype 2021-08-10 00:08:31 +02:00
makefile move refresh logic to improve performance on multi monitor setups 2021-08-18 23:14:27 +02:00
README.md added comment for updating 2021-08-18 23:22:01 +02:00
sketchybarrc remove bounding rect comment and added position in rc 2021-08-19 00:42:00 +02:00

SketchyBar

This is a rewrite of the spacebar project, which itself is a rewrite of the statusbar code from yabai. What I have added:

  • As many widgets as you like at any of the three positions: left, center, right
  • The order of the widgets in the sketchybarrc file will be the order in which they show in the bar
  • Associate widgets to certain displays or spaces, to show specific information on the relevant screens/displays
  • The widgets are highly customizable with settings for different fonts, colors, icon paddings, label paddings, etc. for each individual element
  • Relocate all visible components of the bar (even spaces or the window title, etc.)
  • Draw arbitrary graphs in the bar with external data provider scripts that push the data into the graph
  • Overlay as many graphs as wanted, like system cpu usage and user cpu usage in one figure
  • Individual refresh frequencies for each widget
  • Let items subscribe to system events (e.g. space changed, window focused, etc.) for their refresh action (like in yabai)
  • "click" events for the widgets, where a script can be specified to run on a mouse click
  • ... feel free to explore my sketchybarrc file for more details on the options

I have many more plans for the project:

  • Let items subscribe to system events (e.g. space changed, window focused, etc.) for their refresh action (like in yabai) (DONE)
  • Cache the scripts in RAM to reduce I/O operations
  • Make the associated_space / associated_display properties more powerful by allowing to associate to more than one screen/display (DONE)
  • Make application specific widgets with associated_app argument (e.g. when gvim is open show the vim mode indicator in the status bar)
  • Fix the currently static positioning of the bar
  • A y_offset property for all items to create (in combination with the nospace modifier) vertically stacked labels
  • "click" events for the widgets, where a script can be specified to run on a mouse click (DONE)
  • Create more plugins
  • ......

This is my setup: where I have my screens and a vim mode indicator on the left. Not shown is the high memory warning which shows the process that is using high system memory on demand. In the center I have a spotify indicator (only when music is playing) and on the right I have (not shown) a high cpu process indicator, as well as a cpu graph, a github contribution counter, a new mail counter and the current date.

The cpu and memory indicators are only shown on the "code" screen and are not visible on the other screens.

Installation

Clone the repo and in it run

make install

This installs the app with my configuration preinstalled.

You can customize the configuration inside of $HOME/.config/sketchybar/sketchybarrc and run the bar via

sketchybar

If you want to use your own plugins, make sure that they are referenced in the rc with the correct path and that they are made executable via

chmod +x name/of/plugin.sh

You should of course vet the code from all plugins before granting them the executable bit to make sure they are not harming your computer.

If you have problems with missing fonts you might need to install the Hack Nerd Font:

brew tap homebrew/cask-fonts
brew install --cask font-hack-nerd-font

Updating

Since this is a work-in-progress project, there might be big and radical changes along the way. You can update by pulling from master and in the up to date repo folder run:

make update

This will not touch your configuration and the plugins, so if there is a radical change to the source code you might need to update those files too.

Credits

yabai, spacebar, reddit, many more for the great code base and inspiration