Skip to content

Configuration Files and Initialization Scripts ๐Ÿ› 

Notifications You must be signed in to change notification settings

jaminthorns/environment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Environment

$HOME sweet $HOME.

Tank

My configuration files and initialization scripts for Windows/macOS/Linux.

Features

  • ๐Ÿง›โ€โ™‚๏ธ 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.

Initial Setup

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.sh

Updating Programs

Programs (apt/brew packages, asdf tools, and fisher plugins) can be updated with the update.sh script:

./update.sh

Configuration Files

Configuration files are located in the config folder. They're split up into folders for each program they're related to.

Substitution

When copying configuration files to their destinations, any section that looks like {{command}} will be substituted with the output of executing command.

Available Functions

Within substitutions and scripts, you can use the following functions:

  • os_status queries properties about the current operating system. This can be used to implement conditional configuration per-OS.

  • read_local prints the content of a file under the local folder. This can be used to extend files with local configuration. When calling read_local for a file that doesn't exist, an empty file will be created.

  • secret retrieves 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 calling secret for a value that has not yet been stored, you will be prompted to enter a value.

  • command_key prints 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_run runs a command directly in Windows.

Syncing Configuration

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:

  • copy requires you to specify a config folder and a destination folder. On push, files will be copied from the config folder to the destination folder. On pull, files will be copied from the destination folder to the config folder.

  • on_push requires you to specify a script to run on push.

  • on_pull requires you to specify a script to run on pull.

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.sh

This 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.sh

This 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.

About

Configuration Files and Initialization Scripts ๐Ÿ› 

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published