Go to file
Robert Morrison 7711d3d6db
fix(XDG): Make XDG respect system
Allow the system variables to override the ones set here, this is
important for linux distros such as Gentoo which provide multiple
versions of some packges and their own mechanism to switch between them.
2024-02-19 17:24:04 +00:00
overrides.d HELL COMMIT 2024-02-19 17:11:31 +00:00
.gitignore HELL COMMIT 2024-02-19 17:11:31 +00:00
Bemenu_defaults.sh HELL COMMIT 2024-02-19 17:11:31 +00:00
Path.sh HELL COMMIT 2024-02-19 17:11:31 +00:00
program_config.sh HELL COMMIT 2024-02-19 17:11:31 +00:00
programs.sh HELL COMMIT 2024-02-19 17:11:31 +00:00
Readme.md fix(XDG): Make XDG respect system 2024-02-19 17:24:04 +00:00
shelly.sh fix(XDG): Make XDG respect system 2024-02-19 17:24:04 +00:00
XDG_shenanigans.sh fix(XDG): Make XDG respect system 2024-02-19 17:24:04 +00:00

Shelly

A helpful tool to make managing shell environments a little easier. With some magic defaults and an simple mechanism for overriding them.

Usage

To just use it you set the environment variable $SHELLY to the directory that shelly is and source it. It is important to realise that shelly is resposible for configuring $XDG_CONFIG_HOME so I would recommend you only use ${HOME} to reference your home directory and enter the rest of the path verbatim.

Example

export SHELLY="${HOME}/.config/shelly"
source "${SHELLY}/shelly.sh"

Configuration

The git repo for shelly is configured to ignore most of what is in overrides.d, keeping just the directory structure.

Files will be loaded in the following manner:

First it loads the default program choices, You can inspect this file to see what choices I make. To override them you can add files to overrides.d/programs All files must have the extension .sh to be detected.

After this the XDG shenanigans are performed, again inspect the file to see what it does. Overrides go in overrides.d/XDG They will be loaded before the XDG_shenanigans so that overrides can work, and system variables can be pulled in. To disable a system variable you just need to unset VARIABLE in your override file

Next is program_config, same rules.

Then Bemenu, again same rules.

Next is Path. Path is a little more fun, to make path somewhat idempotent a function called updatepath is defined. In your override files you should use this function to add to your path. The function is called like this updatepath <TOP> <PATHENTRY> where TOP should be either 1 or 0, 1 meaning add the new PATHENTRY at the front of the path. Otherwise it adds it to the bottom. The function only adds a new entry to PATH if it isn't already there, this ensures that session in sessions don't get more path entries than they need.