$HOMEsweet$HOME.
My configuration files and initialization scripts for Windows/macOS/Linux.
- ๐งโโ๏ธ Consistent colors with Dracula.
- ๐ Fully-equipped text editing with VS Code.
- ๐บ Cross-platform packages with Homebrew.
- ๐ Version-controlled development tools with
asdf. - ๐ Friendly shell with
fish. - ๐ฅ Modern terminal with WezTerm.
- โจ๏ธ Uniform keyboard setup between Windows/macOS.
If running on Windows, set WSLENV to share environment variables between
Windows and
WSL:
WSLENV=USERPROFILE/up:APPDATA/up:ProgramFiles/up
Run the init.sh script:
./init.shPrograms (apt/brew packages, asdf tools, and fisher plugins) can be
updated with the update.sh script:
./update.shConfiguration files are located in the config folder. They're split up into
folders for each program they're related to.
When copying configuration files to their destinations, any section that looks
like {{command}} will be substituted with the output of executing command.
Within substitutions and scripts, you can use the following functions:
-
os_statusqueries properties about the current operating system. This can be used to implement conditional configuration per-OS. -
read_configprints the content of a config file with substitutions evaluated. -
merge_configmerges the content of a config file with a destination file. -
read_localprints the content of a config file under thelocalfolder. This can be used to extend files with local configuration. When callingread_localfor a file that doesn't exist, an empty file will be created. -
secretretrieves the value of a named "secret" (a value that is needed in a configuration file but should not be stored within this repository for security or privacy reasons). When callingsecretfor a value that has not yet been stored, you will be prompted to enter a value. -
command_keyprints the OS-appropriate command key. The uniform keyboard setup is meant to act like macOS, so command key behavior is emulated in other environments. -
windows_runruns a command directly in Windows.
Configuration synchronization is specified by the config/sync.sh script.
Within it, you can use the bi-directional copy function along with the
on_push and on_pull functions:
-
copyrequires you to specify a config folder and a destination folder. Onpush, files will be copied from the config folder to the destination folder. Onpull, files will be copied from the destination folder to the config folder. -
on_pushrequires you to specify a script to run onpush. -
on_pullrequires you to specify a script to run onpull.
The scripts for on_push and on_pull will be run from their containing
folder.
If configuration is changed inside the repository, run the push.sh script:
./push.shThis will copy files from config into the system and run scripts according to
config/sync.sh.
If configuration is changed outside the repository, run the pull.sh script:
./pull.shThis will copy files into config from the system and run scripts according to
config/sync.sh. If lines near a substitution are changed, running pull.sh
could result in conflicts. Make sure to resolve these before committing.
