From ffec2a8edb91d3deea95b486eabde6d5b8eed9b1 Mon Sep 17 00:00:00 2001 From: FelixKratz Date: Mon, 27 Sep 2021 00:08:41 +0200 Subject: [PATCH] added undocumented features --- README.md | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5d8e116..3925226 100644 --- a/README.md +++ b/README.md @@ -194,22 +194,24 @@ where the settings currently are: ### Adding a simple menubar item (items will appear in the bar in the order they are added) ```bash -sketchybar -m add item +sketchybar -m add item [optional: ] ``` with batching possible via: ```bash -sketchybar -m batch --add item +sketchybar -m batch --add item [optional: ] ``` where the *name* should not contain whitespaces, it can be used to further configure the item, which is covered later. The *position* is the placement in the bar and can be either *left*, *right* or *center*. +The list of modifiers for item creation is short currently: +* *nospace*: This item is reserves no space in the bar and the next item starts exactly where this item starts (good for stacked widgets) ### Adding a component ```bash -sketchybar -m add component +sketchybar -m add component [optional: ] ``` or for batching of commands: ```bash -sketchybar -m batch --add component +sketchybar -m batch --add component [optional: ] ``` Components are essentially items, but with special properties. Currently there are the component *types*: @@ -229,7 +231,7 @@ sketchybar -m batch --set = ... = where the *name* is used to target the item with this name. An item always has the following structure in the bar (background padding currently on on HEAD):
-![](images/bar_item.png)
+ background_padding_left|-icon_padding_left-|-icon-|-icon_padding_right-|-label_padding_left-|-label-|-label_padding_right-|background_padding_right
A list of properties is listed below: @@ -364,6 +366,20 @@ This stops the redrawing of the bar entirely and "freezes" it. Can be used durin create a cleaner startup by freezing the bar at the beginning of the configuration and unfreezing it after the setup is done. +## Querying +*SketchyBar* can be queried for information about a number of things. +### Bar Information +Information about the bar can be queried via: +```bash +sketchybar -m query bar +``` +The output is a json structure containing relevant information about the configuration settings of the bar. +### Item Information +Information about an item can be queried via: +```bash +sketchybar -m query item +``` +The output is a json structure containing relevant information about the configuration of the item. ## Scripting The bar supports scripts where ever possible to make it as customizable and versatile as possible. When an item invokes a script, the script has access to some environment variables, such as: @@ -426,7 +442,12 @@ Or the individual widgets of [Stats](https://github.com/exelban/stats):
Owner: Stats Name: CPU_Mini
Owner: Stats Name: RAM_Mini
Owner: Stats Name: Network_Speed
-etc... +etc...
+ +All further Items can be found via the command: +```bash +sketchybar -m query default_menu_items +``` ## Credits yabai, spacebar,