jcarter / environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Environment

$HOME sweet $HOME.

Tank

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

Credit to jaminthorns!

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 kitty/Windows Terminal.
  • โŒจ๏ธ Uniform keyboard setup between Windows/macOS.

Initial Setup

If running on Windows, set WSLENV to share environment variables between Windows and WSL:

WSLENV=APPDATA/up:LOCALAPPDATA/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 {{this}} will be substituted with the output of the shell command between the braces.

Available Functions

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

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

  • secret allows you to retrieve 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.

  • mac_os_key allows you to specify two keys, one to be used on macOS and the other to be used on any other OS. This is used when configuring keyboard shortcuts that should differ across operating systems.

  • windows_run allows you to run a command directly in Windows if possible. If not possible, the command will be run normally.

Syncing Configuration

Configuration syncing is specified by the config/sync.sh script. Within it, you can use the bi-directional functions copy and run:

  • copy allows 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.

  • run allows you to specify a script to run on push and a script to run on pull. The scripts 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 a file with substitutions is changed, the substituted values will be pulled in, so make sure to ignore those changes.

About


Languages

Language:Lua 73.0%Language:Shell 20.3%Language:AutoHotkey 6.7%