managing .config with fuse-overlayfs
Find a file
2025-03-07 12:30:13 -06:00
configctl clean up comments 2025-03-07 12:30:13 -06:00
README.md better error handling (again) 2025-03-07 12:25:56 -06:00

configctl

a simple wrapper around fuse-overlayfs to manage multiple config changesets

Why?

i have an unhealthy relationship with overlayfs. i also like to easily change my desktop themes without a bunch of symlink swapping

Requirements

  • fuse-overlayfs
  • systemd

Usage

configctl [OPTIONS] <changeset_name> [unmount]

options
  -a, --automount      automatically enable the changeset service file
  -f, --force          ovewrite existing service file
  -s, --service-path   the path to write the service file

by default, the configctl expects the base configuration set to exist in $XDG_DATA_HOME/config/base (usually ~/.local/share/config/base) and the changesets to exist in $XDG_DATA_HOME/config/changeset. changes while the configuration is mounted will be written to $XDG_STATE_HOME/config/{<changeset>,.work_<changeset>}

configctl my_config

executing the previous command will do the following

  • search for $XDG_DATA_HOME/config/changeset/my_config
  • create the following directories if they don't already
    • $XDG_STATE_HOME/config/my_config
    • $XDG_STATE_HOME/config/.work_my_config
  • create a service file in $XDG_CONFIG_HOME/systemd/user/my_config-automount.service
  • mount the base config and the selected changeset

enabling the service file will mount the config on next user login

Notes

when unmounting or changing a configuration changeset, the target mountpoint will be lazily unmounted. there is no guarantee when the volume will be successfully unmount. that said, it should be safe enough to remount a new configuration immediately after.