btop icon indicating copy to clipboard operation
btop copied to clipboard

[REQUEST/IDEA] Change the way btop treats its configuration file

Open lvxnull opened this issue 1 year ago • 3 comments

Currently, every time you open or close a window in btop, or change the way processes are sorted, the config gets overwritten. This is unlike any other command line application that I know of. This can be annoying when writing the config manually, or if btop.conf is managed by a dotfile manager like stow or chezmoi. Instead, I propose addition of an additional file(maybe called btop.state?), which would behave similarly to how the config file works now. The config would instead be used as a config file, e.g created if it doesn't exist but otherwise read only. Options would be read in this priority:

  1. btop.conf
  2. btop.state
  3. reasonable defaults

To maintain backwards compatibility, I propose addition of a new config option, config_version, which when set to 2, enables this new behavior. New configs created by btop would have config_version = 2, and configs without this value set or with config_version = 1 would keep old behavior. If backwards compatibility with the old config behavior isn't desired, config_version could instead be used to distinguish configs that require migration from the old behavior and new configs.

lvxnull avatar Oct 01 '23 19:10 lvxnull