Menu

#493 Use XDG Base Specification for config files.

nice_to_have
open
nobody
None
1
2023-11-30
2019-06-09
J Beggs
No

Configuration files should be stored under $XDG_CONFIG_HOME (which should default to ~/.config if not defined) https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

For example:
~/.bochsrc => $XDG_CONFIG_HOME/bochs/bochsrc or $XDG_CONFIG_HOME/bochs/config.conf
$XDG_DATA_HOME/bochs for things like hard disk images and so on, per user basis, if the bochsrc file doesn't specify a fully qualified path for a file.
Using $XDG_DATA_DIRS/bochs/plugins instead of a compile-time hard-coded location. BXSHARE could override if desired for some reason, as already happens.

A few of the advantages of using the XDG Base Directory Specification as follows:

  • $HOME is a lot less cluttered.
  • Backups are a lot more safer and easier. (You know that backing up your $XDG_DATA_HOME along with your files is enough)
  • A lot easier to reset a default configuration if you want/need it (and without any risk of loosing information).
  • Avoid some strange bugs that happen because you had a old version of some configuration file.
  • It is a lot more flexible and portable because no paths are hard-coded. You can use the XDG library that does the job for you or, if you don’t want the dependency, implementing the XDG specification is only a few lines of code.

I may go ahead and add this, but I do not know how to submit patches other than on here, and it looks like they get mostly ignored and not included on svn.

Related

Feature Requests: #493

Discussion

  • Oliver

    Oliver - 2022-02-10

    I agree and think this is a good idea.

    You might address this on the mailinglist.

     
    • J Beggs

      J Beggs - 2022-02-11

      Ack, I forgot I had posted this. Was this not the mailinglist? I thought
      it was intended to be?

      On 2/10/22 09:23, Oliver wrote:

      I agree and think this is a good idea.

      You might address this on the mailinglist.


      [feature-requests:#493]
      https://sourceforge.net/p/bochs/feature-requests/493/ Use XDG Base
      Specification for config files.

      Status: open
      Group: nice_to_have
      Created: Sun Jun 09, 2019 05:22 AM UTC by J Beggs
      Last Updated: Sun Jun 09, 2019 05:22 AM UTC
      Owner: nobody

      Configuration files should be stored under $XDG_CONFIG_HOME (which
      should default to ~/.config if not defined)
      https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

      For example:
      ~/.bochsrc => $XDG_CONFIG_HOME/bochs/bochsrc or
      $XDG_CONFIG_HOME/bochs/config.conf
      $XDG_DATA_HOME/bochs for things like hard disk images and so on, per
      user basis, if the bochsrc file doesn't specify a fully qualified path
      for a file.
      Using $XDG_DATA_DIRS/bochs/plugins instead of a compile-time
      hard-coded location. BXSHARE could override if desired for some
      reason, as already happens.

      A few of the advantages of using the XDG Base Directory Specification
      as follows:
      /$HOME is a lot less cluttered.
      / Backups are a lot more safer and easier. (You know that backing up
      your $XDG_DATA_HOME along with your files is enough)
      /A lot easier to reset a default configuration if you want/need it
      (and without any risk of loosing information).
      / Avoid some strange bugs that happen because you had a old version of
      some configuration file.
      * It is a lot more flexible and portable because no paths are
      hard-coded. You can use the XDG library that does the job for you or,
      if you don’t want the dependency, implementing the XDG specification
      is only a few lines of code.

      I may go ahead and add this, but I do not know how to submit patches
      other than on here, and it looks like they get mostly ignored and not
      included on svn.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/bochs/feature-requests/493/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #493

      • Oliver

        Oliver - 2023-11-30

        Was this not the mailinglist? I thought
        it was intended to be?

        No, this is the bug report and feature request side.

        You can subscribe to the mailinglist here:
        https://sourceforge.net/projects/bochs/lists/bochs-developers

        BTW the GUI debugger also creates a file called bx_enh_dbg.ini in the ~/ home directory and thus also doesn't follow the XDG Base specification. I hope this will get fixed.

         

Log in to post a comment.

MongoDB Logo MongoDB