<titledata-rh="true">Tips & Tricks | SketchyBar</title><metadata-rh="true"name="twitter:card"content="summary_large_image"><metadata-rh="true"property="og:url"content="https://felixkratz.github.io//SketchyBar/config/tricks"><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="Tips & Tricks | SketchyBar"><metadata-rh="true"name="description"content="Batching of configuration commands"><metadata-rh="true"property="og:description"content="Batching of configuration commands"><linkdata-rh="true"rel="icon"href="/SketchyBar/img/favicon.ico"><linkdata-rh="true"rel="canonical"href="https://felixkratz.github.io//SketchyBar/config/tricks"><linkdata-rh="true"rel="alternate"href="https://felixkratz.github.io//SketchyBar/config/tricks"hreflang="en"><linkdata-rh="true"rel="alternate"href="https://felixkratz.github.io//SketchyBar/config/tricks"hreflang="x-default"><linkrel="stylesheet"href="/SketchyBar/assets/css/styles.d31a9c85.css">
faster to append these calls into a single command like so:</p><divclass="codeBlockContainer_I0IT language-bash theme-code-block"><divclass="codeBlockContent_wNvx"style="color:#bfc7d5;background-color:#292d3e"><pretabindex="0"class="prism-code language-bash codeBlock_jd64 thin-scrollbar"><codeclass="codeBlockLines_mRuA"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">sketchybar --bar </span><spanclass="token assign-left variable"style="color:rgb(191, 199, 213)">position</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token plain">top </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"></span><spanclass="token assign-left variable"style="color:rgb(191, 199, 213)">margin</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token number"style="color:rgb(247, 140, 108)">5</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"> --add item demo left </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 demo </span><spanclass="token assign-left variable"style="color:rgb(191, 199, 213)">label</span><spanclass="token operator"style="color:rgb(137, 221, 255)">=</span><spanclass="token plain">Hello </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"> --subscribe demo system_woke</span><br></span></code></pre><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="copyButton_eDfN clean-btn"><spanclass="copyButtonIcons_W9eQ"aria-hidden="true"><svgclass="copyButtonIcon_XEyF"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_i9w9"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><p>The backslash at the end of the first 4 lines is the default bash way to join lines together and should not be followed by a whitespace. </p><h2class="anchor anchorWithStickyNavbar_mojV"id="debugging-problems">Debugging Problems<aclass="hash-link"href="#debugging-problems"title="Direct link to heading"></a></h2><p>If you are experiencing problems with the configuration of <em>SketchyBar</em> it might be helpful to work through the following steps:</p><ul><li>1.) Start <code>sketchybar</code> directly from the commandline to see the verbose error/warning messages</li><li>2.) Make sure you have no trailing whitespaces after the bash newline escape char <code>\</code></li><li>3.) Make sure your scripts are made executable via: <code>chmod +x script.sh</code></li><li>4.) Reduce the configuration to a minimal example and narrow down the problematic region</li><li>5.) Try running erroneous scripts directly in the commandline</li><li>6.) Query <em>SketchyBar</em> for relevant properties and use them to deduce the problems root cause</li><li>7.) Create an <ahref="https://github.com/FelixKratz/SketchyBar/issues"target="_blank"rel="noopener noreferrer">Issue</a> on GitHub, a second pair of eyes might now be the only thing that helps</li></ul><h2class="anchor anchorWithStickyNavbar_mojV"id="color-picker">Color Picker<aclass="hash-link"href="#color-picker"title="Direct link to heading"></a></h2><p>SketchyBar uses the argb hex color format, which means: <code>0xAARRGGBB</code> encodes a
color.</p><div><divstyle="padding:5px;background:#fff;-ms-border-radius:1px;-moz-border-radius:1px;-o-border-radius:1px;-webkit-border-radius:1px;border-radius:1px;-ms-box-shadow:0 0 0 1px rgba(0,0,0,.1);-moz-box-shadow:0 0 0 1px rgba(0,0,0,.1);-o-box-shadow:0 0 0 1px rgba(0,0,0,.1);-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1);display:inline-block;cursor:pointer"><divstyle="width:36px;height:14px;-ms-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background:rgba(241, 112, 19, 1)"></div></div><divid="color">Try the Picker!</div></div><h2class="anchor anchorWithStickyNavbar_mojV"id="finding-icons">Finding Icons<aclass="hash-link"href="#finding-icons"title="Direct link to heading"></a></h2><p>The default font <em>SketchyBar</em> uses is the <em>Hack Nerd Font</em> which means all <em>Nerdfont</em> icons can be used.
Refer to the <em>Nerdfont</em><ahref="https://www.nerdfonts.com/cheat-sheet"target="_blank"rel="noopener noreferrer">cheat-sheet</a> to find new icons.</p><p>Additionally, it is possible to use other icons and glyphs from different fonts,
such as the <ahref="https://developer.apple.com/sf-symbols/"target="_blank"rel="noopener noreferrer">sf-symbols</a> from apple.
Those symbols can be installed via brew:</p><divclass="codeBlockContainer_I0IT language-bash theme-code-block"><divclass="codeBlockContent_wNvx"style="color:#bfc7d5;background-color:#292d3e"><pretabindex="0"class="prism-code language-bash codeBlock_jd64 thin-scrollbar"><codeclass="codeBlockLines_mRuA"><spanclass="token-line"style="color:#bfc7d5"><spanclass="token plain">brew </span><spanclass="token function"style="color:rgb(130, 170, 255)">install</span><spanclass="token plain"> --cask sf-symbols</span><br></span></code></pre><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="copyButton_eDfN clean-btn"><spanclass="copyButtonIcons_W9eQ"aria-hidden="true"><svgclass="copyButtonIcon_XEyF"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_i9w9"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><p>After installing this package, an app called <code>SF Symbols</code> will be available where you can find all the available icons.
Once you find a fitting icon, right click it, select <em>Copy Symbol</em> and paste it in the relevant configuration file.</p><h2class="anchor anchorWithStickyNavbar_mojV"id="performance-optimizations">Performance optimizations<aclass="hash-link"href="#performance-optimizations"title="Direct link to heading"></a></h2><p><em>SketchyBar</em> can be configured to have a <em>very</em> small performance footprint. In the following I will highlight some optimizations that can be used to reduce the footprint further. </p><ul><li>Batch together configuration commands where ever possible.</li><li>Set <em>updates=when_shown</em> for items that do not need to run their script if they are not rendered.</li><li>Reduce the <em>update_freq</em> of <em>scripts</em> and <em>aliases</em> and use event-driven scripting when ever possible.</li><li>Do not add <em>aliases</em> to apps that are not always running, otherwise <em>SketchyBar</em> searches for them continuously.</li></ul></div></article><navclass="pagination-nav docusaurus-mt-lg"aria-label="Docs pages navigation"><divclass="pagination-nav__item"><aclass="pagination-nav__link"href="/SketchyBar/config/types"><divclass="pagination-nav__sublabel">Previous</div><divclass="pagination-nav__label">Type Nomenclature</div></a></div><divclass="pagination-nav__item pagination-nav__item--next"><aclass="pagination-nav__link"href="/SketchyBar/credits"><divclass="pagination-nav__sublabel">Next</div><divclass="pagination-nav__label">Credits</div></a></div></nav></div></div><divclass="col col--3"><divclass="tableOfContents_cNA8 thin-scrollbar theme-doc-toc-desktop"><ulclass="table-of-contents table-of-contents__left-border"><li><ahref="#batching-of-configuration-commands"class="table-of-contents__link toc-highlight">Batching of configuration commands</a></li><li><ahref="#debugging-problems"class="table-of-contents__link toc-highlight">Debugging Problems</a></li><li><ahref="#color-picker"class="table-of-contents__link toc-highlight">Color Picker</a></li><li><ahref="#finding-icons"class="table-of-contents__link toc-highlight">Finding Icons</a></li><li><ahref="#performance-optimizations"class="table-of-contents__link toc-highlight">Performance optimizations</a></li></ul></div></div></div></div></main></div></div></div>