komanda icon indicating copy to clipboard operation
komanda copied to clipboard

Store configurations as portable plain text

Open dufferzafar opened this issue 10 years ago • 1 comments

Label: Enhancement . Priority: 6/10

One of the things I love about Sublime Text is that it stores all its configurations in json files which I can open and edit easily. It also has a 'Default Settings' file which contains all the settings and their possible values. So, I don't always have to open up documentation.

Using this architecture for storing all the configuration will make things easier for everybody as we won't have to focus much on creating a Settings UI in the application itself - people can just edit a config file and be done.

The file format can be JSON or XML (or anything else.) But considering we're using Javascript, JSON makes more sense.

To store the files, I'd actually prefer the application directory itself, as it keeps things portable. Our other options will be the HOME folder on Mac/Linux and %USERPROFILE% folder on Windows.

Like Sublime we can have two types of config files - 'Default' (shipped with the app with default values for all platforms) and 'User' (which overrides any default entry)

Examples

Sessions.komanda-config

[
  {
    "name": "Freenode",
    "server": "irc.freenode.net",
    "nick": "komanda",
    "userName": "komanda",
    "realName": "The Komanda IRC Client",
    "channels": [
      "#komanda", "#node-webkit"
    ],
    "port": 6667,
    "autoRejoin": true,
    "autoConnect": false,
    "connectOnStart": true,
  },
  {
    "name": "Mozilla",
    "server": "irc.mozilla.org",
    "nick": "dufferZafar",
    "userName": "dufferZafar",
    "realName": "Shadab Zafar",
    "channels": [
      "#js"
    ],
    "port": 6697,
    "autoRejoin": true,
    "autoConnect": false,
    "connectOnStart": true,
  }
]

Default (Windows).komanda-keymap

[
  { "keys": ["ctrl+tab"], "command": "next_tab" },
  { "keys": ["ctrl+shift+tab"], "command": "prev_tab" },
  { "keys": ["shift+f11"], "command": "toggle_zen_mode" },
]

Default (OS X).komanda-keymap

[
  { "keys": ["alt+ctrl+{"], "command": "next_tab" },
  { "keys": ["alt+ctrl+}"], "command": "prev_tab" },
  { "keys": ["super+f11"], "command": "toggle_zen_mode" },
]

dufferzafar avatar Jun 17 '14 17:06 dufferzafar

+1 for this. I was just about to submit a new issue about the possibility of sharing configurations across devices, then I found this. I think this is a great idea since I really hate bothering with setting up each network on every device I have, then keeping them both in sync if I make changes. The current local storage saving mechanism for settings doesn't lend itself to being shared across devices using something like Dropbox.

jhead avatar Jul 18 '15 16:07 jhead