const__pageData=JSON.parse('{"title":"Userspace: Sharing Code Between Keymaps","description":"","frontmatter":{},"headers":[],"relativePath":"feature_userspace.md","filePath":"feature_userspace.md"}');
const_sfc_main={name:"feature_userspace.md"};
const_hoisted_1=/* @__PURE__ */createStaticVNode('<h1id="userspace-sharing-code-between-keymaps"tabindex="-1">Userspace:SharingCodeBetweenKeymaps<aclass="header-anchor"href="#userspace-sharing-code-between-keymaps"aria-label="Permalink to "Userspace: Sharing Code Between Keymaps""></a></h1><divclass="warningcustom-block"><pclass="custom-block-title">WARNING</p><p>Pleasenote,userspacesubmissionstotheupstream<code>qmk/qmk_firmware</code>repositoryarenolongerbeingaccepted.Theuserspacefeatureitselfremainsfunctionalandcanbeconfiguredlocally.</p></div><p>Ifyouusemorethanonekeyboardwithasimilarkeymap,youmightseethebenefitinbeingabletosharecodebetweenthem.Createyourownfolderin<code>users/</code>namedthesameasyourkeymap(ideallyyourGitHubusername,<code><name></code>)withthefollowingstructure:</p><ul><li><code>/users/<name>/</code>(addedtothepathautomatically)<ul><li><code>readme.md</code>(optional,recommended)</li><li><code>rules.mk</code>(includedautomatically)</li><li><code>config.h</code>(includedautomatically)</li><li><code><name>.h</code>(optional)</li><li><code><name>.c</code>(optional)</li><li><code>cool_rgb_stuff.c</code>(optional)</li><li><code>cool_rgb_stuff.h</code>(optional)</li></ul></li></ul><p>Allthisonlyhappenswhenyoubuildakeymapnamed<code><name></code>,likethis:</p><pre><code>makeplanck:<name>\n</code></pre><p>Forexample,</p><pre><code>makeplanck:jack\n</code></pre><p>Willincludethe<code>/users/jack/</code>folderinthepath,alongwith<code>/users/jack/rules.mk</code>.</p><divclass="warningcustom-block"><pclass="custom-block-title">WARNING</p><p>This<code>name</code>canbe<ahref="#override-default-userspace">overridden</a>,ifneeded.</p></div><h2id="rules-mk"tabindex="-1"><code>Rules.mk</code><aclass="header-anchor"href="#rules-mk"aria-label="Permalinkto"`Rules.mk`""></a></h2><p>The<code>rules.mk</code>isoneofthetwofilesthatgetsprocessedautomatically.Thisishowyouaddadditionalsourcefiles(suchas<code><name>.c</code>)willbeaddedwhencompiling.</p><p>It'shighlyrecommendedthatyouuse<code><name>.c</code>asthedefaultsourcefiletobeadded.Andtoaddit,youneedtoaddittheSRCin<code>rules.mk</code>likethis:</p><pre><code>SRC+=<name>.c\n</code></pre><p>Additionalfilesmaybeaddedinthesameway-it'srecommendedyouhaveonenamed<code><name></code>.c/.htostartoffwith,though.</p><p>The<code>/users/<name>/rules.mk</code>filewillbeincludedinthebuild<em>after</em>the<code>rules.mk</code>fromyourkeymap.Thisallowsyoutohavefeaturesinyouruserspace<code>rules.mk</code>thatdependonindividualQMKfeaturesthatmayormaynotbeavailableonaspecifickeyboard.</p><p>Forexample,ifyouhaveRGBcontrolfeaturessharedbetweenallyourkeyboardsthatsupportRGBlighting,youcanaddsupportforthatiftheRGBLIGHTfeatureisenabled:</p><divclass="language-makevp-adaptive-theme"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">make</span><preclass="shikishiki-themesgithub-lightgithub-darkvp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">ifeq</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">$(</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">strip</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">$(</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">RGBLIGHT_ENABLE</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">))</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,yes)</span></span>\n<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;">#Includemyfancyrgbfunctionssourcehere</span></span>\n<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E