[general] # if dry run is set to true # userctx will only validate config # and tell you what it will do to execute # tasks dry_run = true # "apps" array tells userctx what to do (which apps # should be actually managed) apps = [ "sway", "gtk", "helix", "foot", "wofi", "mako", ] # target directory where managed configs # are located # defaults to $XDG_CONFIG_HOME if specifically set # or ~/.config if $XGD_CONFIG_HOME is not set managed_path = "~/.config" # directory where contexts are stored # default is "~/.config/userctx" contexts_path = "~/.config/userctx" [apps] helix.symlink."*" = "themes/theme.toml" helix.code = "pkill -USR1 hx" example2.scripts = ["s1", "s2"] [apps.example] symlink."this.file" = "that.file" code = 'echo "this simulates reload command"' [apps.niri] code = "this simulates code for niri restart" [apps.niri.symlink] "another.file" = "another.link" # This section of config is intended to document # what userctx can do. Assume we are # building a config for app "example" [apps.example] # The default source path would be # ~/.config/userctx//example # it can be overriden with "contexts_path" from # section general. # Individual path for app can be provided via # "source_path". Then userctx will try to lookup # app settings in /source_path/ source_path = "~/some/path" # The default path to apply your context to is # ~/.config/example (for app name "example") # or if you provided a "managed path" in "general" section above, # then it will be /your/path/example for "exmaple" app. # Setting "target_path" overrides this. # $CONTEXT_DST env will hold the actual destination path. # symlinks will be created relative to this specified # path. target_path = "~/.config/example/configs" # "symlink" map defines # which files will be symlinked to users home # directory. If "symlinks" key is present in # "actions" above but this "symlinks" array is omitted # then userctx treats all files in the context directory as # files that must be symlinked to users home. # Names of files in these mapping are relative to # context directory and target directory # by default source is ~/.config/userctx//example for # task (app) named "example" # default target directory is ~/.config/example for # task (app) named "example" # # this will link file from context dir to destination dir # $CONTEXT_SRC/context_file.conf -> $CONTEXT_DST/symlink_to_context_file.conf symlink."context_file.conf" = "symlink_to_context_file.conf" # this will link file to subdirectory inside destination dir # directory must be created beforehand # $CONTEXT_SRC/other_file.conf -> $CONTEXT_DST/subdir/other_file.conf symlink."other_file.conf" = "subdir/other_file.conf" # also possible option symlink."subdir/yet_another_file.conf" = "yet_another_file.conf" # "code" object let's you write # a custom script that will apply contents of # your context. Note that string is a multiline string # strating and ending with three double-qoutes. # This string will be passed as is to $SHELL -c exec = """ # this is a normal shell script which will # be executed by user's $SHELL or 'bash' binary # if users $SHELL is empty # users envs are available echo "$HOME" # additional envs are available echo "$CONTEXT_SRC" echo "$CONTEXT_DST" echo "$CONTEXT_NAME" """ # scripts array will try to find # named files in $CONTEXT_SRC and # execute them with $SHELL