<p>Sorry for the delay, I've been extremely busy in the last month, should be better now.</p>
<p>The idea of <a href="https://github.com/codebrainz" class="user-mention">@codebrainz</a> should be possible - <code>/Applications/Geany.app/Contents/MacOS/geany</code> is the wrapper script that sets up environment variables so the actual Geany binary (<code>/Applications/Geany.app/Contents/MacOS/geany-bin</code>) can find GTK libraries. You always run the script, even from command line - running the binary directly wouldn't work as the GTK libraries wouldn't be found. So it should be possible to add something to the launcher script and have it executed always.</p>
<p>That said I find this manual copying-over the config file a bit scary and fragile (one has to make sure the directory exists, that we don't overwrite existing file, etc.). Also this will only work for Geany's bundle - not Geany built independently and distributed e.g. using Homebrew.</p>
<p>I would rather prefer something like <a href="https://github.com/b4n" class="user-mention">@b4n</a> suggests, i.e. adding support into Geany for loading some global platform-specific keybinding file.</p>
<p>The way it works now is that these two functions are called:</p>
<pre><code>keybindings_init();    //loads default keybindings from code
keybindings_load_keyfile();    //overrides the keybindings by the ones from the config file
</code></pre>
<p>When the custom keybinding file is saved, it saves all keybindings so the next time the above functions are run, it basically behaves as if only <code>keybindings_load_keyfile()</code> was called (unless theres a new version of Geany with new keybindings which will be added to the custom keybinding file).</p>
<p>What I would suggest (in principle) is to add one more function between these two:</p>
<pre><code>keybindings_load_global_keyfile();    //overrides the keybindings by the ones from the GLOBAL config file
</code></pre>
<p>This would mean that keybindings would still be initialized by <code>keybindings_init()</code> and only the ones which need to be overridden would be placed into the global config file. Also custom keybindings would be preserved because after this function is called <code>keybindings_load_keyfile()</code> would be called which would override it with custom keybindings. I think it's better this way to avoid surprises that keybindings have changed. Users who would like to switch to the new Mac keybindings would have to delete their custom keybindings.conf first though.</p>
<p>Should be quite easy to implement.</p>
<p>What do you think?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1324#issuecomment-266413971">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ2ygkmUM1Bm2p9tyPbvv7ps2IkNmks5rHTahgaJpZM4K9DWQ">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJxTpp6AMzM0p6AGGM5vGycqin3yvks5rHTahgaJpZM4K9DWQ.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1324#issuecomment-266413971"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@techee in #1324: Sorry for the delay, I've been extremely busy in the last month, should be better now.\r\n\r\nThe idea of @codebrainz should be possible - `/Applications/Geany.app/Contents/MacOS/geany` is the wrapper script that sets up environment variables so the actual Geany binary (`/Applications/Geany.app/Contents/MacOS/geany-bin`) can find GTK libraries. You always run the script, even from command line - running the binary directly wouldn't work as the GTK libraries wouldn't be found. So it should be possible to add something to the launcher script and have it executed always.\r\n\r\nThat said I find this manual copying-over the config file a bit scary and fragile (one has to make sure the directory exists, that we don't overwrite existing file, etc.). Also this will only work for Geany's bundle - not Geany built independently and distributed e.g. using Homebrew.\r\n\r\nI would rather prefer something like @b4n suggests, i.e. adding support into Geany for loading some global platform-specific keybinding file.\r\n\r\nThe way it works now is that these two functions are called:\r\n\r\n```\r\nkeybindings_init();    //loads default keybindings from code\r\nkeybindings_load_keyfile();    //overrides the keybindings by the ones from the config file\r\n```\r\n\r\nWhen the custom keybinding file is saved, it saves all keybindings so the next time the above functions are run, it basically behaves as if only `keybindings_load_keyfile()` was called (unless theres a new version of Geany with new keybindings which will be added to the custom keybinding file).\r\n\r\nWhat I would suggest (in principle) is to add one more function between these two:\r\n\r\n```\r\nkeybindings_load_global_keyfile();    //overrides the keybindings by the ones from the GLOBAL config file\r\n```\r\n\r\nThis would mean that keybindings would still be initialized by `keybindings_init()` and only the ones which need to be overridden would be placed into the global config file. Also custom keybindings would be preserved because after this function is called `keybindings_load_keyfile()` would be called which would override it with custom keybindings. I think it's better this way to avoid surprises that keybindings have changed. Users who would like to switch to the new Mac keybindings would have to delete their custom keybindings.conf first though.\r\n\r\nShould be quite easy to implement.\r\n\r\nWhat do you think?\r\n"}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1324#issuecomment-266413971"}}}</script>