<titledata-rh="true">Tips & Tricks | 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/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.21661fb5.css">
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_LWe7"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="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">brew </span><spanclass="token function"style="color:rgb(130, 170, 255)">install</span><spanclass="token plain"> --cask sf-symbols</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>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><p>If you are looking for stylised app icons you might want to checkout the excellent community maintained
<ahref="https://github.com/kvndrsslr/sketchybar-app-font"target="_blank"rel="noopener noreferrer">app-icon-font</a> for SketchyBar.</p><h2class="anchor anchorWithStickyNavbar_LWe7"id="multiple-bars">Multiple Bars<aclass="hash-link"href="#multiple-bars"title="Direct link to heading"></a></h2><p>It is possible to have multiple independent instances of SketchyBar running.
This is possible by changing the <code>argv[0]</code> of the sketchybar program. This is
very easy, e.g. by symlinking the sketchybar binary with a different name, e.g.
<code>bottom_bar</code>:</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 function"style="color:rgb(130, 170, 255)">ln</span><spanclass="token plain"> -s </span><spanclass="token variable"style="color:rgb(191, 199, 213)">$(</span><spanclass="token variable function"style="color:rgb(130, 170, 255)">which</span><spanclass="token variable"style="color:rgb(191, 199, 213)"> sketchybar</span><spanclass="token variable"style="color:rgb(191, 199, 213)">)</span><spanclass="token plain"></span><spanclass="token variable"style="color:rgb(191, 199, 213)">$(</span><spanclass="token variable function"style="color:rgb(130, 170, 255)">dirname</span><spanclass="token variable"style="color:rgb(191, 199, 213)"></span><spanclass="token variable punctuation"style="color:rgb(199, 146, 234)">$(</span><spanclass="token variable"style="color:rgb(191, 199, 213)">which sketchybar</span><spanclass="token variable punctuation"style="color:rgb(199, 146, 234)">)</span><spanclass="token variable"style="color:rgb(191, 199, 213)">)</span><spanclass="token plain">/bottom_bar</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 symlink can now be used to spawn and target an additional bar, i.e. for
this bar we do not call <code>sketchybar --bar color=0xffff0000</code>, but rather
<code>bottom_bar --bar color=0xffff0000</code> and start it by running <code>bottom_bar</code> in the
commandline.</p><p>The config path for this additional bar is in <code>$HOME/.config/bottom_bar/</code>.
Of course <code>bottom_bar</code> is only an example and can be freely replaced with any
other identifier.</p><h2class="anchor anchorWithStickyNavbar_LWe7"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><li>(Advanced; Only >=v2.9.0) Use compiled <code>mach_helper</code> programs that directly interface with <em>SketchyBar</em><ahref="https://github.com/FelixKratz/SketchyBarHelper"target="_blank"rel="noopener noreferrer">example</a> for performance sensitive tasks</li></ul></div></article><navclass="pagination-nav docusaurus-mt-lg"aria-label="Docs pages navigation"><aclass="pagination-nav__link pagination-nav__link--prev"href="/SketchyBar/config/reloading"><divclass="pagination-nav__sublabel">Previous</div><divclass="pagination-nav__label">Reloading the configuration</div></a><aclass="pagination-nav__link pagination-nav__link--next"href="/SketchyBar/credits"><divclass="pagination-nav__sublabel">Next</div><divclass="pagination-nav__label">Credits</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="#batching-of-configuration-commands"class="table-of-contents__link toc-highlight">Batching of configuration commands</a><ul><li><ahref="#using-bash-arrays-for-cleaner-configuration"class="table-of-contents__link toc-highlight">Using bash arrays for cleaner configuration</a></li></ul></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="#multiple-bars"class="table-of-contents__link toc-highlight">Multiple Bars</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>