<titledata-rh="true">Special Components | SketchyBar</title><metadata-rh="true"name="viewport"content="width=device-width,initial-scale=1"><metadata-rh="true"name="twitter:card"content="summary_large_image"><metadata-rh="true"property="og:url"content="https://felixkratz.github.io/SketchyBar/config/components"><metadata-rh="true"name="docusaurus_locale"content="en"><metadata-rh="true"name="docsearch:language"content="en"><metadata-rh="true"name="docusaurus_version"content="current"><metadata-rh="true"name="docusaurus_tag"content="docs-default-current"><metadata-rh="true"name="docsearch:version"content="current"><metadata-rh="true"name="docsearch:docusaurus_tag"content="docs-default-current"><metadata-rh="true"property="og:title"content="Special Components | SketchyBar"><metadata-rh="true"name="description"content="Components -- Special Items with special properties"><metadata-rh="true"property="og:description"content="Components -- Special Items with special properties"><linkdata-rh="true"rel="icon"href="/SketchyBar/img/favicon.ico"><linkdata-rh="true"rel="canonical"href="https://felixkratz.github.io/SketchyBar/config/components"><linkdata-rh="true"rel="alternate"href="https://felixkratz.github.io/SketchyBar/config/components"hreflang="en"><linkdata-rh="true"rel="alternate"href="https://felixkratz.github.io/SketchyBar/config/components"hreflang="x-default"><linkrel="stylesheet"href="/SketchyBar/assets/css/styles.21661fb5.css">
Currently there are the components (more details in the corresponding sections below):</p><ul><li><em>graph</em>: showing a graph,</li><li><em>space</em>: representing a mission control space</li><li><em>bracket</em>: brackets together other items</li><li><em>alias</em>: an alias of a menu bar item from the macOS bar</li><li><em>slider</em>: a slider that shows a progression and can be clicked/dragged to set a new value</li></ul><h3class="anchor anchorWithStickyNavbar_LWe7"id="data-graph----draws-an-arbitrary-graph-into-the-bar">Data Graph -- Draws an arbitrary graph into the bar<aclass="hash-link"href="#data-graph----draws-an-arbitrary-graph-into-the-bar"title="Direct link to heading"></a></h3><divclass="language-bash codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">sketchybar --add graph </span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">name</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><spanclass="token plain"></span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">position</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><spanclass="token plain"></span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">width </span><spanclass="token keyword"style="font-style:italic">in</span><spanclass="token plain"> points</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Additional graph properties:</p><table><thead><tr><thalign="center"><property<!---->></th><thalign="center"><value<!---->></th><thalign="center">default</th><th>description</th></tr></thead><tbody><tr><tdalign="center"><code>graph.color</code></td><tdalign="center"><code><argb_hex></code></td><tdalign="center"><code>0xcccccc</code></td><td>Color of the graph line</td></tr><tr><tdalign="center"><code>graph.fill_color</code></td><tdalign="center"><code><argb_hex></code></td><tdalign="center"><code>0xcccccc</code></td><td>Fill color of the graph</td></tr><tr><tdalign="center"><code>graph.line_width</code></td><tdalign="center"><code><float></code></td><tdalign="center"><code>0.5</code></td><td>Width of the line in points</td></tr></tbody></table><p>Push data points into the graph via:</p><divclass="language-bash codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">sketchybar --push </span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">name</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><spanclass="token plain"></span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">data point</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><spanclass="token plain"></span><spanclass="token punctuation"style="col
item will draw on the screen on which the space is currently located. </li></ul><p>The space component has additional variables available in <em>scripts</em>:</p><divclass="language-bash codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token variable"style="color:rgb(191, 199, 213)">$SELECTED</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain"></span><spanclass="token variable"style="color:rgb(191, 199, 213)">$SID</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain"></span><spanclass="token variable"style="color:rgb(191, 199, 213)">$DID</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>where <code>$SELECTED</code> has the value <code>true</code> if the associated space is selected and
<code>$SID</code> holds the space id and <code>$DID</code> the display id.</p><p>By default the space component invokes the following script:</p><divclass="language-bash codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">sketchybar --set </span><spanclass="token variable"style="color:rgb(191, 199, 213)">$NAME</span><spanclass="token plain"> icon.highlight</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token variable"style="color:rgb(191, 199, 213)">$SELECTED</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>which you can freely configure to your liking by supplying a different script
to the space component:</p><divclass="language-bash codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">sketchybar --set </span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">name</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><spanclass="token plain"></span><spanclass="token assign-left variable"style="color:rgb(191, 199, 213)">script</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">script/path</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>For performance reasons the space script is only run on a change in the
or has resigned being active.</p><h3class="anchor anchorWithStickyNavbar_LWe7"id="item-bracket----group-items-in-eg-colored-sections">Item Bracket -- Group Items in e.g. colored sections<aclass="hash-link"href="#item-bracket----group-items-in-eg-colored-sections"title="Direct link to heading"></a></h3><p>It is possible to create a common background for any number of items, i.e. to bracket together items, via the command:</p><divclass="language-bash codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">sketchybar --add bracket </span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">name</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><spanclass="token plain"></span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">member name</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><spanclass="token plain"></span><spanclass="token punctuation"style="color:rgb(199, 146, 234)">..</span><spanclass="token plain">. </span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">member name</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>The <code><member name></code> is a name of any item in the bar that should be added to the bracket.
E.g., if I wanted a colored background around my space components (which are named <em>space.1</em>, <em>space.2</em>, <em>space.3</em>) I would set it up like this:</p><divclass="language-bash codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">sketchybar --add bracket spaces space.1 space.2 space.3 </span><spanclass="token punctuation"style="color:rgb(199, 146, 234)">\</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> --set spaces background.color</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token plain">0xffffffff </span><spanclass="token punctuation"style="color:rgb(199, 146, 234)">\</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> background.corner_radius</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token number"style="color:rgb(247, 140, 108)">4</span><spanclass="token plain"></span><spanclass="token punctuation"style="color:rgb(199, 146, 234)">\</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> background.height</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token number"style="color:rgb(247, 140, 108)">20</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Alternatively, if I had a number of spaces, called <em>space.1</em>, <em>space.2</em>, etc. the regex syntax comes in handy:</p><divclass="language-bash codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">sketchybar --add bracket spaces </span><spanclass="token string"style="color:rgb(195, 232, 141)">'/space\..*/'</span><spanclass="token plain"></span><spanclass="token punctuation"style="color:rgb(199, 146, 234)">\</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> --set spaces background.color</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token plain">0xffffffff </span><spanclass="token punctuation"style="color:rgb(199, 146, 234)">\</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> background.corner_radius</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token number"style="color:rgb(247, 140, 108)">4</span><spanclass="token plain"></span><spanclass="token punctuation"style="color:rgb(199, 146, 234)">\</span><spanclass="token plain"></span><br></span><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain"> background.height</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><sp
the background will span all the way between those items.</p><h3class="anchor anchorWithStickyNavbar_LWe7"id="item-alias----mirror-items-of-the-original-macos-status-bar-into-sketchybar">Item Alias -- Mirror items of the original macOS status bar into sketchybar<aclass="hash-link"href="#item-alias----mirror-items-of-the-original-macos-status-bar-into-sketchybar"title="Direct link to heading"></a></h3><p>It is possible to create an alias for default menu bar items
autohide and this should still work.</p><p>To create an alias of a default menu bar item use the following syntax:</p><divclass="language-bash codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">sketchybar --add </span><spanclass="token builtin class-name"style="color:rgb(255, 203, 107)">alias</span><spanclass="token plain"></span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">application_name</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><spanclass="token plain"></span><spanclass="token operator"style="color:rgb(137, 221, 255)"><</span><spanclass="token plain">position</span><spanclass="token operator"style="color:rgb(137, 221, 255)">></span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgclass="copyButtonIcon_y97N"viewBox="0 0 24 24"><pathd="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgclass="copyButtonSuccessIcon_LjdS"viewBox="0 0 24 24"><pathd="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>this operation requires <em>screen capture permissions</em>, which should be granted
e.g.:</p><ul><li>"Control Center,Bluetooth"</li><li>"Control Center,WiFi"</li><li>...</li></ul><p>Or the individual widgets of <ahref="https://github.com/exelban/stats"target="_blank"rel="noopener noreferrer">Stats</a>:</p><ul><li>"Stats,CPU_Mini"</li><li>etc...</li></ul><p>All further macOS menu bar items currently available on your system can be
properties:</p><table><thead><tr><thalign="center"><property<!---->></th><thalign="center"><value<!---->></th><thalign="center">default</th><th>description</th></tr></thead><tbody><tr><tdalign="center"><code>slider.width</code></td><tdalign="center"><code><positive_integer></code></td><tdalign="center"><code>100</code></td><td>Total width of the slider in points</td></tr><tr><tdalign="center"><code>slider.percentage</code></td><tdalign="center"><code><positive_integer></code></td><tdalign="center"><code>0</code></td><td>Progression of the slider in percent (0-100)</td></tr><tr><tdalign="center"><code>slider.highlight_color</code></td><tdalign="center"><code><argb_hex></code></td><tdalign="center"><code>0xff0000ff</code></td><td>Color that highlights the progression of the slider</td></tr><tr><tdalign="center"><code>slider.knob</code></td><tdalign="center"><code><string></code></td><tdalign="center"></td><td>Knob of the slider</td></tr><tr><tdalign="center"><code>slider.knob.<text_property></code></td><tdalign="center"></td><tdalign="center"></td><td>The slider knob supports all <code>text</code> properties</td></tr><tr><tdalign="center"><code>slider.background.<background_property></code></td><tdalign="center"></td><tdalign="center"></td><td>The slider supports all <code>background</code> properties</td></tr></tbody></table><p>The slider can be enabled to receive <code>mouse.clicked</code> events by subscribing to this event.
A slider will receive the additional environment variable <code>$PERCENTAGE</code> on a click in its
script, which represents the percentage corresponding to the click location.
If a slider is dragged by the mouse it will only send a single event on drag release and
track the mouse during the drag.</p></div></article><navclass="pagination-nav docusaurus-mt-lg"aria-label="Docs pages navigation"><aclass="pagination-nav__link pagination-nav__link--prev"href="/SketchyBar/config/items"><divclass="pagination-nav__sublabel">Previous</div><divclass="pagination-nav__label">Item Properties</div></a><aclass="pagination-nav__link pagination-nav__link--next"href="/SketchyBar/config/popups"><divclass="pagination-nav__sublabel">Next</div><divclass="pagination-nav__label">Popup Menus</div></a></nav></div></div><divclass="col col--3"><divclass="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ulclass="table-of-contents table-of-contents__left-border"><li><ahref="#components----special-items-with-special-properties"class="table-of-contents__link toc-highlight">Components -- Special Items with special properties</a><ul><li><ahref="#data-graph----draws-an-arbitrary-graph-into-the-bar"class="table-of-contents__link toc-highlight">Data Graph -- Draws an arbitrary graph into the bar</a></li><li><ahref="#space----associate-mission-control-spaces-with-an-item"class="table-of-contents__link toc-highlight">Space -- Associate mission control spaces with an item</a></li><li><ahref="#item-bracket----group-items-in-eg-colored-sections"class="table-of-contents__link toc-highlight">Item Bracket -- Group Items in e.g. colored sections</a></li><li><ahref="#item-alias----mirror-items-of-the-original-macos-status-bar-into-sketchybar"class="table-of-contents__link toc-highlight">Item Alias -- Mirror items of the original macOS status bar into sketchybar</a></li><li><ahref="#slider----a-draggable-progression-indicator"class="table-of-contents__link toc-highlight">Slider -- A draggable progression indicator</a></li></ul></li></ul></div></div></div></div></main></div></div></div>