Updated file structure and updated XDG variables
This commit is contained in:
parent
78b27bd6cf
commit
5e16d6c224
55 changed files with 336 additions and 1247 deletions
|
@ -50,8 +50,8 @@ tasks:
|
||||||
cmds:
|
cmds:
|
||||||
- .config/log info "PATH variable --> $PATH"
|
- .config/log info "PATH variable --> $PATH"
|
||||||
- task: :install:go:bin
|
- task: :install:go:bin
|
||||||
- mkdir -p "$HOME/.config/bin"
|
- mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/bin"
|
||||||
- jq '. | .default_path = "./.bin" | .bins = {}' <<< $(echo '{}') > "$HOME/.config/bin/config.json"
|
- jq '. | .default_path = "./.bin" | .bins = {}' <<< $(echo '{}') > "${XDG_CONFIG_HOME:-$HOME/.config}/bin/config.json"
|
||||||
- |
|
- |
|
||||||
if [ -n "$CI" ]; then echo "*************** GitHub --> {{.BIN}}"; fi
|
if [ -n "$CI" ]; then echo "*************** GitHub --> {{.BIN}}"; fi
|
||||||
- |
|
- |
|
||||||
|
|
|
@ -338,15 +338,15 @@ tasks:
|
||||||
start: Installing the "Development Tools" group
|
start: Installing the "Development Tools" group
|
||||||
success: Successfully installed the "Development Tools" group
|
success: Successfully installed the "Development Tools" group
|
||||||
cmds:
|
cmds:
|
||||||
- mkdir -p "$HOME/.config/bodega"
|
- mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/bodega"
|
||||||
- |
|
- |
|
||||||
if [ ! -f "$HOME/.config/bodega/yum-devtools-check-ran" ]; then
|
if [ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}HOME:-$HOME/.config}/bodega/yum-devtools-check-ran" ]; then
|
||||||
if type dnf &> /dev/null; then
|
if type dnf &> /dev/null; then
|
||||||
dnf groupinfo 'Development Tools' &> "$HOME/.config/bodega/dnf-devtools-check-ran"
|
dnf groupinfo 'Development Tools' &> "${XDG_CONFIG_HOME:-$HOME/.config}/bodega/dnf-devtools-check-ran"
|
||||||
else
|
else
|
||||||
yum grouplist 'Development Tools' &> "$HOME/.config/bodega/yum-devtools-check-ran"
|
yum grouplist 'Development Tools' &> "${XDG_CONFIG_HOME:-$HOME/.config}/bodega/yum-devtools-check-ran"
|
||||||
fi
|
fi
|
||||||
DEV_TOOLS_NOT_INSTALLED="$(grep 'No groups match' < "$HOME/.config/bodega/yum-devtools-check-ran" > /dev/null)"
|
DEV_TOOLS_NOT_INSTALLED="$(grep 'No groups match' < "${XDG_CONFIG_HOME:-$HOME/.config}/bodega/yum-devtools-check-ran" > /dev/null)"
|
||||||
if [[ "$DEV_TOOLS_NOT_INSTALLED" == '0' ]]; then
|
if [[ "$DEV_TOOLS_NOT_INSTALLED" == '0' ]]; then
|
||||||
if type sudo &> /dev/null; then
|
if type sudo &> /dev/null; then
|
||||||
if type dnf &> /dev/null; then
|
if type dnf &> /dev/null; then
|
||||||
|
@ -362,7 +362,7 @@ tasks:
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
touch "$HOME/.config/bodega/yum-devtools-check-ran"
|
touch "${XDG_CONFIG_HOME:-$HOME/.config}/bodega/yum-devtools-check-ran"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
common:linux:redhat:fedora:
|
common:linux:redhat:fedora:
|
||||||
|
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -100,5 +100,6 @@
|
||||||
"workbench.startupEditor": "readme",
|
"workbench.startupEditor": "readme",
|
||||||
"workbench.welcomePage.walkthroughs.openOnInstall": false,
|
"workbench.welcomePage.walkthroughs.openOnInstall": false,
|
||||||
"yaml.format.printWidth": 160,
|
"yaml.format.printWidth": 160,
|
||||||
"yaml.format.singleQuote": true
|
"yaml.format.singleQuote": true,
|
||||||
|
"editor.acceptSuggestionOnEnter": "off"
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
|
|
||||||
Want to try out a new desktop jam-packed with a whole suite of GitHub's most-starred projects? Install Doctor is a combination of application settings, theme files, and a performant yet flexible software installer written with [ZX](https://github.com/google/zx). It is easily customizable, with optional prompts that ask you for API keys if you want to completely automate everything. The installer supports almost any operating system, just checkout the [software.yml file](https://gitlab.com/megabyte-labs/install.doctor/-/blob/master/software.yml). It uses [Chezmoi](https://github.com/twpayne/chezmoi) to apply file changes in an interactive way. It is not your typical Chezmoi project - it is built around the philosophy that you should be able to bash all your computers to bits with a hammer and then resurrect them the next day ✝️️ by storing stateful data to an encrypted S3 bucket and automating desktop configuration as much as possible.
|
Want to try out a new desktop jam-packed with a whole suite of GitHub's most-starred projects? Install Doctor is a combination of application settings, theme files, and a performant yet flexible software installer written with [ZX](https://github.com/google/zx). It is easily customizable, with optional prompts that ask you for API keys if you want to completely automate everything. The installer supports almost any operating system, just checkout the [software.yml file](https://gitlab.com/megabyte-labs/install.doctor/-/blob/master/software.yml). It uses [Chezmoi](https://github.com/twpayne/chezmoi) to apply file changes in an interactive way. It is not your typical Chezmoi project - it is built around the philosophy that you should be able to bash all your computers to bits with a hammer and then resurrect them the next day ✝️️ by storing stateful data to an encrypted S3 bucket and automating desktop configuration as much as possible.
|
||||||
|
|
||||||
Sexy Start is a cross-platform development environment provisioning system. The project began as an ongoing Ansible project named [Gas Station](https://github.com/megabyte-labs/gas-station) but transitioned to a dotfile-ish approach for easier adoption and less overhead. It is intended for:
|
Install Doctor is a cross-platform development environment provisioning system. The project began as an ongoing Ansible project named [Gas Station](https://github.com/megabyte-labs/gas-station) but transitioned to a dotfile-ish approach for easier adoption and less overhead. It is intended for:
|
||||||
|
|
||||||
1. Power users that want to maximize their long-term efficiency by incorporating the [most-starred applications / projects / CLIs on GitHub](https://stars.megabyte.space) into their stack.
|
1. Power users that want to maximize their long-term efficiency by incorporating the [most-starred applications / projects / CLIs on GitHub](https://stars.megabyte.space) into their stack.
|
||||||
2. Users that distro hop but want to retain their favorite tools regardless of whether they are using macOS, Windows, or Linux
|
2. Users that distro hop but want to retain their favorite tools regardless of whether they are using macOS, Windows, or Linux
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Environment Variable Configuration
|
|
||||||
|
|
||||||
Install Doctor can provision most of the system without additional input. However, you can take advantage of more features if you pass in variables with API keys which are used to leverage free cloud services.
|
|
||||||
|
|
||||||
For more details on how you can customize your deployment, check out the [Customization](https://install.doctor/customization) and the [Integrating Secrets](https://install.doctor/customization/secrets) documentation.
|
|
|
@ -1,35 +0,0 @@
|
||||||
```
|
|
||||||
🍺 /usr/local/Cellar/sftpgo/2.5.3: 174 files, 50.3MB
|
|
||||||
==> Running `brew cleanup sftpgo`...
|
|
||||||
Removing: /usr/local/Cellar/sftpgo/2.5.2... (174 files, 50.2MB)
|
|
||||||
==> Upgrading angular-cli
|
|
||||||
16.1.1 -> 16.1.4
|
|
||||||
|
|
||||||
==> Pouring angular-cli--16.1.4.ventura.bottle.tar.gz
|
|
||||||
🍺 /usr/local/Cellar/angular-cli/16.1.4: 6,965 files, 31.2MB
|
|
||||||
==> Running `brew cleanup angular-cli`...
|
|
||||||
Removing: /usr/local/Cellar/angular-cli/16.1.1... (6,970 files, 31.2MB)
|
|
||||||
==> Upgrading docker-compose
|
|
||||||
2.19.0 -> 2.19.1
|
|
||||||
|
|
||||||
==> Pouring docker-compose--2.19.1.ventura.bottle.tar.gz
|
|
||||||
Error: The `brew link` step did not complete successfully
|
|
||||||
The formula built, but is not symlinked into /usr/local
|
|
||||||
Could not symlink bin/docker-compose
|
|
||||||
Target /usr/local/bin/docker-compose
|
|
||||||
already exists. You may want to remove it:
|
|
||||||
rm '/usr/local/bin/docker-compose'
|
|
||||||
|
|
||||||
To force the link and overwrite all conflicting files:
|
|
||||||
brew link --overwrite docker-compose
|
|
||||||
|
|
||||||
To list all files that would be deleted:
|
|
||||||
brew link --overwrite --dry-run docker-compose
|
|
||||||
|
|
||||||
Possible conflicting files are:
|
|
||||||
/usr/local/bin/docker-compose -> /Applications/Docker.app/Contents/Resources/bin/docker-compose
|
|
||||||
==> Caveats
|
|
||||||
Compose is now a Docker plugin. For Docker to find this plugin, symlink it:
|
|
||||||
mkdir -p ~/.docker/cli-plugins
|
|
||||||
ln -sfn /usr/local/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
|
|
||||||
```
|
|
|
@ -1,16 +0,0 @@
|
||||||
## Post-Installation
|
|
||||||
|
|
||||||
The script has finished provisioning. Enjoy! You can review the installation logs which are stored at `~/.local/share/install.doctor.$(date +%s).log`. If you come across any issues, have some good ideas, or want to get involved, feel free to open an issue on [GitHub](https://github.com/megabyte-labs/install.doctor) or check out our [Community](https://install.doctor/community). Pull requests / stars are welcome too.
|
|
||||||
|
|
||||||
### Next Steps
|
|
||||||
|
|
||||||
1. Fork the project so you can add your own customizations (using the method described at the top of the README.md)
|
|
||||||
2. Review the [README.md](https://github.com/megabyte-labs/install.doctor) for a high-level overview
|
|
||||||
3. Utilize the [Install Doctor documentation](https://install.doctor/docs) for more thorough details
|
|
||||||
4. Check out the [Chezmoi documentation](https://www.chezmoi.io/) (since this project utilizes it heavily)
|
|
||||||
5. Open a pull request with your own improvements if you want to contribute
|
|
||||||
6. Visit [Megabyte Labs](https://megabyte.space) to see what else we are up to
|
|
||||||
|
|
||||||
**bZ out**
|
|
||||||
|
|
||||||
_Note: Some of the settings / applications might require a reboot (or at the very least, a terminal reload)._
|
|
|
@ -1,81 +0,0 @@
|
||||||
Sexy Start is a cross-platform development environment provisioning system. The project began as an ongoing Ansible project named [Gas Station](https://github.com/megabyte-labs/gas-station) but transitioned to a dotfile-ish approach for easier adoption and less overhead. It is intended for:
|
|
||||||
|
|
||||||
1. Power users that want to maximize their long-term efficiency by incorporating the [most-starred applications / projects / CLIs on GitHub](https://stars.megabyte.space) into their stack.
|
|
||||||
2. Users that distro hop but want to retain their favorite tools regardless of whether they are using macOS, Windows, or Linux
|
|
||||||
3. People that want to reformat their computers on a, perhaps, daily basis while retaining stateful elements of their file system by leveraging S3 buckets
|
|
||||||
4. Enthusiasts that want to deploy as many cool, useful tools as possible without having to spend much time configuring their file system
|
|
||||||
5. Perfectionists that love software that behaives as it should, looks gorgeous (desktop preview screenshots below), and performs tasks quickly on any platform
|
|
||||||
6. CLI ninjas that want to bring their set of tools wherever they go
|
|
||||||
|
|
||||||
## Quick Start
|
|
||||||
|
|
||||||
To provision your workstation, you can run the following which will install some basic dependencies (e.g. Chezmoi) and provide interactive prompts where you can personalize your configuration:
|
|
||||||
|
|
||||||
```
|
|
||||||
bash <(curl -sSL https://install.doctor/start)
|
|
||||||
```
|
|
||||||
|
|
||||||
If you fork this repository and would like to use your fork as the source, you can still use the command shown above by setting the `START_REPO` environment variable. If it is located on GitHub, you can do this by running:
|
|
||||||
|
|
||||||
```
|
|
||||||
START_REPO=my-gh-user/my-fork-name bash <(curl -sSL https://install.doctor/start)
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, if you want to host your project on GitLab or another git provider, then just specify the git remote's URL:
|
|
||||||
|
|
||||||
```
|
|
||||||
START_REPO=git@gitlab.com:megabyte-labs/install.doctor.git bash <(curl -sSL https://install.doctor/start)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Quick Start Notes
|
|
||||||
|
|
||||||
- The quick start script is tested on the latest versions of Archlinux, CentOS, Debian, Fedora, macOS, and Ubuntu
|
|
||||||
- The quick start script is the preferred method of using this project to provision your system
|
|
||||||
- The script can be configured to be completely headless by specifying environment variables which are detailed below
|
|
||||||
- _Windows support is on the roadmap._
|
|
||||||
|
|
||||||
## Chezmoi-Based
|
|
||||||
|
|
||||||
This project leverages [Chezmoi](https://github.com/twpayne/chezmoi) to provide:
|
|
||||||
|
|
||||||
1. File diffs that show how files are being changed
|
|
||||||
2. Easy-to-use encryption that lets you store private data publicly on GitHub
|
|
||||||
3. A basic set of prompts that accept and integrate API credentials for services like CloudFlare, GitHub, GitLab, and Slack so that your development environment is augmented by free cloud services
|
|
||||||
|
|
||||||
## Security Focused
|
|
||||||
|
|
||||||
This software was built in an adversarial environment. This led towards a focus on security which is why we employ technologies like [Firejail](https://github.com/netblue30/firejail), [Portmaster](https://safing.io/), [Little Snitch](https://www.obdev.at/products/littlesnitch/index.html), and [Qubes](https://www.qubes-os.org/). Whenever possible, Flatpaks are used as the preferred application type. This also led to an emphasis on performance. When your workstation is possibly compromised or you have a good habit of reformatting your workstation on regular basis then it makes sense to use a provisioning system that can restore the workstation to a similar state quicker.
|
|
||||||
|
|
||||||
## Cross-Platform
|
|
||||||
|
|
||||||
This project has been developed with support for Archlinux, CentOS, Fedora, macOS, Ubuntu, and Windows. Almost all the testing has been done on x86_64 systems but the system is flexible enough to be adapted for other systems such as ARM or FreeBSD. A lot of effort has also gone into supporting Qubes which, when fully provisioned, is basically a combination of all the operating systems we have developed this project for.
|
|
||||||
|
|
||||||
### Custom Software Provisioning System
|
|
||||||
|
|
||||||
The project also incorporates a custom [ZX](https://github.com/google/zx) script that allows you to choose which package managers you would like to manage your software. It attempts to be as asynchronous as possible without opening the door to errors. The script leverages the [software.yml](/software.yml) file in the root of this repository to figure out which package manager to use. By default, the installer will choose the most secure option (e.g. Flatpaks are preferred for Linux applications). The installer is more performant and less error-prone than our Ansible variant. It also makes it a lot easier to add software to your stack in such a way that you can keep the software regardless of what operating system you are using by storing everything in the aforementioned `software.yml` file.
|
|
||||||
|
|
||||||
### Beautiful Anywhere
|
|
||||||
|
|
||||||
Windows and macOS do a great job of making things look good from a UI perspective out of the box. Linux on the other hand requires some finessing especially when you follow our philosophy of taking many different operating systems and deploying similar software on them. A sizable amount of effort went into customizing the popular [Sweet](https://github.com/EliverLara/Sweet) theme and adapting it to our liking. Bells and whistles like a customized GRUB2 and Plymouth theme are included.
|
|
||||||
|
|
||||||
### Qubes Support
|
|
||||||
|
|
||||||
Qubes support is on its way.
|
|
||||||
|
|
||||||
## Gas Station
|
|
||||||
|
|
||||||
This project began as something to supplement our provisioning system that uses Ansible. The system is called [Gas Station](https://gitlab.com/megabyte-labs/gas-station). It includes hundreds of Ansible roles. If you look at the [`software.yml`](/software.yml) file, you will notice that some of the Ansible roles that Gas Station provides are inside of it. By default, this project will try to install software / dependencies using other, lighter methods before resorting to using Ansible. This is because of the software installer order that is defined at the top of the software.yml file. Gas Station is also still used to house some of the variables / data that this project uses.
|
|
||||||
|
|
||||||
## Chezmoi
|
|
||||||
|
|
||||||
This project uses Chezmoi to orchestrate the provisioning. After calling the quick start script shown above, the quick start script will ensure some dependencies are installed (including Chezmoi) and then initiate Chezmoi. In order to customize this project, you should head over to the Chezmoi documentation to get a better understanding of why some of the files in this repository start with `dot_`, `run_`, etc.
|
|
||||||
|
|
||||||
### Resetting Chezmoi
|
|
||||||
|
|
||||||
This script is designed to run only the code that is necessary to improve performance. This is accomplished by using [`.chezmoiscripts`](home/.chezmoiscripts), Chezmoi's `onchange_` identifier, and a custom installer written in ZX that is powered by the software definitions in [`software.yml`](software.yml).
|
|
||||||
|
|
||||||
If there is an error during the provision process or you make changes that are not being run during the provision process then you might want to clear Chezmoi's cache and configuration. This can be done on macOS/Linux by running:
|
|
||||||
|
|
||||||
```
|
|
||||||
rm -rf ~/.config/chezmoi && rm -rf ~/.cache/chezmoi
|
|
||||||
```
|
|
|
@ -6,21 +6,21 @@
|
||||||
### Symlink the variables / files / inventories to ~/.config/ansible folders if they are present
|
### Symlink the variables / files / inventories to ~/.config/ansible folders if they are present
|
||||||
### i.e. Changes to upstream will not impact the play if your configuration files are stored locally
|
### i.e. Changes to upstream will not impact the play if your configuration files are stored locally
|
||||||
for TARGET in "files" "group_vars" "host_vars" "inventories" "templates"; do
|
for TARGET in "files" "group_vars" "host_vars" "inventories" "templates"; do
|
||||||
if [ -d "$HOME/.config/ansible/$TARGET" ] && [ "$(readlink -f "$HOME/.local/share/ansible/$TARGET")" != "$HOME/.config/ansible/$TARGET" ]; then
|
if [ -d "${XDG_CONFIG_HOME:-$HOME/.config}/ansible/$TARGET" ] && [ "$(readlink -f "${XDG_DATA_HOME:-$HOME/.local/share}/ansible/$TARGET")" != "${XDG_CONFIG_HOME:-$HOME/.config}/ansible/$TARGET" ]; then
|
||||||
logg 'Symlinking Ansible playbook `'"$TARGET"'` to ~/.config/ansible/$TARGET'
|
logg 'Symlinking Ansible playbook `'"$TARGET"'` to ~/.config/ansible/$TARGET'
|
||||||
rm -f "$HOME/.local/share/ansible/$TARGET"
|
rm -f "${XDG_DATA_HOME:-$HOME/.local/share}/ansible/$TARGET"
|
||||||
ln -s "$HOME/.config/ansible/$TARGET" "$HOME/.local/share/ansible/$TARGET"
|
ln -s "${XDG_CONFIG_HOME:-$HOME/.config}/ansible/$TARGET" "${XDG_DATA_HOME:-$HOME/.local/share}/ansible/$TARGET"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
### Symlink tasks as well
|
### Symlink tasks as well
|
||||||
### Note: Only handles tasks one level deep (i.e. ~/.config/ansible/tasks/my-task.yml will link to the tasks folder
|
### Note: Only handles tasks one level deep (i.e. ~/.config/ansible/tasks/my-task.yml will link to the tasks folder
|
||||||
### but ~/.config/ansible/tasks/directory/my-other-task.yml will not)
|
### but ~/.config/ansible/tasks/directory/my-other-task.yml will not)
|
||||||
if [ -d "$HOME/.config/ansible/tasks" ]; then
|
if [ -d "${XDG_CONFIG_HOME:-$HOME/.config}/ansible/tasks" ]; then
|
||||||
find "$HOME/.config/ansible/tasks" -type f | while read TASK_FILE; do
|
find "${XDG_CONFIG_HOME:-$HOME/.config}/ansible/tasks" -type f | while read TASK_FILE; do
|
||||||
TASK_FILE_NAME="$(echo "$TASK_FILE" | sed 's/.*\/\([^\/]*\)$/\1/')"
|
TASK_FILE_NAME="$(echo "$TASK_FILE" | sed 's/.*\/\([^\/]*\)$/\1/')"
|
||||||
if [ "$(readlink -f "$HOME/.local/share/ansible/tasks/$TASK_FILE_NAME")" != "$TASK_FILE" ]; then
|
if [ "$(readlink -f "${XDG_DATA_HOME:-$HOME/.local/share}/ansible/tasks/$TASK_FILE_NAME")" != "$TASK_FILE" ]; then
|
||||||
ln -s "$TASK_FILE" "$HOME/.local/share/ansible/tasks/$TASK_FILE_NAME"
|
ln -s "$TASK_FILE" "${XDG_DATA_HOME:-$HOME/.local/share}/ansible/tasks/$TASK_FILE_NAME"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -37,7 +37,7 @@ decryptionFailure() {
|
||||||
logg info 'Proceeding without decrypting age encryption key stored at `~/.local/share/chezmoi/home/key.txt.age`'
|
logg info 'Proceeding without decrypting age encryption key stored at `~/.local/share/chezmoi/home/key.txt.age`'
|
||||||
logg info 'To have Chezmoi handle your encryption (so you can store your private files publicly) take a look at https://shorturl.at/jkpzG'
|
logg info 'To have Chezmoi handle your encryption (so you can store your private files publicly) take a look at https://shorturl.at/jkpzG'
|
||||||
logg info 'Removing all files that begin with encrypted_ because decryption failed'
|
logg info 'Removing all files that begin with encrypted_ because decryption failed'
|
||||||
find "$HOME/.local/share/chezmoi" -type f -name "encrypted_*" | while read ENCRYPTED_FILE; do
|
find "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi" -type f -name "encrypted_*" | while read ENCRYPTED_FILE; do
|
||||||
logg info "Removing $ENCRYPTED_FILE"
|
logg info "Removing $ENCRYPTED_FILE"
|
||||||
rm -f "$ENCRYPTED_FILE"
|
rm -f "$ENCRYPTED_FILE"
|
||||||
done
|
done
|
||||||
|
|
|
@ -13,7 +13,7 @@ if command -v brew > /dev/null && command -v sdkman-cli > /dev/null; then
|
||||||
export SDKMAN_DIR="$(brew --prefix sdkman-cli)/libexec"
|
export SDKMAN_DIR="$(brew --prefix sdkman-cli)/libexec"
|
||||||
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||||
elif [ -f "$SDKMAN_DIR/bin/sdkman-init.sh" ]; then
|
elif [ -f "$SDKMAN_DIR/bin/sdkman-init.sh" ]; then
|
||||||
export SDKMAN_DIR="$XDG_DATA_HOME/sdkman"
|
export SDKMAN_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/sdkman"
|
||||||
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -17,13 +17,13 @@ if [ -f /tmp/install-gnome-extensions.txt ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Register temporary file for gnome.yml JSON
|
### Register temporary file for gnome.yml JSON
|
||||||
if [ -f "$HOME/.config/desktop/gnome.yml" ]; then
|
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/desktop/gnome.yml" ]; then
|
||||||
TMP_YQ="$(mktemp)"
|
TMP_YQ="$(mktemp)"
|
||||||
cat "$HOME/.config/desktop/gnome.yml" | yq e -o=j '.' > "$TMP_YQ"
|
cat "${XDG_CONFIG_HOME:-$HOME/.config}/desktop/gnome.yml" | yq e -o=j '.' > "$TMP_YQ"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Populate /tmp/install-gnome-extensions.txt with GNOME extensions that need to be installed
|
### Populate /tmp/install-gnome-extensions.txt with GNOME extensions that need to be installed
|
||||||
if [ -f "$HOME/.config/desktop/gnome.yml" ]; then
|
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/desktop/gnome.yml" ]; then
|
||||||
cat "$TMP_YQ" | jq -c '.default_gnome_extensions[] | tojson' | while read EXT; do
|
cat "$TMP_YQ" | jq -c '.default_gnome_extensions[] | tojson' | while read EXT; do
|
||||||
TMP="$(mktemp)"
|
TMP="$(mktemp)"
|
||||||
echo "$EXT" | sed 's/^.\(.*\).$/\1/' > "$TMP"
|
echo "$EXT" | sed 's/^.\(.*\).$/\1/' > "$TMP"
|
||||||
|
@ -66,7 +66,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Apply plugin gsettings
|
### Apply plugin gsettings
|
||||||
if [ -f "$HOME/.config/desktop/gnome.yml" ]; then
|
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/desktop/gnome.yml" ]; then
|
||||||
cat "$TMP_YQ" | jq -c '.default_gnome_extensions[] | tojson' | while read EXT; do
|
cat "$TMP_YQ" | jq -c '.default_gnome_extensions[] | tojson' | while read EXT; do
|
||||||
if [ "$DEBUG_MODE" == 'true' ]; then
|
if [ "$DEBUG_MODE" == 'true' ]; then
|
||||||
logg info 'Extension data:'
|
logg info 'Extension data:'
|
||||||
|
|
|
@ -16,12 +16,12 @@ if [ -d /Applications ] && [ -d /System ]; then
|
||||||
logg info 'Copying fonts from ~/Library/Fonts and ~/.local/share/fonts to /Library/Fonts to make them available globally'
|
logg info 'Copying fonts from ~/Library/Fonts and ~/.local/share/fonts to /Library/Fonts to make them available globally'
|
||||||
FONT_DIR='/Library/Fonts'
|
FONT_DIR='/Library/Fonts'
|
||||||
sudo rsync -av "$HOME/Library/Fonts" "$FONT_DIR"
|
sudo rsync -av "$HOME/Library/Fonts" "$FONT_DIR"
|
||||||
sudo rsync -av "$HOME/.local/share/fonts" "$FONT_DIR"
|
sudo rsync -av "${XDG_DATA_HOME:-$HOME/.local/share}/fonts" "$FONT_DIR"
|
||||||
else
|
else
|
||||||
# Linux
|
# Linux
|
||||||
logg info 'Copying fonts from ~/.local/share/fonts to /usr/local/share/fonts to make them available globally'
|
logg info 'Copying fonts from ~/.local/share/fonts to /usr/local/share/fonts to make them available globally'
|
||||||
FONT_DIR='/usr/local/share/fonts'
|
FONT_DIR='/usr/local/share/fonts'
|
||||||
sudo rsync -av "$HOME/.local/share/fonts" "$FONT_DIR"
|
sudo rsync -av "${XDG_DATA_HOME:-$HOME/.local/share}/fonts" "$FONT_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Configure system font properties
|
### Configure system font properties
|
||||||
|
|
|
@ -28,8 +28,8 @@ dconf dump / > "$DCONF_TMP"
|
||||||
logg info 'Backed up system dconf settings to '"$DCONF_TMP"
|
logg info 'Backed up system dconf settings to '"$DCONF_TMP"
|
||||||
|
|
||||||
### Reset system settings / load saved configurations from ~/.config/dconf/settings
|
### Reset system settings / load saved configurations from ~/.config/dconf/settings
|
||||||
if [ -d "$XDG_CONFIG_HOME/dconf/settings" ]; then
|
if [ -d "${XDG_CONFIG_HOME:-$HOME/.config}/dconf/settings" ]; then
|
||||||
find "$XDG_CONFIG_HOME/dconf/settings" -mindepth 1 -maxdepth 1 -type f | while read DCONF_CONFIG_FILE; do
|
find "${XDG_CONFIG_HOME:-$HOME/.config}/dconf/settings" -mindepth 1 -maxdepth 1 -type f | while read DCONF_CONFIG_FILE; do
|
||||||
if [ "$DEBUG_MODE" == 'true' ]; then
|
if [ "$DEBUG_MODE" == 'true' ]; then
|
||||||
logg info 'Dconf configuration file:'
|
logg info 'Dconf configuration file:'
|
||||||
echo "$DCONF_CONFIG_FILE"
|
echo "$DCONF_CONFIG_FILE"
|
||||||
|
|
|
@ -11,5 +11,5 @@
|
||||||
{{ includeTemplate "universal/logg" }}
|
{{ includeTemplate "universal/logg" }}
|
||||||
|
|
||||||
logg 'Installing crontab jobs'
|
logg 'Installing crontab jobs'
|
||||||
crontab < "$XDG_CONFIG_HOME/crontab/config"
|
crontab < "${XDG_CONFIG_HOME:-$HOME/.config}/crontab/config"
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
if command -v rclone > /dev/null; then
|
if command -v rclone > /dev/null; then
|
||||||
{{- if and (or (and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID"))) (env "CLOUDFLARE_R2_ID")) (or (and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET"))) (env "CLOUDFLARE_R2_SECRET")) (ne .user.cloudflare.r2 "") }}
|
{{- if and (or (and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID"))) (env "CLOUDFLARE_R2_ID")) (or (and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET"))) (env "CLOUDFLARE_R2_SECRET")) (ne .user.cloudflare.r2 "") }}
|
||||||
logg info 'Removing ~/.config/rclone/rclone.conf INSTALL DOCTOR managed block'
|
logg info 'Removing ~/.config/rclone/rclone.conf INSTALL DOCTOR managed block'
|
||||||
CONFIG_FILE="$HOME/.config/rclone/rclone.conf"
|
CONFIG_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/rclone/rclone.conf"
|
||||||
if cat "$CONFIG_FILE" | grep '# INSTALL DOCTOR MANAGED S3'; then
|
if cat "$CONFIG_FILE" | grep '# INSTALL DOCTOR MANAGED S3'; then
|
||||||
# TODO: Remove old block
|
# TODO: Remove old block
|
||||||
START_LINE="$(echo `grep -n -m 1 "# INSTALL DOCTOR MANAGED S3" "$CONFIG_FILE" | cut -f1 -d ":"`)"
|
START_LINE="$(echo `grep -n -m 1 "# INSTALL DOCTOR MANAGED S3" "$CONFIG_FILE" | cut -f1 -d ":"`)"
|
||||||
|
|
|
@ -19,7 +19,7 @@ if [ "$DEBUG_MODE" == 'true' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Initialize
|
### Initialize
|
||||||
COMPLETION_DIR="$HOME/.local/share/bash-completion/completions"
|
COMPLETION_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions"
|
||||||
mkdir -p "$COMPLETION_DIR"
|
mkdir -p "$COMPLETION_DIR"
|
||||||
|
|
||||||
### Aqua
|
### Aqua
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
{{ includeTemplate "universal/profile-before" }}
|
{{ includeTemplate "universal/profile-before" }}
|
||||||
{{ includeTemplate "universal/logg-before" }}
|
{{ includeTemplate "universal/logg-before" }}
|
||||||
|
|
||||||
export VOLTA_HOME="$XDG_DATA_HOME/volta"
|
export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta"
|
||||||
export PATH="$VOLTA_HOME/bin:$PATH"
|
export PATH="$VOLTA_HOME/bin:$PATH"
|
||||||
|
|
||||||
### Ensure node is installed
|
### Ensure node is installed
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
{{ includeTemplate "universal/profile-before" }}
|
{{ includeTemplate "universal/profile-before" }}
|
||||||
{{ includeTemplate "universal/logg-before" }}
|
{{ includeTemplate "universal/logg-before" }}
|
||||||
|
|
||||||
export VOLTA_HOME="$XDG_DATA_HOME/volta"
|
export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta"
|
||||||
export PATH="$VOLTA_HOME/bin:$PATH"
|
export PATH="$VOLTA_HOME/bin:$PATH"
|
||||||
|
|
||||||
### Ensure recent version of Node.js is being used
|
### Ensure recent version of Node.js is being used
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
{{ includeTemplate "universal/profile-before" }}
|
{{ includeTemplate "universal/profile-before" }}
|
||||||
{{ includeTemplate "universal/logg-before" }}
|
{{ includeTemplate "universal/logg-before" }}
|
||||||
|
|
||||||
export VOLTA_HOME="$XDG_DATA_HOME/volta"
|
export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta"
|
||||||
export PATH="$VOLTA_HOME/bin:$PATH"
|
export PATH="$VOLTA_HOME/bin:$PATH"
|
||||||
|
|
||||||
if command -v brew > /dev/null; then
|
if command -v brew > /dev/null; then
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
### Source .bashrc if it is present
|
### Source .bashrc if it is present
|
||||||
if [ -f "$HOME/.bashrc" ]; then
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
. "$HOME/.bashrc"
|
. "$HOME/.bashrc"
|
||||||
elif [ -f "$HOME/.config/shell/exports.sh" ]; then
|
elif [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/exports.sh" ]; then
|
||||||
. "$HOME/.config/shell/exports.sh"
|
. "${XDG_CONFIG_HOME:-$HOME/.config}/shell/exports.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### XDG
|
### XDG
|
||||||
XDG_CONFIG_HOME="$HOME/.config"
|
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
XDG_CACHE_HOME="$HOME/.cache"
|
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||||
XDG_DATA_HOME="$HOME/.local/share"
|
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||||
|
|
||||||
### Ensure Homebrew PATHs
|
### Ensure Homebrew PATHs
|
||||||
if [ -d "/home/linuxbrew/.linuxbrew/bin" ]; then
|
if [ -d "/home/linuxbrew/.linuxbrew/bin" ]; then
|
||||||
|
@ -29,10 +29,10 @@ fi
|
||||||
export HOMEBREW_NO_ANALYTICS=1
|
export HOMEBREW_NO_ANALYTICS=1
|
||||||
|
|
||||||
### SDKMan
|
### SDKMan
|
||||||
export SDKMAN_DIR="$XDG_DATA_HOME/sdkman"
|
export SDKMAN_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/sdkman"
|
||||||
|
|
||||||
### Volta
|
### Volta
|
||||||
export VOLTA_HOME="$XDG_DATA_HOME/volta"
|
export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta"
|
||||||
export PATH="$VOLTA_HOME/bin:$PATH"
|
export PATH="$VOLTA_HOME/bin:$PATH"
|
||||||
|
|
||||||
### Ensure ~/.local/bin in PATH
|
### Ensure ~/.local/bin in PATH
|
||||||
|
|
|
@ -17,7 +17,7 @@ if [ "$0" = 'bash' ] || [ "$0" = '/bin/bash' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Import Common Settings
|
### Import Common Settings
|
||||||
[ ! -f "$HOME/.config/shell/profile.sh" ] || . "$HOME/.config/shell/profile.sh"
|
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile.sh" ] || . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/profile.sh"
|
||||||
|
|
||||||
### Ble.sh
|
### Ble.sh
|
||||||
[[ $- == *i* ]] && source "${XDG_DATA_HOME:-$HOME/.local/share}/blesh/ble.sh" --noattach --rcfile "${XDG_DATA_CONFIG:-$HOME/.config}/blesh/bleshrc"
|
[[ $- == *i* ]] && source "${XDG_DATA_HOME:-$HOME/.local/share}/blesh/ble.sh" --noattach --rcfile "${XDG_DATA_CONFIG:-$HOME/.config}/blesh/bleshrc"
|
||||||
|
@ -68,7 +68,7 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
|
||||||
. "$BASH_IT/bash_it.sh"
|
. "$BASH_IT/bash_it.sh"
|
||||||
elif command -v oh-my-posh > /dev/null; then
|
elif command -v oh-my-posh > /dev/null; then
|
||||||
# Oh My Posh (See: https://ohmyposh.dev/)
|
# Oh My Posh (See: https://ohmyposh.dev/)
|
||||||
eval "$(oh-my-posh init bash --config "$XDG_CONFIG_HOME/oh-my-posh/Betelgeuse.omp.json")"
|
eval "$(oh-my-posh init bash --config "${XDG_CONFIG_HOME:-$HOME/.config}/oh-my-posh/Betelgeuse.omp.json")"
|
||||||
else
|
else
|
||||||
# Basic styled terminal
|
# Basic styled terminal
|
||||||
case "$TERM" in
|
case "$TERM" in
|
||||||
|
@ -79,9 +79,7 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Minimal session
|
# Minimal session
|
||||||
if command -v oh-my-posh > /dev/null; then
|
! command -v oh-my-posh > /dev/null || eval "$(oh-my-posh init bash --config "${XDG_CONFIG_HOME/.config}/oh-my-posh/Betelgeuse-minimal.omp.json")"
|
||||||
eval "$(oh-my-posh init bash --config "$XDG_CONFIG_HOME/oh-my-posh/Betelgeuse-minimal.omp.json")"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Bash Completion (Homebrew)
|
### Bash Completion (Homebrew)
|
||||||
|
@ -97,34 +95,22 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Atuin
|
### Atuin
|
||||||
if command -v atuin > /dev/null; then
|
! command -v atuin > /dev/null || eval "$(atuin init bash)"
|
||||||
eval "$(atuin init bash)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Carapace
|
### Carapace
|
||||||
if command -v carapace > /dev/null; then
|
! command -v carapace > /dev/null || source <(carapace _carapace)
|
||||||
source <(carapace _carapace)
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Cod
|
### Cod
|
||||||
if command -v cod > /dev/null; then
|
! command -v cod > /dev/null || . <(cod init $$ bash)
|
||||||
. <(cod init $$ bash)
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Google Cloud SDK
|
### Google Cloud SDK
|
||||||
if [ -f "${HOMEBREW_PREFIX}/share/google-cloud-sdk/path.bash.inc" ]; then
|
[ ! -f "${HOMEBREW_PREFIX}/share/google-cloud-sdk/path.bash.inc" ] || . "$HOMEBREW_PREFIX/share/google-cloud-sdk/path.bash.inc"
|
||||||
. "$HOMEBREW_PREFIX/share/google-cloud-sdk/path.bash.inc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### direnv
|
### direnv
|
||||||
if command -v direnv > /dev/null; then
|
! command -v direnv > /dev/null || eval "$(direnv hook bash)"
|
||||||
eval "$(direnv hook bash)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Emplace
|
### Emplace
|
||||||
if command -v emplace > /dev/null; then
|
! command -v emplace > /dev/null || . <(emplace init bash)
|
||||||
. <(emplace init bash)
|
|
||||||
fi
|
|
||||||
|
|
||||||
### hiSHtory
|
### hiSHtory
|
||||||
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/hishtory/config.sh" ]; then
|
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/hishtory/config.sh" ]; then
|
||||||
|
@ -138,14 +124,10 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### iTerm2
|
### iTerm2
|
||||||
if [ -f "$HOME/.local/scripts/iterm2.bash" ]; then
|
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/iterm/iterm2.bash" ] || . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/iterm/iterm2.bash"
|
||||||
. "$HOME/.local/scripts/iterm2.bash"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Fig
|
### Fig
|
||||||
if [ -f "$HOME/.fig/shell/bashrc.post.bash" ]; then
|
[ ! -f "$HOME/.fig/shell/bashrc.post.bash" ] || . "$HOME/.fig/shell/bashrc.post.bash"
|
||||||
. "$HOME/.fig/shell/bashrc.post.bash"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Mamba Forge (Faster Conda Drop-In Replacement)
|
### Mamba Forge (Faster Conda Drop-In Replacement)
|
||||||
# TODO: Add logic for Linux
|
# TODO: Add logic for Linux
|
||||||
|
@ -185,28 +167,22 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Navi (Ctrl+G)
|
### Navi (Ctrl+G)
|
||||||
if command -v navi > /dev/null; then
|
! command -v navi > /dev/null || eval "$(navi widget bash)"
|
||||||
eval "$(navi widget bash)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### SDKMan
|
### SDKMan
|
||||||
if command -v brew > /dev/null && command -v sdkman-cli > /dev/null; then
|
if command -v brew > /dev/null && command -v sdkman-cli > /dev/null; then
|
||||||
export SDKMAN_DIR="$(brew --prefix sdkman-cli)/libexec"
|
export SDKMAN_DIR="$(brew --prefix sdkman-cli)/libexec"
|
||||||
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||||
elif [ -f "$SDKMAN_DIR/bin/sdkman-init.sh" ]; then
|
elif [ -f "$SDKMAN_DIR/bin/sdkman-init.sh" ]; then
|
||||||
export SDKMAN_DIR="$XDG_DATA_HOME/sdkman"
|
export SDKMAN_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/sdkman"
|
||||||
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Up
|
### Up
|
||||||
if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh" ]; then
|
[ ! -f "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh" ] || . "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh"
|
||||||
. "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Vault
|
### Vault
|
||||||
if command -v vault > /dev/null; then
|
! command -v vault > /dev/null || complete -C vault vault
|
||||||
complete -C vault vault
|
|
||||||
fi
|
|
||||||
|
|
||||||
### zoxide
|
### zoxide
|
||||||
if command -v zoxide > /dev/null; then
|
if command -v zoxide > /dev/null; then
|
||||||
|
|
|
@ -22,6 +22,7 @@ The following plugins were tested but removed because the `extensions.json` alre
|
||||||
"gitpod.gitpod-desktop",
|
"gitpod.gitpod-desktop",
|
||||||
"gitpod.gitpod-remote-ssh", // Bunch of errors like this during install [gitpod-remote-ssh]: Couldn't find message for key openPreview.
|
"gitpod.gitpod-remote-ssh", // Bunch of errors like this during install [gitpod-remote-ssh]: Couldn't find message for key openPreview.
|
||||||
"google-home.google-home-extension",
|
"google-home.google-home-extension",
|
||||||
|
"htmlhint.vscode-htmlhint", // Couldn't start client HTML-hint on macOS GitHub remote repository
|
||||||
"ibm.codewind", // Creates a ~/.codewind folder. Does not respect XDG spec.
|
"ibm.codewind", // Creates a ~/.codewind folder. Does not respect XDG spec.
|
||||||
"ibm.ibm-developer",
|
"ibm.ibm-developer",
|
||||||
"idered.npm",
|
"idered.npm",
|
||||||
|
@ -72,4 +73,4 @@ The following plugins were tested but removed because the `extensions.json` alre
|
||||||
"wasteamaccount.webtemplatestudio-dev-nightly",
|
"wasteamaccount.webtemplatestudio-dev-nightly",
|
||||||
"webhint.vscode-webhint"
|
"webhint.vscode-webhint"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -65,7 +65,6 @@
|
||||||
"hashicorp.sentinel",
|
"hashicorp.sentinel",
|
||||||
"hashicorp.terraform",
|
"hashicorp.terraform",
|
||||||
"hediet.vscode-drawio",
|
"hediet.vscode-drawio",
|
||||||
"htmlhint.vscode-htmlhint",
|
|
||||||
"humao.rest-client",
|
"humao.rest-client",
|
||||||
"ibm.output-colorizer",
|
"ibm.output-colorizer",
|
||||||
"jerrygoyal.shortcut-menu-bar",
|
"jerrygoyal.shortcut-menu-bar",
|
||||||
|
|
|
@ -53,13 +53,15 @@
|
||||||
"**/.trunk/*actions/": true,
|
"**/.trunk/*actions/": true,
|
||||||
"**/.trunk/*logs/": true,
|
"**/.trunk/*logs/": true,
|
||||||
"**/.trunk/*out/": true,
|
"**/.trunk/*out/": true,
|
||||||
"**/.trunk/*plugins/": true
|
"**/.trunk/*plugins/": true,
|
||||||
|
"**/.trunk/*notifications/": true
|
||||||
},
|
},
|
||||||
"files.watcherExclude": {
|
"files.watcherExclude": {
|
||||||
"**/.trunk/*actions/": true,
|
"**/.trunk/*actions/": true,
|
||||||
"**/.trunk/*logs/": true,
|
"**/.trunk/*logs/": true,
|
||||||
"**/.trunk/*out/": true,
|
"**/.trunk/*out/": true,
|
||||||
"**/.trunk/*plugins/": true
|
"**/.trunk/*plugins/": true,
|
||||||
|
"**/.trunk/*notifications/": true
|
||||||
},
|
},
|
||||||
"git.autofetch": true,
|
"git.autofetch": true,
|
||||||
"git.enableSmartCommit": true,
|
"git.enableSmartCommit": true,
|
||||||
|
@ -342,5 +344,26 @@
|
||||||
"pieces.autocomplete": true,
|
"pieces.autocomplete": true,
|
||||||
"pieces.autocompleteKey": "Tab only",
|
"pieces.autocompleteKey": "Tab only",
|
||||||
"pieces.notifications": "Only Critical Notifications",
|
"pieces.notifications": "Only Critical Notifications",
|
||||||
"thunder-client.workspaceRelativePath": ".config"
|
"thunder-client.workspaceRelativePath": ".config",
|
||||||
|
"editor.acceptSuggestionOnEnter": "off",
|
||||||
|
"files.associations": {
|
||||||
|
"**/frontmatter.json": {
|
||||||
|
"**/frontmatter.json": "jsonc",
|
||||||
|
"**/.frontmatter/config/*.json": "jsonc",
|
||||||
|
".env*": "dotenv"
|
||||||
|
},
|
||||||
|
"editor.tokenColorCustomizations": {
|
||||||
|
"textMateRules": [
|
||||||
|
{
|
||||||
|
"scope": "keyword.other.dotenv",
|
||||||
|
"settings": {
|
||||||
|
"foreground": "#FF000000"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"workbench.editorAssociations": {
|
||||||
|
"*.webp": "magickImageReader.readImage"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,24 +1,37 @@
|
||||||
{
|
{
|
||||||
"sh.enable": true,
|
"sh.enable": true,
|
||||||
"dockerfile": {
|
"dockerfile": {
|
||||||
"command": "docker-langserver",
|
"command": "docker-langserver",
|
||||||
"filetypes": ["Dockerfile"],
|
"filetypes": [
|
||||||
"args": ["--stdio"]
|
"Dockerfile"
|
||||||
},
|
],
|
||||||
"sql": {
|
"args": [
|
||||||
"module": "$HOME/.local/share/nvim/lib/node_modules/sql-language-server/npm_bin/cli.js",
|
"--stdio"
|
||||||
"args": ["up", "--method", "node-ipc"],
|
]
|
||||||
"filetypes": ["sql", "mysql"]
|
},
|
||||||
},
|
"sql": {
|
||||||
"terraform": {
|
"module": "${XDG_DATA_HOME:-$HOME/.local/share}/nvim/lib/node_modules/sql-language-server/npm_bin/cli.js",
|
||||||
"command": "terraform-ls",
|
"args": [
|
||||||
"args": ["serve"],
|
"up",
|
||||||
"filetypes": [
|
"--method",
|
||||||
"terraform",
|
"node-ipc"
|
||||||
"tf"
|
],
|
||||||
],
|
"filetypes": [
|
||||||
"initializationOptions": {},
|
"sql",
|
||||||
"settings": {}
|
"mysql"
|
||||||
}
|
]
|
||||||
|
},
|
||||||
|
"terraform": {
|
||||||
|
"command": "terraform-ls",
|
||||||
|
"args": [
|
||||||
|
"serve"
|
||||||
|
],
|
||||||
|
"filetypes": [
|
||||||
|
"terraform",
|
||||||
|
"tf"
|
||||||
|
],
|
||||||
|
"initializationOptions": {},
|
||||||
|
"settings": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ container_generate_entry=0
|
||||||
container_manager="docker"
|
container_manager="docker"
|
||||||
container_image_default="registry.opensuse.org/opensuse/toolbox:latest"
|
container_image_default="registry.opensuse.org/opensuse/toolbox:latest"
|
||||||
container_name_default="distrobox"
|
container_name_default="distrobox"
|
||||||
container_user_custom_home="$HOME/.local/share/distrobox"
|
container_user_custom_home="${XDG_DATA_HOME:-$HOME/.local/share}/distrobox"
|
||||||
# container_init_hook="~/.local/distrobox/a_custom_default_init_hook.sh"
|
# container_init_hook="~/.local/distrobox/a_custom_default_init_hook.sh"
|
||||||
# container_pre_init_hook="~/a_custom_default_pre_init_hook.sh"
|
# container_pre_init_hook="~/a_custom_default_pre_init_hook.sh"
|
||||||
# container_manager_additional_flags="--env-file /path/to/file --custom-flag"
|
# container_manager_additional_flags="--env-file /path/to/file --custom-flag"
|
||||||
|
|
|
@ -83,10 +83,10 @@ fi
|
||||||
|
|
||||||
### mitmproxy / mitmweb
|
### mitmproxy / mitmweb
|
||||||
if command -v mitmproxy > /dev/null; then
|
if command -v mitmproxy > /dev/null; then
|
||||||
alias mitmproxy="mitmproxy --set confdir=$XDG_CONFIG_HOME/mitmproxy"
|
alias mitmproxy="mitmproxy --set confdir=${XDG_CONFIG_HOME:-$HOME/.config}/mitmproxy"
|
||||||
fi
|
fi
|
||||||
if command -v mitmweb > /dev/null; then
|
if command -v mitmweb > /dev/null; then
|
||||||
alias mitmweb="mitmweb --set confdir=$XDG_CONFIG_HOME/mitmproxy"
|
alias mitmweb="mitmweb --set confdir=${XDG_CONFIG_HOME:-$HOME/.config}/mitmproxy"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### ripgrep
|
### ripgrep
|
||||||
|
@ -258,7 +258,7 @@ fi
|
||||||
alias wget="wget --hsts-file ~/.local/wget-hsts"
|
alias wget="wget --hsts-file ~/.local/wget-hsts"
|
||||||
|
|
||||||
### Yarn
|
### Yarn
|
||||||
alias yarn='yarn --use-yarnrc "$XDG_CONFIG_HOME/yarn/config"'
|
alias yarn='yarn --use-yarnrc "${XDG_CONFIG_HOME:-$HOME/.config}/yarn/config"'
|
||||||
|
|
||||||
# Running this will update GPG to point to the current YubiKey
|
# Running this will update GPG to point to the current YubiKey
|
||||||
alias yubi-stub='gpg-connect-agent "scd serialno" "learn --force" /bye'
|
alias yubi-stub='gpg-connect-agent "scd serialno" "learn --force" /bye'
|
||||||
|
|
|
@ -10,9 +10,9 @@ export DO_NOT_TRACK=1
|
||||||
|
|
||||||
### XDG
|
### XDG
|
||||||
# Source: # https://wiki.archlinux.org/index.php/XDG_Base_Directory
|
# Source: # https://wiki.archlinux.org/index.php/XDG_Base_Directory
|
||||||
export XDG_CONFIG_HOME="$HOME/.config"
|
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
export XDG_CACHE_HOME="$HOME/.cache"
|
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||||
export XDG_DATA_HOME="$HOME/.local/share"
|
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||||
export XDG_STATE_HOME="$HOME/.local/state"
|
export XDG_STATE_HOME="$HOME/.local/state"
|
||||||
export XDG_RUNTIME_DIR=
|
export XDG_RUNTIME_DIR=
|
||||||
{{- if eq .host.distro.family "darwin" -}}
|
{{- if eq .host.distro.family "darwin" -}}
|
||||||
|
@ -35,8 +35,8 @@ export XDG_PUBLICSHARE_DIR="$HOME/Public"
|
||||||
|
|
||||||
### Theme
|
### Theme
|
||||||
export COLOR_SCHEME=dark
|
export COLOR_SCHEME=dark
|
||||||
export GTK_RC_FILES="$XDG_CONFIG_HOME/gtk-1.0/gtkrc"
|
export GTK_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-1.0/gtkrc"
|
||||||
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
|
export GTK2_RC_FILES="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-2.0/gtkrc"
|
||||||
|
|
||||||
### PATH References
|
### PATH References
|
||||||
export PATH_TASK="$(which task)"
|
export PATH_TASK="$(which task)"
|
||||||
|
@ -70,7 +70,7 @@ elif [ -f /usr/local/bin/brew ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Android Studio
|
### Android Studio
|
||||||
export ANDROID_AVD_HOME="$XDG_DATA_HOME/android/avd"
|
export ANDROID_AVD_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/android/avd"
|
||||||
if [ -d /Applications ] && [ -d /System ]; then
|
if [ -d /Applications ] && [ -d /System ]; then
|
||||||
### macOS
|
### macOS
|
||||||
export WHALEBREW_INSTALL_PATH="/usr/local/bin"
|
export WHALEBREW_INSTALL_PATH="/usr/local/bin"
|
||||||
|
@ -85,54 +85,54 @@ if [ -d /Applications ] && [ -d /System ]; then
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
### Linux / Windows
|
### Linux / Windows
|
||||||
export ANDROID_SDK_HOME="$XDG_DATA_HOME/android/sdk"
|
export ANDROID_SDK_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/android/sdk"
|
||||||
export ANDROID_SDK_ROOT="$XDG_DATA_HOME/android/sdk"
|
export ANDROID_SDK_ROOT="${XDG_DATA_HOME:-$HOME/.local/share}/android/sdk"
|
||||||
export ANDROID_HOME="$XDG_DATA_HOME/sdk"
|
export ANDROID_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/sdk"
|
||||||
export PATH="$PATH:$XDG_DATA_HOME/android/sdk/cmdline-tools/latest/bin"
|
export PATH="$PATH:${XDG_DATA_HOME:-$HOME/.local/share}/android/sdk/cmdline-tools/latest/bin"
|
||||||
export PATH="$PATH:$XDG_DATA_HOME/android/sdk/platform-tools"
|
export PATH="$PATH:${XDG_DATA_HOME:-$HOME/.local/share}/android/sdk/platform-tools"
|
||||||
export PATH="$PATH:$XDG_DATA_HOME/android/sdk/tools/bin"
|
export PATH="$PATH:${XDG_DATA_HOME:-$HOME/.local/share}/android/sdk/tools/bin"
|
||||||
export PATH="$PATH:$XDG_DATA_HOME/android/sdk/tools"
|
export PATH="$PATH:${XDG_DATA_HOME:-$HOME/.local/share}/android/sdk/tools"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Ansible
|
### Ansible
|
||||||
export ANSIBLE_CONFIG="$XDG_DATA_HOME/ansible/ansible.cfg"
|
export ANSIBLE_CONFIG="${XDG_DATA_HOME:-$HOME/.local/share}/ansible/ansible.cfg"
|
||||||
export ANSIBLE_HOME="$XDG_DATA_HOME/ansible"
|
export ANSIBLE_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/ansible"
|
||||||
|
|
||||||
### Aqua
|
### Aqua
|
||||||
export AQUA_ROOT_DIR="$XDG_DATA_HOME/aqua"
|
export AQUA_ROOT_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/aqua"
|
||||||
export AQUA_GLOBAL_CONFIG="$XDG_CONFIG_HOME/aqua/aqua.yaml"
|
export AQUA_GLOBAL_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/aqua/aqua.yaml"
|
||||||
export PATH="${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin:$PATH"
|
export PATH="${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin:$PATH"
|
||||||
|
|
||||||
### ASDF
|
### ASDF
|
||||||
export ASDF_CONFIG_FILE="$XDG_CONFIG_HOME/asdf/asdfrc"
|
export ASDF_CONFIG_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/asdfrc"
|
||||||
export ASDF_DIR="$XDG_DATA_HOME/asdf"
|
export ASDF_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/asdf"
|
||||||
export ASDF_DATA_DIR="$ASDF_DIR"
|
export ASDF_DATA_DIR="$ASDF_DIR"
|
||||||
export ASDF_CRATE_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/asdf/default-cargo-pkgs"
|
export ASDF_CRATE_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/default-cargo-pkgs"
|
||||||
export ASDF_GEM_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/asdf/default-ruby-pkgs"
|
export ASDF_GEM_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/default-ruby-pkgs"
|
||||||
export ASDF_GOLANG_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/asdf/default-golang-pkgs"
|
export ASDF_GOLANG_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/default-golang-pkgs"
|
||||||
export ASDF_GOLANG_MOD_VERSION_ENABLED=true
|
export ASDF_GOLANG_MOD_VERSION_ENABLED=true
|
||||||
export ASDF_NPM_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/asdf/default-npm-packages"
|
export ASDF_NPM_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/default-npm-packages"
|
||||||
export ASDF_PYTHON_DEFAULT_PACKAGES_FILE="$XDG_CONFIG_HOME/asdf/default-python-pkgs"
|
export ASDF_PYTHON_DEFAULT_PACKAGES_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/asdf/default-python-pkgs"
|
||||||
|
|
||||||
### AWS CLI
|
### AWS CLI
|
||||||
export AWS_SHARED_CREDENTIALS_FILE="$XDG_CONFIG_HOME/aws/credentials"
|
export AWS_SHARED_CREDENTIALS_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/aws/credentials"
|
||||||
export AWS_CONFIG_FILE="$XDG_CONFIG_HOME/aws/config"
|
export AWS_CONFIG_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/aws/config"
|
||||||
if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.crt" ]; then
|
if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.crt" ]; then
|
||||||
export AWS_CA_BUNDLE="${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.crt"
|
export AWS_CA_BUNDLE="${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.crt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Azure CLI
|
### Azure CLI
|
||||||
export AZURE_CONFIG_DIR="$XDG_CONFIG_HOME/azure"
|
export AZURE_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/azure"
|
||||||
|
|
||||||
### bat
|
### bat
|
||||||
export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config"
|
export BAT_CONFIG_PATH="${XDG_CONFIG_HOME:-$HOME/.config}/bat/config"
|
||||||
|
|
||||||
### Cargo
|
### Cargo
|
||||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
export CARGO_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/cargo"
|
||||||
export PATH="$PATH:$CARGO_HOME/bin"
|
export PATH="$PATH:$CARGO_HOME/bin"
|
||||||
|
|
||||||
### Bash
|
### Bash
|
||||||
export BASH_COMPLETION_USER_FILE="$XDG_CONFIG_HOME/bash-completion/bash_completion"
|
export BASH_COMPLETION_USER_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/bash-completion/bash_completion"
|
||||||
|
|
||||||
### Bash It
|
### Bash It
|
||||||
# Don't check mail when opening terminal.
|
# Don't check mail when opening terminal.
|
||||||
|
@ -164,37 +164,37 @@ fi
|
||||||
export CONCURRENT_LOG_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/concurrent"
|
export CONCURRENT_LOG_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/concurrent"
|
||||||
|
|
||||||
### Desk
|
### Desk
|
||||||
export DESK_DIR="$XDG_CONFIG_HOME/desk"
|
export DESK_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/desk"
|
||||||
export DESK_DESKS_DIR="$XDG_CONFIG_HOME/desk/desks"
|
export DESK_DESKS_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/desk/desks"
|
||||||
|
|
||||||
### Deta
|
### Deta
|
||||||
export DETA_INSTALL="$XDG_DATA_HOME/deta"
|
export DETA_INSTALL="${XDG_DATA_HOME:-$HOME/.local/share}/deta"
|
||||||
export PATH="$PATH:$DETA_INSTALL/bin"
|
export PATH="$PATH:$DETA_INSTALL/bin"
|
||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
|
export DOCKER_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/docker"
|
||||||
export MACHINE_STORAGE_PATH="$XDG_DATA_HOME/docker-machine"
|
export MACHINE_STORAGE_PATH="${XDG_DATA_HOME:-$HOME/.local/share}/docker-machine"
|
||||||
|
|
||||||
### Dotnet
|
### Dotnet
|
||||||
export DOTNET_CLI_HOME="$XDG_CONFIG_HOME/dotnet"
|
export DOTNET_CLI_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/dotnet"
|
||||||
if [ -d /Applications ] && [ -d /Library ]; then
|
if [ -d /Applications ] && [ -d /Library ]; then
|
||||||
export DOTNET_ROOT="/usr/local/opt/dotnet/libexec"
|
export DOTNET_ROOT="/usr/local/opt/dotnet/libexec"
|
||||||
elif [ -d /home/linuxbrew/.linuxbrew/opt/dotnet ]; then
|
elif [ -d /home/linuxbrew/.linuxbrew/opt/dotnet ]; then
|
||||||
export DOTNET_ROOT="/home/linuxbrew/.linuxbrew/opt/dotnet/libexec"
|
export DOTNET_ROOT="/home/linuxbrew/.linuxbrew/opt/dotnet/libexec"
|
||||||
fi
|
fi
|
||||||
export PATH="$PATH:$XDG_CONFIG_HOME/dotnet/.dotnet/tools"
|
export PATH="$PATH:${XDG_CONFIG_HOME:-$HOME/.config}/dotnet/.dotnet/tools"
|
||||||
|
|
||||||
### Elastic Agent
|
### Elastic Agent
|
||||||
# https://www.elastic.co/guide/en/fleet/current/agent-environment-variables.html#env-common-vars
|
# https://www.elastic.co/guide/en/fleet/current/agent-environment-variables.html#env-common-vars
|
||||||
|
|
||||||
### ffmpeg
|
### ffmpeg
|
||||||
export FFMPEG_DATADIR="$XDG_CONFIG_HOME/ffmpeg"
|
export FFMPEG_DATADIR="${XDG_CONFIG_HOME:-$HOME/.config}/ffmpeg"
|
||||||
|
|
||||||
### Flatpak
|
### Flatpak
|
||||||
if command -v flatpak > /dev/null; then
|
if command -v flatpak > /dev/null; then
|
||||||
FLATPAK_INSTALLATIONS="$(flatpak --installations)"
|
FLATPAK_INSTALLATIONS="$(flatpak --installations)"
|
||||||
export PATH="$FLATPAK_INSTALLATIONS/exports/bin:$PATH"
|
export PATH="$FLATPAK_INSTALLATIONS/exports/bin:$PATH"
|
||||||
export XDG_DATA_DIRS="$HOME/.local/share/flatpak/exports/share:$FLATPAK_INSTALLATIONS/exports/share:$XDG_DATA_DIRS"
|
export XDG_DATA_DIRS="${XDG_CONFIG_HOME:-$HOME/.local/share}/flatpak/exports/share:$FLATPAK_INSTALLATIONS/exports/share:$XDG_DATA_DIRS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### fzf
|
### fzf
|
||||||
|
@ -216,12 +216,12 @@ export GIT_MERGE_AUTOEDIT=no
|
||||||
if command -v delta > /dev/null; then
|
if command -v delta > /dev/null; then
|
||||||
export GF_BAT_STYLE=changes
|
export GF_BAT_STYLE=changes
|
||||||
export GF_BAT_THEME=zenbur
|
export GF_BAT_THEME=zenbur
|
||||||
export GF_SNAPSHOT_DIRECTORY="$XDG_DATA_HOME/git-fuzzy-snapshots"
|
export GF_SNAPSHOT_DIRECTORY="${XDG_DATA_HOME:-$HOME/.local/share}/git-fuzzy-snapshots"
|
||||||
export GF_PREFERRED_PAGER="delta --theme=gruvbox --highlight-removed -w __WIDTH__"
|
export GF_PREFERRED_PAGER="delta --theme=gruvbox --highlight-removed -w __WIDTH__"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Go
|
### Go
|
||||||
export GOPATH="$XDG_DATA_HOME/go"
|
export GOPATH="${XDG_DATA_HOME:-$HOME/.local/share}/go"
|
||||||
export GO111MODULE=on
|
export GO111MODULE=on
|
||||||
export PATH="$PATH:${GOPATH}/bin"
|
export PATH="$PATH:${GOPATH}/bin"
|
||||||
if command -v go > /dev/null && which go | grep -q 'asdf' > /dev/null && command -v asdf > /dev/null; then
|
if command -v go > /dev/null && which go | grep -q 'asdf' > /dev/null && command -v asdf > /dev/null; then
|
||||||
|
@ -235,41 +235,41 @@ elif command -v go > /dev/null && command -v brew > /dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Gradle
|
### Gradle
|
||||||
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
|
export GRADLE_USER_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/gradle"
|
||||||
|
|
||||||
### Hishtory
|
### Hishtory
|
||||||
export HISHTORY_PATH="$XDG_CONFIG_HOME/hishtory"
|
export HISHTORY_PATH="${XDG_CONFIG_HOME:-$HOME/.config}/hishtory"
|
||||||
export HSTR_CONFIG=hicolor
|
export HSTR_CONFIG=hicolor
|
||||||
export HSTR_TIOCSTI=y
|
export HSTR_TIOCSTI=y
|
||||||
|
|
||||||
### Homebrew
|
### Homebrew
|
||||||
export HOMEBREW_BUNDLE_FILE="$XDG_CONFIG_HOME/Brewfile"
|
export HOMEBREW_BUNDLE_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/Brewfile"
|
||||||
export HOMEBREW_CASK_OPTS="--appdir=/Applications --display-times"
|
export HOMEBREW_CASK_OPTS="--appdir=/Applications --display-times"
|
||||||
|
|
||||||
### HTTPie
|
### HTTPie
|
||||||
export HTTPIE_CONFIG_DIR="$XDG_CONFIG_HOME/httpie"
|
export HTTPIE_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/httpie"
|
||||||
|
|
||||||
### IPFS
|
### IPFS
|
||||||
export IPFS_PATH="$XDG_DATA_HOME/ipfs"
|
export IPFS_PATH="${XDG_DATA_HOME:-$HOME/.local/share}/ipfs"
|
||||||
|
|
||||||
### k9s
|
### k9s
|
||||||
export K9SCONFIG="$XDG_CONFIG_HOME/k9s"
|
export K9SCONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/k9s"
|
||||||
|
|
||||||
### KDE
|
### KDE
|
||||||
export KDEHOME="$XDG_CONFIG_HOME/kde"
|
export KDEHOME="${XDG_CONFIG_HOME:-$HOME/.config}/kde"
|
||||||
|
|
||||||
### Kodi
|
### Kodi
|
||||||
export KODI_DATA="$XDG_DATA_HOME/kodi"
|
export KODI_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/kodi"
|
||||||
|
|
||||||
### Krew
|
### Krew
|
||||||
export KREW_ROOT="$XDG_DATA_HOME/krew"
|
export KREW_ROOT="${XDG_DATA_HOME:-$HOME/.local/share}/krew"
|
||||||
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||||
|
|
||||||
### Kube
|
### Kube
|
||||||
export KUBECONFIG="$XDG_CONFIG_HOME/kube/config"
|
export KUBECONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/kube/config"
|
||||||
|
|
||||||
### Maven
|
### Maven
|
||||||
export MAVEN_CONFIG="$XDG_CONFIG_HOME/maven/settings.xml"
|
export MAVEN_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/maven/settings.xml"
|
||||||
alias mvn="mvn -s $MAVEN_CONFIG"
|
alias mvn="mvn -s $MAVEN_CONFIG"
|
||||||
|
|
||||||
### McFly
|
### McFly
|
||||||
|
@ -278,7 +278,7 @@ export MCFLY_RESULTS=14
|
||||||
export MCFLY_KEY_SCHEME=vim
|
export MCFLY_KEY_SCHEME=vim
|
||||||
|
|
||||||
### minikube
|
### minikube
|
||||||
export MINIKUBE_HOME="$XDG_DATA_HOME/minikube"
|
export MINIKUBE_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/minikube"
|
||||||
|
|
||||||
### Monero
|
### Monero
|
||||||
if [ -f /Applications/monero-wallet-gui.app/Contents/MacOS/monerod ]; then
|
if [ -f /Applications/monero-wallet-gui.app/Contents/MacOS/monerod ]; then
|
||||||
|
@ -286,13 +286,13 @@ if [ -f /Applications/monero-wallet-gui.app/Contents/MacOS/monerod ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### MySQL
|
### MySQL
|
||||||
export MYSQL_HISTFILE="$XDG_DATA_HOME/mysql_history"
|
export MYSQL_HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/mysql_history"
|
||||||
|
|
||||||
### .netrc
|
### .netrc
|
||||||
export NETRC="$XDG_CONFIG_HOME/netrc"
|
export NETRC="${XDG_CONFIG_HOME:-$HOME/.config}/netrc"
|
||||||
|
|
||||||
### Navi
|
### Navi
|
||||||
export NAVI_CONFIG="$XDG_CONFIG_HOME/navi/config.yaml"
|
export NAVI_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/navi/config.yaml"
|
||||||
|
|
||||||
### Nix
|
### Nix
|
||||||
export NIX_SSL_CERT_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.crt"
|
export NIX_SSL_CERT_FILE="${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.crt"
|
||||||
|
@ -307,45 +307,45 @@ if command -v nnn > /dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Node.js
|
### Node.js
|
||||||
export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
|
export NODE_REPL_HISTORY="${XDG_DATA_HOME:-$HOME/.local/share}/node_repl_history"
|
||||||
if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.pem" ]; then
|
if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.pem" ]; then
|
||||||
export NODE_EXTRA_CA_CERTS="${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.pem"
|
export NODE_EXTRA_CA_CERTS="${XDG_DATA_HOME:-$HOME/.local/share}/warp/Cloudflare_CA.pem"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### NPM
|
### NPM
|
||||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
|
export NPM_CONFIG_USERCONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/npm/npmrc"
|
||||||
|
|
||||||
### NTL
|
### NTL
|
||||||
export NTL_RUNNER="pnpm"
|
export NTL_RUNNER="pnpm"
|
||||||
export NTL_RERUN_CACHE_DIR="$XDG_DATA_HOME/ntl"
|
export NTL_RERUN_CACHE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/ntl"
|
||||||
export NTL_RERUN_CACHE_NAME="cache"
|
export NTL_RERUN_CACHE_NAME="cache"
|
||||||
export NTL_RERUN_CACHE_MAX="100"
|
export NTL_RERUN_CACHE_MAX="100"
|
||||||
|
|
||||||
### NuGet
|
### NuGet
|
||||||
export NUGET_PACKAGES="$XDG_DATA_HOME/nuget"
|
export NUGET_PACKAGES="${XDG_DATA_HOME:-$HOME/.local/share}/nuget"
|
||||||
|
|
||||||
### Parallels
|
### Parallels
|
||||||
export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel"
|
export PARALLEL_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/parallel"
|
||||||
|
|
||||||
### Pass
|
### Pass
|
||||||
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
|
export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/pass"
|
||||||
|
|
||||||
### Poetry
|
### Poetry
|
||||||
export POETRY_HOME="$XDG_DATA_HOME/poetry"
|
export POETRY_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/poetry"
|
||||||
export PATH="$POETRY_HOME/bin:$PATH"
|
export PATH="$POETRY_HOME/bin:$PATH"
|
||||||
|
|
||||||
### Porter
|
### Porter
|
||||||
export PORTER_HOME="$XDG_DATA_HOME/porter"
|
export PORTER_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/porter"
|
||||||
export PATH="$PATH:$PORTER_HOME"
|
export PATH="$PATH:$PORTER_HOME"
|
||||||
|
|
||||||
### Postgres
|
### Postgres
|
||||||
export PSQLRC="$XDG_CONFIG_HOME/pg/psqlrc"
|
export PSQLRC="${XDG_CONFIG_HOME:-$HOME/.config}/pg/psqlrc"
|
||||||
export PSQL_HISTORY="$XDG_STATE_HOME/psql_history"
|
export PSQL_HISTORY="$XDG_STATE_HOME/psql_history"
|
||||||
export PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass"
|
export PGPASSFILE="${XDG_CONFIG_HOME:-$HOME/.config}/pg/pgpass"
|
||||||
export PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf"
|
export PGSERVICEFILE="${XDG_CONFIG_HOME:-$HOME/.config}/pg/pg_service.conf"
|
||||||
|
|
||||||
### PNPM
|
### PNPM
|
||||||
export PNPM_HOME="$XDG_DATA_HOME/pnpm"
|
export PNPM_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/pnpm"
|
||||||
export PATH="$PATH:$PNPM_HOME"
|
export PATH="$PATH:$PNPM_HOME"
|
||||||
|
|
||||||
### Prettierd
|
### Prettierd
|
||||||
|
@ -360,29 +360,29 @@ if command -v python3 > /dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Readline
|
### Readline
|
||||||
export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc"
|
export INPUTRC="${XDG_CONFIG_HOME:-$HOME/.config}/readline/inputrc"
|
||||||
|
|
||||||
### Redis
|
### Redis
|
||||||
export REDISCLI_HISTFILE="$XDG_DATA_HOME/redis/rediscli_history"
|
export REDISCLI_HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/redis/rediscli_history"
|
||||||
export REDISCLI_RCFILE="$XDG_CONFIG_HOME/redis/redisclirc"
|
export REDISCLI_RCFILE="${XDG_CONFIG_HOME:-$HOME/.config}/redis/redisclirc"
|
||||||
|
|
||||||
### ripgrep
|
### ripgrep
|
||||||
export RIPGREP_CONFIG_PATH="$XDG_CONFIG_HOME/ripgrep/config"
|
export RIPGREP_CONFIG_PATH="${XDG_CONFIG_HOME:-$HOME/.config}/ripgrep/config"
|
||||||
|
|
||||||
### Ruby
|
### Ruby
|
||||||
# Add Homebrew Ruby install location to PATH (for macOS and tools that require a more recent version than the bundled system version)
|
# Add Homebrew Ruby install location to PATH (for macOS and tools that require a more recent version than the bundled system version)
|
||||||
export PATH="/usr/local/opt/ruby/bin:$PATH"
|
export PATH="/usr/local/opt/ruby/bin:$PATH"
|
||||||
export GEM_HOME="$XDG_DATA_HOME/gems"
|
export GEM_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/gems"
|
||||||
export PATH="$PATH:$GEM_HOME/bin"
|
export PATH="$PATH:$GEM_HOME/bin"
|
||||||
|
|
||||||
### Rustup
|
### Rustup
|
||||||
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
export RUSTUP_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/rustup"
|
||||||
|
|
||||||
### SDKMan
|
### SDKMan
|
||||||
export SDKMAN_DIR="$XDG_DATA_HOME/sdkman"
|
export SDKMAN_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/sdkman"
|
||||||
|
|
||||||
### Steampipe
|
### Steampipe
|
||||||
export STEAMPIPE_INSTALL_DIR="$XDG_DATA_HOME/steampipe"
|
export STEAMPIPE_INSTALL_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/steampipe"
|
||||||
export STEAMPIPE_TELEMETRY=none
|
export STEAMPIPE_TELEMETRY=none
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
@ -391,16 +391,16 @@ if [ -d "$HOME/.local/bin/update/bin" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Vagrant
|
### Vagrant
|
||||||
export VAGRANT_ALIAS_FILE="$XDG_CONFIG_HOME/vagrant/aliases"
|
export VAGRANT_ALIAS_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/vagrant/aliases"
|
||||||
export VAGRANT_DEFAULT_PROVIDER=virtualbox
|
export VAGRANT_DEFAULT_PROVIDER=virtualbox
|
||||||
export VAGRANT_HOME="$XDG_DATA_HOME/vagrant.d"
|
export VAGRANT_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/vagrant.d"
|
||||||
|
|
||||||
### Volta
|
### Volta
|
||||||
export VOLTA_HOME="$XDG_DATA_HOME/volta"
|
export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta"
|
||||||
export PATH="$VOLTA_HOME/bin:$PATH"
|
export PATH="$VOLTA_HOME/bin:$PATH"
|
||||||
|
|
||||||
### Wakatime
|
### Wakatime
|
||||||
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
|
export WAKATIME_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/wakatime"
|
||||||
export WAKATIME_API_KEY="{{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "WAKATIME_API_KEY")) }}{{ includeTemplate "secrets/VAGRANT_CLOUD_TOKEN" | decrypt | trim }}{{ else }}{{ env "WAKATIME_API_KEY" }}{{ end }}"
|
export WAKATIME_API_KEY="{{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "WAKATIME_API_KEY")) }}{{ includeTemplate "secrets/VAGRANT_CLOUD_TOKEN" | decrypt | trim }}{{ else }}{{ env "WAKATIME_API_KEY" }}{{ end }}"
|
||||||
|
|
||||||
### Wazuh
|
### Wazuh
|
||||||
|
@ -412,21 +412,21 @@ elif [ -d /var/ossec/bin ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Wego Weather CLI
|
### Wego Weather CLI
|
||||||
export WEGORC="$XDG_CONFIG_HOME/wego/wegorc"
|
export WEGORC="${XDG_CONFIG_HOME:-$HOME/.config}/wego/wegorc"
|
||||||
|
|
||||||
### wget
|
### wget
|
||||||
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
|
export WGETRC="${XDG_CONFIG_HOME:-$HOME/.config}/wget/wgetrc"
|
||||||
|
|
||||||
### Whalebrew
|
### Whalebrew
|
||||||
export WHALEBREW_CONFIG_DIR="$XDG_CONFIG_HOME/whalebrew"
|
export WHALEBREW_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/whalebrew"
|
||||||
|
|
||||||
### .zsh_sessions
|
### .zsh_sessions
|
||||||
# Source: https://apple.stackexchange.com/questions/427561/macos-zsh-sessions-zsh-history-and-setopt-append-history
|
# Source: https://apple.stackexchange.com/questions/427561/macos-zsh-sessions-zsh-history-and-setopt-append-history
|
||||||
export SHELL_SESSIONS_DISABLE=1
|
export SHELL_SESSIONS_DISABLE=1
|
||||||
|
|
||||||
### CloudFlare Wrangler
|
### CloudFlare Wrangler
|
||||||
export WRANGLER_INSTALL_PATH="$XDG_DATA_HOME/wrangler"
|
export WRANGLER_INSTALL_PATH="${XDG_DATA_HOME:-$HOME/.local/share}/wrangler"
|
||||||
export WRANGLER_HOME="$XDG_DATA_HOME/wrangler"
|
export WRANGLER_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/wrangler"
|
||||||
|
|
||||||
### Man pages
|
### Man pages
|
||||||
export LESS_TERMCAP_mb=$'\e[1;32m'
|
export LESS_TERMCAP_mb=$'\e[1;32m'
|
||||||
|
|
5
home/dot_config/shell/iterm/iterm2.bash.tmpl
Normal file
5
home/dot_config/shell/iterm/iterm2.bash.tmpl
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{{- if stat (joinPath .chezmoi.homeDir "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.bash") -}}
|
||||||
|
{{- joinPath .chezmoi.homeDir "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.bash" -}}
|
||||||
|
{{- elif stat (joinPath "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.bash") -}}
|
||||||
|
{{- joinPath "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.bash" -}}
|
||||||
|
{{- end -}}
|
5
home/dot_config/shell/iterm/iterm2.fish.tmpl
Normal file
5
home/dot_config/shell/iterm/iterm2.fish.tmpl
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{{- if stat (joinPath .chezmoi.homeDir "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.fish") -}}
|
||||||
|
{{- joinPath .chezmoi.homeDir "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.fish" -}}
|
||||||
|
{{- elif stat (joinPath "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.fish") -}}
|
||||||
|
{{- joinPath "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.fish" -}}
|
||||||
|
{{- end -}}
|
5
home/dot_config/shell/iterm/iterm2.tcsh.tmpl
Normal file
5
home/dot_config/shell/iterm/iterm2.tcsh.tmpl
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{{- if stat (joinPath .chezmoi.homeDir "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.tcsh") -}}
|
||||||
|
{{- joinPath .chezmoi.homeDir "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.tcsh" -}}
|
||||||
|
{{- elif stat (joinPath "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.tcsh") -}}
|
||||||
|
{{- joinPath "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.tcsh" -}}
|
||||||
|
{{- end -}}
|
5
home/dot_config/shell/iterm/iterm2.zsh.tmpl
Normal file
5
home/dot_config/shell/iterm/iterm2.zsh.tmpl
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{{- if stat (joinPath .chezmoi.homeDir "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.zsh") -}}
|
||||||
|
{{- joinPath .chezmoi.homeDir "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.zsh" -}}
|
||||||
|
{{- elif stat (joinPath "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.zsh") -}}
|
||||||
|
{{- joinPath "Applications" "iTerm.app" "Contents" "Resources" "iterm2_shell_integration.zsh" -}}
|
||||||
|
{{- end -}}
|
|
@ -19,7 +19,7 @@ export ATUIN_USERNAME="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplat
|
||||||
### Google Cloud SDK
|
### Google Cloud SDK
|
||||||
export CLOUDSDK_CORE_PROJECT="{{ .user.gcloud.coreProject }}"
|
export CLOUDSDK_CORE_PROJECT="{{ .user.gcloud.coreProject }}"
|
||||||
export GCE_SERVICE_ACCOUNT_EMAIL="{{ .user.gcloud.email }}"
|
export GCE_SERVICE_ACCOUNT_EMAIL="{{ .user.gcloud.email }}"
|
||||||
export GCE_CREDENTIALS_FILE="$HOME/.config/gcloud/gcp.json"
|
export GCE_CREDENTIALS_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/gcloud/gcp.json"
|
||||||
|
|
||||||
### CloudFlare
|
### CloudFlare
|
||||||
# Source: https://github.com/cloudflare/cf-terraforming
|
# Source: https://github.com/cloudflare/cf-terraforming
|
||||||
|
|
|
@ -8,16 +8,10 @@
|
||||||
# shellcheck disable=SC1090,SC1091
|
# shellcheck disable=SC1090,SC1091
|
||||||
|
|
||||||
# Aliases / Functions / Exports
|
# Aliases / Functions / Exports
|
||||||
export XDG_CONFIG_HOME="$HOME/.config"
|
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
if [ -f "$XDG_CONFIG_HOME/shell/exports.sh" ]; then
|
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/exports.sh" ] || . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/exports.sh"
|
||||||
. "$XDG_CONFIG_HOME/shell/exports.sh"
|
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliases.sh" ] || . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliases.sh"
|
||||||
fi
|
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functions.sh" ] || . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/functions.sh"
|
||||||
if [ -f "$XDG_CONFIG_HOME/shell/aliases.sh" ]; then
|
|
||||||
. "$XDG_CONFIG_HOME/shell/aliases.sh"
|
|
||||||
fi
|
|
||||||
if [ -f "$XDG_CONFIG_HOME/shell/functions.sh" ]; then
|
|
||||||
. "$XDG_CONFIG_HOME/shell/functions.sh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### Bash / ZSH
|
### Bash / ZSH
|
||||||
if [ "$BASH_SUPPORT" = 'true' ]; then
|
if [ "$BASH_SUPPORT" = 'true' ]; then
|
||||||
|
@ -81,8 +75,8 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Directory Colors
|
### Directory Colors
|
||||||
if [ -f "$XDG_CONFIG_HOME/shell/lscolors.sh" ]; then
|
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/lscolors.sh" ]; then
|
||||||
. "$XDG_CONFIG_HOME/shell/lscolors.sh"
|
. "${XDG_CONFIG_HOME:-$HOME/.config}/shell/lscolors.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### fzf-git
|
### fzf-git
|
||||||
|
@ -91,13 +85,13 @@ if [ "$BASH_SUPPORT" = 'true' ]; then
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
### git-fuzzy
|
### git-fuzzy
|
||||||
if [ -d "$XDG_DATA_HOME/git-fuzzy/bin" ]; then
|
if [ -d "${XDG_DATA_HOME:-$HOME/.local/share}/git-fuzzy/bin" ]; then
|
||||||
export PATH="$XDG_DATA_HOME/git-fuzzy/bin:$PATH"
|
export PATH="${XDG_DATA_HOME:-$HOME/.local/share}/git-fuzzy/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### MOTD
|
### MOTD
|
||||||
if [ -f "$XDG_CONFIG_HOME/shell/motd.sh" ]; then
|
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/motd.sh" ]; then
|
||||||
. "$XDG_CONFIG_HOME/shell/motd.sh"
|
. "${XDG_CONFIG_HOME:-$HOME/.config}/shell/motd.sh"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,12 @@ tasks:
|
||||||
echo "> Copying Password"
|
echo "> Copying Password"
|
||||||
### Copy the password to the clipboard
|
### Copy the password to the clipboard
|
||||||
printf '%s' "$(echo "$selected" | jq -r '.login.password')" | $COPY
|
printf '%s' "$(echo "$selected" | jq -r '.login.password')" | $COPY
|
||||||
|
|
||||||
|
build:packer:
|
||||||
|
desc: Builds Packer boxes using all supported virtualization platform / operating system combinations
|
||||||
|
summary: |
|
||||||
|
# {{ .AppName}} Packer Build
|
||||||
|
|
||||||
build:packer:
|
build:packer:
|
||||||
desc: Builds Packer boxes using all supported virtualization platform / operating system combinations
|
desc: Builds Packer boxes using all supported virtualization platform / operating system combinations
|
||||||
summary: |
|
summary: |
|
||||||
|
@ -72,7 +77,7 @@ tasks:
|
||||||
Qubes can leverage the assets generated from the VirtualBox builds to power HVMs.
|
Qubes can leverage the assets generated from the VirtualBox builds to power HVMs.
|
||||||
cmds:
|
cmds:
|
||||||
- |
|
- |
|
||||||
cd "$HOME/.local/share/bento"
|
cd "${XDG_DATA_HOME:-$HOME/.local/share}/bento"
|
||||||
packer init -upgrade ./packer_templates
|
packer init -upgrade ./packer_templates
|
||||||
logg info 'Building Ubuntu VirtualBox VMs'
|
logg info 'Building Ubuntu VirtualBox VMs'
|
||||||
packer build -var-file=os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl ./packer_templates
|
packer build -var-file=os_pkrvars/ubuntu/ubuntu-22.04-x86_64.pkrvars.hcl ./packer_templates
|
||||||
|
@ -441,11 +446,11 @@ tasks:
|
||||||
if [ -d "$HOME/.local/mnt/s3" ]; then
|
if [ -d "$HOME/.local/mnt/s3" ]; then
|
||||||
if command -v rclone > /dev/null && command -v restic > /dev/null; then
|
if command -v rclone > /dev/null && command -v restic > /dev/null; then
|
||||||
logg info '{{ .AppName }} profile folder exists and user S3 mount exists. Backing the profile up to user S3 bucket via Restic.'
|
logg info '{{ .AppName }} profile folder exists and user S3 mount exists. Backing the profile up to user S3 bucket via Restic.'
|
||||||
if ([ -z "$(restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "$HOME/.config/age/chezmoi.txt" cat config)" ]) 2>/dev/null; then
|
if ([ -z "$(restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "${XDG_CONFIG_HOME:-$HOME/.config}/age/chezmoi.txt" cat config)" ]) 2>/dev/null; then
|
||||||
logg info 'Initializing {{ .AppName }} Restic repository'
|
logg info 'Initializing {{ .AppName }} Restic repository'
|
||||||
restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "$HOME/.config/age/chezmoi.txt" init
|
restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "${XDG_CONFIG_HOME:-$HOME/.config}/age/chezmoi.txt" init
|
||||||
fi
|
fi
|
||||||
restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "$HOME/.config/age/chezmoi.txt" --verbose backup --tag "{{ .ProfileFolder }}" --tag {{ OS }} --tag "$HOST" "{{ .ProfileFolder }}"
|
restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "${XDG_CONFIG_HOME:-$HOME/.config}/age/chezmoi.txt" --verbose backup --tag "{{ .ProfileFolder }}" --tag {{ OS }} --tag "$HOST" "{{ .ProfileFolder }}"
|
||||||
else
|
else
|
||||||
logg error 'Both `rclone` and `restic` must be available' && exit 1
|
logg error 'Both `rclone` and `restic` must be available' && exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -462,10 +467,10 @@ tasks:
|
||||||
if [ -d '{{ .AppFolder }}' ]; then
|
if [ -d '{{ .AppFolder }}' ]; then
|
||||||
if [ -d "$HOME/.local/mnt/s3" ]; then
|
if [ -d "$HOME/.local/mnt/s3" ]; then
|
||||||
if command -v rclone > /dev/null && command -v restic > /dev/null; then
|
if command -v rclone > /dev/null && command -v restic > /dev/null; then
|
||||||
if ([ -z "$(restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "$HOME/.config/age/chezmoi.txt" cat config)" ]) 2>/dev/null; then
|
if ([ -z "$(restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "${XDG_CONFIG_HOME:-$HOME/.config}/age/chezmoi.txt" cat config)" ]) 2>/dev/null; then
|
||||||
logg warn 'The {{ .AppName }} Rclone repository has not been initialized. Skipping.'
|
logg warn 'The {{ .AppName }} Rclone repository has not been initialized. Skipping.'
|
||||||
else
|
else
|
||||||
restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "$HOME/.config/age/chezmoi.txt" restore latest --target '{{ .ProfileFolder }}'
|
restic -r "rclone:$USER-s3:user/{{ .RcloneRepository }}" --password-file "${XDG_CONFIG_HOME:-$HOME/.config}/age/chezmoi.txt" restore latest --target '{{ .ProfileFolder }}'
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
logg error 'Both `rclone` and `restic` must be available' && exit 1
|
logg error 'Both `rclone` and `restic` must be available' && exit 1
|
||||||
|
|
|
@ -339,7 +339,7 @@ autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||||
" Install Coc extensions
|
" Install Coc extensions
|
||||||
" TODO: Add https://github.com/yuki-yano/fzf-preview.vim
|
" TODO: Add https://github.com/yuki-yano/fzf-preview.vim
|
||||||
" TODO: Add https://github.com/tpope/vim-fugitive
|
" TODO: Add https://github.com/tpope/vim-fugitive
|
||||||
let g:coc_global_config="$HOME/.config/coc/coc-settings.json"
|
let g:coc_global_config="${XDG_CONFIG_HOME:-$HOME/.config}/coc/coc-settings.json"
|
||||||
let g:coc_global_extensions = [
|
let g:coc_global_extensions = [
|
||||||
\'@yaegassy/coc-ansible',
|
\'@yaegassy/coc-ansible',
|
||||||
\'@yaegassy/coc-nginx',
|
\'@yaegassy/coc-nginx',
|
||||||
|
|
|
@ -5,17 +5,17 @@
|
||||||
{{ includeTemplate "universal/logg" }}
|
{{ includeTemplate "universal/logg" }}
|
||||||
|
|
||||||
### Create backups
|
### Create backups
|
||||||
if [ -d "$XDG_CONFIG_HOME/dconf/settings" ]; then
|
if [ -d "${XDG_CONFIG_HOME:-$HOME/.config}/dconf/settings" ]; then
|
||||||
DCONF_TMP="$(mktemp)"
|
DCONF_TMP="$(mktemp)"
|
||||||
logg info 'Moving ~/.config/dconf/settings to '"$DCONF_TMP"
|
logg info 'Moving ~/.config/dconf/settings to '"$DCONF_TMP"
|
||||||
cp -rf "$XDG_CONFIG_HOME/dconf/settings" "$DCONF_TMP"
|
cp -rf "${XDG_CONFIG_HOME:-$HOME/.config}/dconf/settings" "$DCONF_TMP"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Ensure ~/.config/dconf/settings exists
|
### Ensure ~/.config/dconf/settings exists
|
||||||
mkdir -p "$XDG_CONFIG_HOME/dconf/settings"
|
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/dconf/settings"
|
||||||
|
|
||||||
### Overwrite ~/.config/dconf/settings configurations so we can diff with Chezmoi
|
### Overwrite ~/.config/dconf/settings configurations so we can diff with Chezmoi
|
||||||
find "$XDG_CONFIG_HOME/dconf/settings" -mindepth 1 -maxdepth 1 -type f | while read DCONF_CONFIG_FILE; do
|
find "${XDG_CONFIG_HOME:-$HOME/.config}/dconf/settings" -mindepth 1 -maxdepth 1 -type f | while read DCONF_CONFIG_FILE; do
|
||||||
DCONF_SETTINGS_ID="/$(basename "$DCONF_CONFIG_FILE" | sed 's/\./\//g')/"
|
DCONF_SETTINGS_ID="/$(basename "$DCONF_CONFIG_FILE" | sed 's/\./\//g')/"
|
||||||
logg info 'Dumping `'"$DCONF_SETTINGS_ID"'` to '"$DCONF_CONFIG_FILE"
|
logg info 'Dumping `'"$DCONF_SETTINGS_ID"'` to '"$DCONF_CONFIG_FILE"
|
||||||
dconf dump "$DCONF_SETTINGS_ID" > "$DCONF_CONFIG_FILE"
|
dconf dump "$DCONF_SETTINGS_ID" > "$DCONF_CONFIG_FILE"
|
||||||
|
|
|
@ -859,8 +859,8 @@ async function ensurePackageManagerAnsible() {
|
||||||
await $`pipx inject ansible-core PyObjC PyObjC-core`
|
await $`pipx inject ansible-core PyObjC PyObjC-core`
|
||||||
}
|
}
|
||||||
await $`pipx inject ansible-core docker lxml netaddr pexpect python-vagrant pywinrm requests-credssp watchdog`
|
await $`pipx inject ansible-core docker lxml netaddr pexpect python-vagrant pywinrm requests-credssp watchdog`
|
||||||
await $`mkdir -p "$HOME/.cache/megabyte-labs"`
|
await $`mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte-labs"`
|
||||||
await $`touch "$HOME/.cache/megabyte-labs/ansible-installed"`
|
await $`touch "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte-labs/ansible-installed"`
|
||||||
log('info', 'Package Manager Install', `Ansible and its supporting packages are now installed via pipx`)
|
log('info', 'Package Manager Install', `Ansible and its supporting packages are now installed via pipx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -896,7 +896,7 @@ async function ensurePackageManager(packageManager) {
|
||||||
}
|
}
|
||||||
} else if (packageManager === 'ansible') {
|
} else if (packageManager === 'ansible') {
|
||||||
try {
|
try {
|
||||||
await $`test -f "$HOME/.cache/megabyte-labs/ansible-installed"`
|
await $`test -f "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte-labs/ansible-installed"`
|
||||||
const ansible = which.sync('ansible', { nothrow: true })
|
const ansible = which.sync('ansible', { nothrow: true })
|
||||||
if (ansible) {
|
if (ansible) {
|
||||||
log('info', logStage, `\`ansible\` and its supporting packages appear to be installed`)
|
log('info', logStage, `\`ansible\` and its supporting packages appear to be installed`)
|
||||||
|
@ -1541,7 +1541,7 @@ async function addUserGroup(group) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the rules specified in the `_ports` key of each entry in the `software.yml` file.
|
* Adds the rules specified in the `_ports` key of each entry in the `software.yml` file.
|
||||||
*
|
*
|
||||||
* @param rule {packageKey: string, ports: any} Firewall rule in the form of 8888/tcp or 9999/udp. Can also be the XML file name stored in ~/.config/firewall/etc/firewalld/services.
|
* @param rule {packageKey: string, ports: any} Firewall rule in the form of 8888/tcp or 9999/udp. Can also be the XML file name stored in ~/.config/firewall/etc/firewalld/services.
|
||||||
*/
|
*/
|
||||||
async function addFirewallRule(rule) {
|
async function addFirewallRule(rule) {
|
||||||
|
@ -1583,7 +1583,7 @@ async function addFirewallRule(rule) {
|
||||||
if (fileExists(serviceFile)) {
|
if (fileExists(serviceFile)) {
|
||||||
runCommand(`Executing the matching ${serviceFile} service file`, `sudo bash "${serviceFile}"`)
|
runCommand(`Executing the matching ${serviceFile} service file`, `sudo bash "${serviceFile}"`)
|
||||||
} else {
|
} else {
|
||||||
if (typeof rule.ports === 'string') {
|
if (typeof rule.ports === 'string') {
|
||||||
log('error', logStage, `_ports rules that are equal to strings are not yet implemented on macOS (package: ${rule.packageKey})`)
|
log('error', logStage, `_ports rules that are equal to strings are not yet implemented on macOS (package: ${rule.packageKey})`)
|
||||||
} else {
|
} else {
|
||||||
for (const port of rule.ports) {
|
for (const port of rule.ports) {
|
||||||
|
|
|
@ -832,7 +832,7 @@ appy_tilixschemes() {
|
||||||
# so we have to update color palette for the current profile in order to switch to the new theme
|
# so we have to update color palette for the current profile in order to switch to the new theme
|
||||||
# but only set the palette on the last loop to avoid a flashing terminal
|
# but only set the palette on the last loop to avoid a flashing terminal
|
||||||
if ((LOOP == OPTLENGTH)); then
|
if ((LOOP == OPTLENGTH)); then
|
||||||
cp -f ${scratchdir}/* "$HOME/.config/tilix/schemes/"
|
cp -f ${scratchdir}/* "${XDG_CONFIG_HOME:-$HOME/.config}/tilix/schemes/"
|
||||||
rm -rf "${scratchdir}"
|
rm -rf "${scratchdir}"
|
||||||
read -r -p "All done - apply new theme? [y/N] " -n 1 TILIX_RES
|
read -r -p "All done - apply new theme? [y/N] " -n 1 TILIX_RES
|
||||||
if [[ ${TILIX_RES::1} =~ ^(y|Y)$ ]]; then
|
if [[ ${TILIX_RES::1} =~ ^(y|Y)$ ]]; then
|
||||||
|
|
|
@ -379,8 +379,8 @@ else
|
||||||
sudo sed -i '/# TEMPORARY FOR INSTALL DOCTOR/d' /etc/sudoers || logg warn 'Failed to remove passwordless sudo from the /etc/sudoers file'
|
sudo sed -i '/# TEMPORARY FOR INSTALL DOCTOR/d' /etc/sudoers || logg warn 'Failed to remove passwordless sudo from the /etc/sudoers file'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# @description Render the `docs/POST-INSTALL.md` file to the terminal at the end of the provisioning process
|
# @description Render the `docs/terminal/post-install.md` file to the terminal at the end of the provisioning process
|
||||||
logg success 'Provisioning complete!'
|
logg success 'Provisioning complete!'
|
||||||
if command -v glow > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/POST-INSTALL.md" ]; then
|
if command -v glow > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/terminal/post-install.md" ]; then
|
||||||
glow "$HOME/.local/share/chezmoi/docs/POST-INSTALL.md"
|
glow "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/terminal/post-install.md"
|
||||||
fi
|
fi
|
|
@ -18,8 +18,8 @@
|
||||||
{{ includeTemplate "universal/logg" }}
|
{{ includeTemplate "universal/logg" }}
|
||||||
|
|
||||||
### Create symlinks pointing to stored configurations
|
### Create symlinks pointing to stored configurations
|
||||||
ln -s "$HOME/.config/mackup/.mackup/" ~/.mackup
|
ln -s "${XDG_CONFIG_HOME:-$HOME/.config}/mackup/.mackup/" ~/.mackup
|
||||||
ln -s "$HOME/.config/mackup/.mackup.cfg" ~/.mackup.cfg
|
ln -s "${XDG_CONFIG_HOME:-$HOME/.config}/mackup/.mackup.cfg" ~/.mackup.cfg
|
||||||
|
|
||||||
### Run original mackup executable
|
### Run original mackup executable
|
||||||
if command -v brew > /dev/null && brew list | grep mackup > /dev/null; then
|
if command -v brew > /dev/null && brew list | grep mackup > /dev/null; then
|
||||||
|
|
39
home/dot_local/bin/profile-inline
Normal file
39
home/dot_local/bin/profile-inline
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
### Source .bashrc if it is present
|
||||||
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
|
. "$HOME/.bashrc"
|
||||||
|
elif [ -f "$HOME/.config/shell/exports.sh" ]; then
|
||||||
|
. "$HOME/.config/shell/exports.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
### XDG
|
||||||
|
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
|
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||||
|
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
|
||||||
|
|
||||||
|
### Ensure Homebrew PATHs
|
||||||
|
if [ -d "/home/linuxbrew/.linuxbrew/bin" ]; then
|
||||||
|
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
|
||||||
|
export HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar"
|
||||||
|
export HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew"
|
||||||
|
export PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin${PATH+:$PATH}"
|
||||||
|
export MANPATH="/home/linuxbrew/.linuxbrew/share/man${MANPATH+:$MANPATH}:"
|
||||||
|
export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:${INFOPATH:-}"
|
||||||
|
export WHALEBREW_INSTALL_PATH="/home/linuxbrew/.linuxbrew/whalebrew"
|
||||||
|
elif [ -f "/usr/local/bin/brew" ]; then
|
||||||
|
eval "$(/usr/local/bin/brew shellenv)"
|
||||||
|
elif [ -f "/opt/homebrew/bin/brew" ]; then
|
||||||
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||||
|
fi
|
||||||
|
export HOMEBREW_NO_ANALYTICS=1
|
||||||
|
|
||||||
|
### SDKMan
|
||||||
|
export SDKMAN_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/sdkman"
|
||||||
|
|
||||||
|
### Volta
|
||||||
|
export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta"
|
||||||
|
export PATH="$VOLTA_HOME/bin:$PATH"
|
||||||
|
|
||||||
|
### Ensure ~/.local/bin in PATH
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
|
@ -1,15 +0,0 @@
|
||||||
[Appearance]
|
|
||||||
ColorScheme=Betelgeuse
|
|
||||||
|
|
||||||
[General]
|
|
||||||
Environment=TERM=xterm-256color,COLORTERM=truecolor
|
|
||||||
Name=Default
|
|
||||||
Parent=FALLBACK/
|
|
||||||
TerminalColumns=124
|
|
||||||
TerminalRows=35
|
|
||||||
|
|
||||||
[Scrolling]
|
|
||||||
HistoryMode=2
|
|
||||||
|
|
||||||
[Terminal Features]
|
|
||||||
UrlHintsModifiers=67108864
|
|
|
@ -1,650 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# The iTerm2 customizations fall under the following license:
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
|
|
||||||
# -- BEGIN ITERM2 CUSTOMIZATIONS --
|
|
||||||
if [[ "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != screen && "$ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX""$TERM" != tmux-256color && "$ITERM_SHELL_INTEGRATION_INSTALLED" = "" && "$-" == *i* && "$TERM" != linux && "$TERM" != dumb ]]; then
|
|
||||||
|
|
||||||
if shopt extdebug | grep on > /dev/null; then
|
|
||||||
echo "iTerm2 Shell Integration not installed."
|
|
||||||
echo ""
|
|
||||||
echo "Your shell has 'extdebug' turned on."
|
|
||||||
echo "This is incompatible with shell integration."
|
|
||||||
echo "Find 'shopt -s extdebug' in bash's rc scripts and remove it."
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
|
|
||||||
# Saved copy of your PS1. This is used to detect if the user changes PS1
|
|
||||||
# directly. ITERM_PREV_PS1 will hold the last value that this script set PS1 to
|
|
||||||
# (including various custom escape sequences).
|
|
||||||
ITERM_PREV_PS1="$PS1"
|
|
||||||
|
|
||||||
# A note on execution. When you invoke a command at an interactive prompt the following steps are taken:
|
|
||||||
#
|
|
||||||
# 1. The DEBUG trap runs.
|
|
||||||
# It calls __bp_preexec_invoke_exec
|
|
||||||
# It runs any registered preexec_functions, including __iterm2_preexec
|
|
||||||
# 2. The command you executed runs.
|
|
||||||
# 3. PROMPT_COMMAND runs.
|
|
||||||
# It runs __bp_precmd_invoke_cmd, which is inserted as the first command in PROMPT_COMMAND.
|
|
||||||
# It calls any registered precmd_functions
|
|
||||||
# Then, pre-existing PROMPT_COMMANDs run
|
|
||||||
# 4. The prompt is shown.
|
|
||||||
#
|
|
||||||
# __iterm2_prompt_command used to be run from precmd_functions but then a pre-existing
|
|
||||||
# PROMPT_COMMAND could clobber the PS1 it modifies. Instead, add __iterm2_prompt_command as the last
|
|
||||||
# of the "preexisting" PROMPT_COMMANDs so it will be the very last thing done before the prompt is
|
|
||||||
# shown (unless someone amends PROMPT_COMMAND, but that is on them).
|
|
||||||
if [[ -n "$PROMPT_COMMAND" ]]; then
|
|
||||||
PROMPT_COMMAND+=$'\n'
|
|
||||||
fi;
|
|
||||||
PROMPT_COMMAND+='__iterm2_prompt_command'
|
|
||||||
|
|
||||||
# The following chunk of code, bash-preexec.sh, is licensed like this:
|
|
||||||
# The MIT License
|
|
||||||
#
|
|
||||||
# Copyright (c) 2015 Ryan Caloras and contributors (see https://github.com/rcaloras/bash-preexec)
|
|
||||||
#
|
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
# of this software and associated documentation files (the "Software"), to deal
|
|
||||||
# in the Software without restriction, including without limitation the rights
|
|
||||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
# copies of the Software, and to permit persons to whom the Software is
|
|
||||||
# furnished to do so, subject to the following conditions:
|
|
||||||
#
|
|
||||||
# The above copyright notice and this permission notice shall be included in
|
|
||||||
# all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
# THE SOFTWARE.
|
|
||||||
|
|
||||||
# Wrap bash-preexec.sh in a function so that, if it exits early due to having
|
|
||||||
# been sourced elsewhere, it doesn't exit our entire script.
|
|
||||||
_install_bash_preexec () {
|
|
||||||
# -- END ITERM2 CUSTOMIZATIONS --
|
|
||||||
|
|
||||||
# -- BEGIN BASH-PREEXEC.SH --
|
|
||||||
# bash-preexec.sh -- Bash support for ZSH-like 'preexec' and 'precmd' functions.
|
|
||||||
# https://github.com/rcaloras/bash-preexec
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# 'preexec' functions are executed before each interactive command is
|
|
||||||
# executed, with the interactive command as its argument. The 'precmd'
|
|
||||||
# function is executed before each prompt is displayed.
|
|
||||||
#
|
|
||||||
# Author: Ryan Caloras (ryan@bashhub.com)
|
|
||||||
# Forked from Original Author: Glyph Lefkowitz
|
|
||||||
#
|
|
||||||
# V0.4.1
|
|
||||||
#
|
|
||||||
|
|
||||||
# General Usage:
|
|
||||||
#
|
|
||||||
# 1. Source this file at the end of your bash profile so as not to interfere
|
|
||||||
# with anything else that's using PROMPT_COMMAND.
|
|
||||||
#
|
|
||||||
# 2. Add any precmd or preexec functions by appending them to their arrays:
|
|
||||||
# e.g.
|
|
||||||
# precmd_functions+=(my_precmd_function)
|
|
||||||
# precmd_functions+=(some_other_precmd_function)
|
|
||||||
#
|
|
||||||
# preexec_functions+=(my_preexec_function)
|
|
||||||
#
|
|
||||||
# 3. Consider changing anything using the DEBUG trap or PROMPT_COMMAND
|
|
||||||
# to use preexec and precmd instead. Preexisting usages will be
|
|
||||||
# preserved, but doing so manually may be less surprising.
|
|
||||||
#
|
|
||||||
# Note: This module requires two Bash features which you must not otherwise be
|
|
||||||
# using: the "DEBUG" trap, and the "PROMPT_COMMAND" variable. If you override
|
|
||||||
# either of these after bash-preexec has been installed it will most likely break.
|
|
||||||
|
|
||||||
# Make sure this is bash that's running and return otherwise.
|
|
||||||
if [[ -z "${BASH_VERSION:-}" ]]; then
|
|
||||||
return 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Avoid duplicate inclusion
|
|
||||||
if [[ -n "${bash_preexec_imported:-}" ]]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
bash_preexec_imported="defined"
|
|
||||||
|
|
||||||
# WARNING: This variable is no longer used and should not be relied upon.
|
|
||||||
# Use ${bash_preexec_imported} instead.
|
|
||||||
__bp_imported="${bash_preexec_imported}"
|
|
||||||
|
|
||||||
# Should be available to each precmd and preexec
|
|
||||||
# functions, should they want it. $? and $_ are available as $? and $_, but
|
|
||||||
# $PIPESTATUS is available only in a copy, $BP_PIPESTATUS.
|
|
||||||
# TODO: Figure out how to restore PIPESTATUS before each precmd or preexec
|
|
||||||
# function.
|
|
||||||
__bp_last_ret_value="$?"
|
|
||||||
BP_PIPESTATUS=("${PIPESTATUS[@]}")
|
|
||||||
__bp_last_argument_prev_command="$_"
|
|
||||||
|
|
||||||
__bp_inside_precmd=0
|
|
||||||
__bp_inside_preexec=0
|
|
||||||
|
|
||||||
# Initial PROMPT_COMMAND string that is removed from PROMPT_COMMAND post __bp_install
|
|
||||||
__bp_install_string=$'__bp_trap_string="$(trap -p DEBUG)"\ntrap - DEBUG\n__bp_install'
|
|
||||||
|
|
||||||
# Fails if any of the given variables are readonly
|
|
||||||
# Reference https://stackoverflow.com/a/4441178
|
|
||||||
__bp_require_not_readonly() {
|
|
||||||
local var
|
|
||||||
for var; do
|
|
||||||
if ! ( unset "$var" 2> /dev/null ); then
|
|
||||||
echo "bash-preexec requires write access to ${var}" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Remove ignorespace and or replace ignoreboth from HISTCONTROL
|
|
||||||
# so we can accurately invoke preexec with a command from our
|
|
||||||
# history even if it starts with a space.
|
|
||||||
__bp_adjust_histcontrol() {
|
|
||||||
local histcontrol
|
|
||||||
histcontrol="${HISTCONTROL:-}"
|
|
||||||
histcontrol="${histcontrol//ignorespace}"
|
|
||||||
# Replace ignoreboth with ignoredups
|
|
||||||
if [[ "$histcontrol" == *"ignoreboth"* ]]; then
|
|
||||||
histcontrol="ignoredups:${histcontrol//ignoreboth}"
|
|
||||||
fi;
|
|
||||||
export HISTCONTROL="$histcontrol"
|
|
||||||
}
|
|
||||||
|
|
||||||
# This variable describes whether we are currently in "interactive mode";
|
|
||||||
# i.e. whether this shell has just executed a prompt and is waiting for user
|
|
||||||
# input. It documents whether the current command invoked by the trace hook is
|
|
||||||
# run interactively by the user; it's set immediately after the prompt hook,
|
|
||||||
# and unset as soon as the trace hook is run.
|
|
||||||
__bp_preexec_interactive_mode=""
|
|
||||||
|
|
||||||
# These arrays are used to add functions to be run before, or after, prompts.
|
|
||||||
declare -a precmd_functions
|
|
||||||
declare -a preexec_functions
|
|
||||||
|
|
||||||
# Trims leading and trailing whitespace from $2 and writes it to the variable
|
|
||||||
# name passed as $1
|
|
||||||
__bp_trim_whitespace() {
|
|
||||||
local var=${1:?} text=${2:-}
|
|
||||||
text="${text#"${text%%[![:space:]]*}"}" # remove leading whitespace characters
|
|
||||||
text="${text%"${text##*[![:space:]]}"}" # remove trailing whitespace characters
|
|
||||||
printf -v "$var" '%s' "$text"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Trims whitespace and removes any leading or trailing semicolons from $2 and
|
|
||||||
# writes the resulting string to the variable name passed as $1. Used for
|
|
||||||
# manipulating substrings in PROMPT_COMMAND
|
|
||||||
__bp_sanitize_string() {
|
|
||||||
local var=${1:?} text=${2:-} sanitized
|
|
||||||
__bp_trim_whitespace sanitized "$text"
|
|
||||||
sanitized=${sanitized%;}
|
|
||||||
sanitized=${sanitized#;}
|
|
||||||
__bp_trim_whitespace sanitized "$sanitized"
|
|
||||||
printf -v "$var" '%s' "$sanitized"
|
|
||||||
}
|
|
||||||
|
|
||||||
# This function is installed as part of the PROMPT_COMMAND;
|
|
||||||
# It sets a variable to indicate that the prompt was just displayed,
|
|
||||||
# to allow the DEBUG trap to know that the next command is likely interactive.
|
|
||||||
__bp_interactive_mode() {
|
|
||||||
__bp_preexec_interactive_mode="on";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# This function is installed as part of the PROMPT_COMMAND.
|
|
||||||
# It will invoke any functions defined in the precmd_functions array.
|
|
||||||
__bp_precmd_invoke_cmd() {
|
|
||||||
# Save the returned value from our last command, and from each process in
|
|
||||||
# its pipeline. Note: this MUST be the first thing done in this function.
|
|
||||||
__bp_last_ret_value="$?" BP_PIPESTATUS=("${PIPESTATUS[@]}")
|
|
||||||
|
|
||||||
# Don't invoke precmds if we are inside an execution of an "original
|
|
||||||
# prompt command" by another precmd execution loop. This avoids infinite
|
|
||||||
# recursion.
|
|
||||||
if (( __bp_inside_precmd > 0 )); then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
local __bp_inside_precmd=1
|
|
||||||
|
|
||||||
# Invoke every function defined in our function array.
|
|
||||||
local precmd_function
|
|
||||||
for precmd_function in "${precmd_functions[@]}"; do
|
|
||||||
|
|
||||||
# Only execute this function if it actually exists.
|
|
||||||
# Test existence of functions with: declare -[Ff]
|
|
||||||
if type -t "$precmd_function" 1>/dev/null; then
|
|
||||||
__bp_set_ret_value "$__bp_last_ret_value" "$__bp_last_argument_prev_command"
|
|
||||||
# Quote our function invocation to prevent issues with IFS
|
|
||||||
"$precmd_function"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Sets a return value in $?. We may want to get access to the $? variable in our
|
|
||||||
# precmd functions. This is available for instance in zsh. We can simulate it in bash
|
|
||||||
# by setting the value here.
|
|
||||||
__bp_set_ret_value() {
|
|
||||||
return ${1:-}
|
|
||||||
}
|
|
||||||
|
|
||||||
__bp_in_prompt_command() {
|
|
||||||
|
|
||||||
local prompt_command_array
|
|
||||||
IFS=$'\n;' read -rd '' -a prompt_command_array <<< "${PROMPT_COMMAND:-}"
|
|
||||||
|
|
||||||
local trimmed_arg
|
|
||||||
__bp_trim_whitespace trimmed_arg "${1:-}"
|
|
||||||
|
|
||||||
local command trimmed_command
|
|
||||||
for command in "${prompt_command_array[@]:-}"; do
|
|
||||||
__bp_trim_whitespace trimmed_command "$command"
|
|
||||||
if [[ "$trimmed_command" == "$trimmed_arg" ]]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# This function is installed as the DEBUG trap. It is invoked before each
|
|
||||||
# interactive prompt display. Its purpose is to inspect the current
|
|
||||||
# environment to attempt to detect if the current command is being invoked
|
|
||||||
# interactively, and invoke 'preexec' if so.
|
|
||||||
__bp_preexec_invoke_exec() {
|
|
||||||
|
|
||||||
# Save the contents of $_ so that it can be restored later on.
|
|
||||||
# https://stackoverflow.com/questions/40944532/bash-preserve-in-a-debug-trap#40944702
|
|
||||||
__bp_last_argument_prev_command="${1:-}"
|
|
||||||
# Don't invoke preexecs if we are inside of another preexec.
|
|
||||||
if (( __bp_inside_preexec > 0 )); then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
local __bp_inside_preexec=1
|
|
||||||
|
|
||||||
# Checks if the file descriptor is not standard out (i.e. '1')
|
|
||||||
# __bp_delay_install checks if we're in test. Needed for bats to run.
|
|
||||||
# Prevents preexec from being invoked for functions in PS1
|
|
||||||
if [[ ! -t 1 && -z "${__bp_delay_install:-}" ]]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n "${COMP_LINE:-}" ]]; then
|
|
||||||
# We're in the middle of a completer. This obviously can't be
|
|
||||||
# an interactively issued command.
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
if [[ -z "${__bp_preexec_interactive_mode:-}" ]]; then
|
|
||||||
# We're doing something related to displaying the prompt. Let the
|
|
||||||
# prompt set the title instead of me.
|
|
||||||
return
|
|
||||||
else
|
|
||||||
# If we're in a subshell, then the prompt won't be re-displayed to put
|
|
||||||
# us back into interactive mode, so let's not set the variable back.
|
|
||||||
# In other words, if you have a subshell like
|
|
||||||
# (sleep 1; sleep 2)
|
|
||||||
# You want to see the 'sleep 2' as a set_command_title as well.
|
|
||||||
if [[ 0 -eq "${BASH_SUBSHELL:-}" ]]; then
|
|
||||||
__bp_preexec_interactive_mode=""
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if __bp_in_prompt_command "${BASH_COMMAND:-}"; then
|
|
||||||
# If we're executing something inside our prompt_command then we don't
|
|
||||||
# want to call preexec. Bash prior to 3.1 can't detect this at all :/
|
|
||||||
__bp_preexec_interactive_mode=""
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
local this_command
|
|
||||||
this_command=$(
|
|
||||||
export LC_ALL=C
|
|
||||||
HISTTIMEFORMAT= builtin history 1 | sed '1 s/^ *[0-9][0-9]*[* ] //'
|
|
||||||
)
|
|
||||||
|
|
||||||
# Sanity check to make sure we have something to invoke our function with.
|
|
||||||
if [[ -z "$this_command" ]]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Invoke every function defined in our function array.
|
|
||||||
local preexec_function
|
|
||||||
local preexec_function_ret_value
|
|
||||||
local preexec_ret_value=0
|
|
||||||
for preexec_function in "${preexec_functions[@]:-}"; do
|
|
||||||
|
|
||||||
# Only execute each function if it actually exists.
|
|
||||||
# Test existence of function with: declare -[fF]
|
|
||||||
if type -t "$preexec_function" 1>/dev/null; then
|
|
||||||
__bp_set_ret_value ${__bp_last_ret_value:-}
|
|
||||||
# Quote our function invocation to prevent issues with IFS
|
|
||||||
"$preexec_function" "$this_command"
|
|
||||||
preexec_function_ret_value="$?"
|
|
||||||
if [[ "$preexec_function_ret_value" != 0 ]]; then
|
|
||||||
preexec_ret_value="$preexec_function_ret_value"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Restore the last argument of the last executed command, and set the return
|
|
||||||
# value of the DEBUG trap to be the return code of the last preexec function
|
|
||||||
# to return an error.
|
|
||||||
# If `extdebug` is enabled a non-zero return value from any preexec function
|
|
||||||
# will cause the user's command not to execute.
|
|
||||||
# Run `shopt -s extdebug` to enable
|
|
||||||
__bp_set_ret_value "$preexec_ret_value" "$__bp_last_argument_prev_command"
|
|
||||||
}
|
|
||||||
|
|
||||||
__bp_install() {
|
|
||||||
# Exit if we already have this installed.
|
|
||||||
if [[ "${PROMPT_COMMAND:-}" == *"__bp_precmd_invoke_cmd"* ]]; then
|
|
||||||
return 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
trap '__bp_preexec_invoke_exec "$_"' DEBUG
|
|
||||||
|
|
||||||
# Preserve any prior DEBUG trap as a preexec function
|
|
||||||
local prior_trap=$(sed "s/[^']*'\(.*\)'[^']*/\1/" <<<"${__bp_trap_string:-}")
|
|
||||||
unset __bp_trap_string
|
|
||||||
if [[ -n "$prior_trap" ]]; then
|
|
||||||
eval '__bp_original_debug_trap() {
|
|
||||||
'"$prior_trap"'
|
|
||||||
}'
|
|
||||||
preexec_functions+=(__bp_original_debug_trap)
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Adjust our HISTCONTROL Variable if needed.
|
|
||||||
__bp_adjust_histcontrol
|
|
||||||
|
|
||||||
# Issue #25. Setting debug trap for subshells causes sessions to exit for
|
|
||||||
# backgrounded subshell commands (e.g. (pwd)& ). Believe this is a bug in Bash.
|
|
||||||
#
|
|
||||||
# Disabling this by default. It can be enabled by setting this variable.
|
|
||||||
if [[ -n "${__bp_enable_subshells:-}" ]]; then
|
|
||||||
|
|
||||||
# Set so debug trap will work be invoked in subshells.
|
|
||||||
set -o functrace > /dev/null 2>&1
|
|
||||||
shopt -s extdebug > /dev/null 2>&1
|
|
||||||
fi;
|
|
||||||
|
|
||||||
local existing_prompt_command
|
|
||||||
# Remove setting our trap install string and sanitize the existing prompt command string
|
|
||||||
existing_prompt_command="${PROMPT_COMMAND:-}"
|
|
||||||
existing_prompt_command="${existing_prompt_command//$__bp_install_string[;$'\n']}" # Edge case of appending to PROMPT_COMMAND
|
|
||||||
existing_prompt_command="${existing_prompt_command//$__bp_install_string}"
|
|
||||||
__bp_sanitize_string existing_prompt_command "$existing_prompt_command"
|
|
||||||
|
|
||||||
# Install our hooks in PROMPT_COMMAND to allow our trap to know when we've
|
|
||||||
# actually entered something.
|
|
||||||
PROMPT_COMMAND=$'__bp_precmd_invoke_cmd\n'
|
|
||||||
if [[ -n "$existing_prompt_command" ]]; then
|
|
||||||
PROMPT_COMMAND+=${existing_prompt_command}$'\n'
|
|
||||||
fi;
|
|
||||||
PROMPT_COMMAND+='__bp_interactive_mode'
|
|
||||||
|
|
||||||
# Add two functions to our arrays for convenience
|
|
||||||
# of definition.
|
|
||||||
precmd_functions+=(precmd)
|
|
||||||
preexec_functions+=(preexec)
|
|
||||||
|
|
||||||
# Invoke our two functions manually that were added to $PROMPT_COMMAND
|
|
||||||
__bp_precmd_invoke_cmd
|
|
||||||
__bp_interactive_mode
|
|
||||||
}
|
|
||||||
|
|
||||||
# Sets an installation string as part of our PROMPT_COMMAND to install
|
|
||||||
# after our session has started. This allows bash-preexec to be included
|
|
||||||
# at any point in our bash profile.
|
|
||||||
__bp_install_after_session_init() {
|
|
||||||
# bash-preexec needs to modify these variables in order to work correctly
|
|
||||||
# if it can't, just stop the installation
|
|
||||||
__bp_require_not_readonly PROMPT_COMMAND HISTCONTROL HISTTIMEFORMAT || return
|
|
||||||
|
|
||||||
local sanitized_prompt_command
|
|
||||||
__bp_sanitize_string sanitized_prompt_command "${PROMPT_COMMAND:-}"
|
|
||||||
if [[ -n "$sanitized_prompt_command" ]]; then
|
|
||||||
PROMPT_COMMAND=${sanitized_prompt_command}$'\n'
|
|
||||||
fi;
|
|
||||||
PROMPT_COMMAND+=${__bp_install_string}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Run our install so long as we're not delaying it.
|
|
||||||
if [[ -z "${__bp_delay_install:-}" ]]; then
|
|
||||||
__bp_install_after_session_init
|
|
||||||
fi;
|
|
||||||
# -- END BASH-PREEXEC.SH --
|
|
||||||
|
|
||||||
}
|
|
||||||
_install_bash_preexec
|
|
||||||
unset -f _install_bash_preexec
|
|
||||||
|
|
||||||
# -- BEGIN ITERM2 CUSTOMIZATIONS --
|
|
||||||
|
|
||||||
# We don't care about whitespace, but users care about not changing their histcontrol variables.
|
|
||||||
# We overwrite the upstream __bp_adjust_histcontrol function whcih gets called from the next
|
|
||||||
# PROMPT_COMMAND invocation.
|
|
||||||
function __bp_adjust_histcontrol() {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
function iterm2_begin_osc {
|
|
||||||
printf "\033]"
|
|
||||||
}
|
|
||||||
|
|
||||||
function iterm2_end_osc {
|
|
||||||
printf "\007"
|
|
||||||
}
|
|
||||||
|
|
||||||
function iterm2_print_state_data() {
|
|
||||||
local _iterm2_hostname="${iterm2_hostname}"
|
|
||||||
if [ -z "${iterm2_hostname:-}" ]; then
|
|
||||||
_iterm2_hostname=$(hostname -f 2>/dev/null)
|
|
||||||
fi
|
|
||||||
iterm2_begin_osc
|
|
||||||
printf "1337;RemoteHost=%s@%s" "$USER" "$_iterm2_hostname"
|
|
||||||
iterm2_end_osc
|
|
||||||
|
|
||||||
iterm2_begin_osc
|
|
||||||
printf "1337;CurrentDir=%s" "$PWD"
|
|
||||||
iterm2_end_osc
|
|
||||||
|
|
||||||
iterm2_print_user_vars
|
|
||||||
}
|
|
||||||
|
|
||||||
# Usage: iterm2_set_user_var key value
|
|
||||||
function iterm2_set_user_var() {
|
|
||||||
iterm2_begin_osc
|
|
||||||
printf "1337;SetUserVar=%s=%s" "$1" $(printf "%s" "$2" | base64 | tr -d '\n')
|
|
||||||
iterm2_end_osc
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -z "$(type -t iterm2_print_user_vars)" ] || [ "$(type -t iterm2_print_user_vars)" != function ]; then
|
|
||||||
# iterm2_print_user_vars is not already defined. Provide a no-op default version.
|
|
||||||
#
|
|
||||||
# Users can write their own version of this function. It should call
|
|
||||||
# iterm2_set_user_var but not produce any other output.
|
|
||||||
function iterm2_print_user_vars() {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
function iterm2_prompt_prefix() {
|
|
||||||
iterm2_begin_osc
|
|
||||||
printf "133;D;\$?"
|
|
||||||
iterm2_end_osc
|
|
||||||
}
|
|
||||||
|
|
||||||
function iterm2_prompt_mark() {
|
|
||||||
iterm2_begin_osc
|
|
||||||
printf "133;A"
|
|
||||||
iterm2_end_osc
|
|
||||||
}
|
|
||||||
|
|
||||||
function iterm2_prompt_suffix() {
|
|
||||||
iterm2_begin_osc
|
|
||||||
printf "133;B"
|
|
||||||
iterm2_end_osc
|
|
||||||
}
|
|
||||||
|
|
||||||
function iterm2_print_version_number() {
|
|
||||||
iterm2_begin_osc
|
|
||||||
printf "1337;ShellIntegrationVersion=18;shell=bash"
|
|
||||||
iterm2_end_osc
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# If hostname -f is slow on your system, set iterm2_hostname before sourcing this script.
|
|
||||||
# On macOS we run `hostname -f` every time because it is fast.
|
|
||||||
if [ -z "${iterm2_hostname:-}" ]; then
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
iterm2_hostname=$(hostname -f 2>/dev/null)
|
|
||||||
# some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
iterm2_hostname=$(hostname)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
iterm2_maybe_print_cr() {
|
|
||||||
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
|
|
||||||
printf "\r"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Runs after interactively edited command but before execution
|
|
||||||
__iterm2_preexec() {
|
|
||||||
# Save the returned value from our last command
|
|
||||||
__iterm2_last_ret_value="$?"
|
|
||||||
|
|
||||||
iterm2_begin_osc
|
|
||||||
printf "133;C;"
|
|
||||||
iterm2_maybe_print_cr
|
|
||||||
iterm2_end_osc
|
|
||||||
# If PS1 still has the value we set it to in iterm2_preexec_invoke_cmd then
|
|
||||||
# restore it to its original value. It might have changed if you have
|
|
||||||
# another PROMPT_COMMAND (like liquidprompt) that modifies PS1.
|
|
||||||
if [ -n "${ITERM_ORIG_PS1+xxx}" -a "$PS1" = "$ITERM_PREV_PS1" ]
|
|
||||||
then
|
|
||||||
export PS1="$ITERM_ORIG_PS1"
|
|
||||||
fi
|
|
||||||
iterm2_ran_preexec="yes"
|
|
||||||
# preexec functions can return nonzero to prevent user's command from running.
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Prints the current directory and hostname control sequences. Modifies PS1 to
|
|
||||||
# add the FinalTerm A and B codes to locate the prompt.
|
|
||||||
function __iterm2_prompt_command () {
|
|
||||||
__iterm2_last_ret_value="$?"
|
|
||||||
|
|
||||||
if [[ -z "${iterm2_ran_preexec:-}" ]]
|
|
||||||
then
|
|
||||||
# This code path is taken when you press ^C while entering a command.
|
|
||||||
# I observed this behavior in CentOS 7.2 and macOS "GNU bash, version 5.0.18(1)-release".
|
|
||||||
__iterm2_preexec ""
|
|
||||||
__bp_set_ret_value "$__iterm2_last_ret_value" "$__bp_last_argument_prev_command"
|
|
||||||
fi
|
|
||||||
iterm2_ran_preexec=""
|
|
||||||
|
|
||||||
# This is an iTerm2 addition to try to work around a problem in the
|
|
||||||
# original preexec.bash.
|
|
||||||
# When the PS1 has command substitutions, this gets invoked for each
|
|
||||||
# substitution and each command that's run within the substitution, which
|
|
||||||
# really adds up. It would be great if we could do something like this at
|
|
||||||
# the end of this script:
|
|
||||||
# PS1="$(iterm2_prompt_prefix)$PS1($iterm2_prompt_suffix)"
|
|
||||||
# and have iterm2_prompt_prefix set a global variable that tells precmd not to
|
|
||||||
# output anything and have iterm2_prompt_suffix reset that variable.
|
|
||||||
# Unfortunately, command substitutions run in subshells and can't
|
|
||||||
# communicate to the outside world.
|
|
||||||
# Instead, we have this workaround. We save the original value of PS1 in
|
|
||||||
# $ITERM_ORIG_PS1. Then each time this function is run (it's called from
|
|
||||||
# PROMPT_COMMAND just before the prompt is shown) it will change PS1 to a
|
|
||||||
# string without any command substitutions by doing eval on ITERM_ORIG_PS1. At
|
|
||||||
# this point ITERM_PREEXEC_INTERACTIVE_MODE is still the empty string, so preexec
|
|
||||||
# won't produce output for command substitutions.
|
|
||||||
|
|
||||||
# The first time this is called ITERM_ORIG_PS1 is unset. This tests if the variable
|
|
||||||
# is undefined (not just empty) and initializes it. We can't initialize this at the
|
|
||||||
# top of the script because it breaks with liquidprompt. liquidprompt wants to
|
|
||||||
# set PS1 from a PROMPT_COMMAND that runs just before us. Setting ITERM_ORIG_PS1
|
|
||||||
# at the top of the script will overwrite liquidprompt's PS1, whose value would
|
|
||||||
# never make it into ITERM_ORIG_PS1. Issue 4532. It's important to check
|
|
||||||
# if it's undefined before checking if it's empty because some users have
|
|
||||||
# bash set to error out on referencing an undefined variable.
|
|
||||||
if [ -z "${ITERM_ORIG_PS1+xxx}" ]
|
|
||||||
then
|
|
||||||
# ITERM_ORIG_PS1 always holds the last user-set value of PS1.
|
|
||||||
# You only get here on the first time iterm2_preexec_invoke_cmd is called.
|
|
||||||
export ITERM_ORIG_PS1="$PS1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If you want to generate PS1 dynamically from PROMPT_COMMAND, the best way
|
|
||||||
# to do it is to define a function named iterm2_generate_ps1 that sets PS1.
|
|
||||||
# Issue 5964. Other shells don't have this issue because they don't need
|
|
||||||
# such extremes to get precmd and preexec.
|
|
||||||
if [ -n "$(type -t iterm2_generate_ps1)" ] && [ "$(type -t iterm2_generate_ps1)" = function ]; then
|
|
||||||
iterm2_generate_ps1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "$PS1" != "$ITERM_PREV_PS1" ]]
|
|
||||||
then
|
|
||||||
export ITERM_ORIG_PS1="$PS1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get the value of the prompt prefix, which will change $?
|
|
||||||
\local iterm2_prompt_prefix_value="$(iterm2_prompt_prefix)"
|
|
||||||
|
|
||||||
# Add the mark unless the prompt includes '$(iterm2_prompt_mark)' as a substring.
|
|
||||||
if [[ $ITERM_ORIG_PS1 != *'$(iterm2_prompt_mark)'* && x$ITERM2_SQUELCH_MARK = x ]]
|
|
||||||
then
|
|
||||||
iterm2_prompt_prefix_value="$iterm2_prompt_prefix_value$(iterm2_prompt_mark)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Send escape sequences with current directory and hostname.
|
|
||||||
iterm2_print_state_data
|
|
||||||
|
|
||||||
# Reset $? to its saved value, which might be used in $ITERM_ORIG_PS1.
|
|
||||||
__bp_set_ret_value "$__iterm2_last_ret_value" "$__bp_last_argument_prev_command"
|
|
||||||
|
|
||||||
# Set PS1 to various escape sequences, the user's preferred prompt, and more escape sequences.
|
|
||||||
export PS1="\[$iterm2_prompt_prefix_value\]$ITERM_ORIG_PS1\[$(iterm2_prompt_suffix)\]"
|
|
||||||
|
|
||||||
# Save the value we just set PS1 to so if the user changes PS1 we'll know and we can update ITERM_ORIG_PS1.
|
|
||||||
export ITERM_PREV_PS1="$PS1"
|
|
||||||
__bp_set_ret_value "$__iterm2_last_ret_value" "$__bp_last_argument_prev_command"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install my function
|
|
||||||
preexec_functions+=(__iterm2_preexec)
|
|
||||||
|
|
||||||
iterm2_print_state_data
|
|
||||||
iterm2_print_version_number
|
|
||||||
fi
|
|
||||||
|
|
||||||
# -- END ITERM2 CUSTOMIZATIONS --
|
|
|
@ -1,180 +0,0 @@
|
||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU General Public License
|
|
||||||
# as published by the Free Software Foundation; either version 2
|
|
||||||
# of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
|
|
||||||
if [[ -o interactive ]]; then
|
|
||||||
if [ "${ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX-}""$TERM" != "tmux-256color" -a "${ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX-}""$TERM" != "screen" -a "${ITERM_SHELL_INTEGRATION_INSTALLED-}" = "" -a "$TERM" != linux -a "$TERM" != dumb ]; then
|
|
||||||
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
|
|
||||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
|
||||||
# Indicates start of command output. Runs just before command executes.
|
|
||||||
iterm2_before_cmd_executes() {
|
|
||||||
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
|
|
||||||
printf "\033]133;C;\r\007"
|
|
||||||
else
|
|
||||||
printf "\033]133;C;\007"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
iterm2_set_user_var() {
|
|
||||||
printf "\033]1337;SetUserVar=%s=%s\007" "$1" $(printf "%s" "$2" | base64 | tr -d '\n')
|
|
||||||
}
|
|
||||||
|
|
||||||
# Users can write their own version of this method. It should call
|
|
||||||
# iterm2_set_user_var but not produce any other output.
|
|
||||||
# e.g., iterm2_set_user_var currentDirectory $PWD
|
|
||||||
# Accessible in iTerm2 (in a badge now, elsewhere in the future) as
|
|
||||||
# \(user.currentDirectory).
|
|
||||||
whence -v iterm2_print_user_vars > /dev/null 2>&1
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
iterm2_print_user_vars() {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
iterm2_print_state_data() {
|
|
||||||
local _iterm2_hostname="${iterm2_hostname-}"
|
|
||||||
if [ -z "${iterm2_hostname:-}" ]; then
|
|
||||||
_iterm2_hostname=$(hostname -f 2>/dev/null)
|
|
||||||
fi
|
|
||||||
printf "\033]1337;RemoteHost=%s@%s\007" "$USER" "${_iterm2_hostname-}"
|
|
||||||
printf "\033]1337;CurrentDir=%s\007" "$PWD"
|
|
||||||
iterm2_print_user_vars
|
|
||||||
}
|
|
||||||
|
|
||||||
# Report return code of command; runs after command finishes but before prompt
|
|
||||||
iterm2_after_cmd_executes() {
|
|
||||||
printf "\033]133;D;%s\007" "$STATUS"
|
|
||||||
iterm2_print_state_data
|
|
||||||
}
|
|
||||||
|
|
||||||
# Mark start of prompt
|
|
||||||
iterm2_prompt_mark() {
|
|
||||||
printf "\033]133;A\007"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Mark end of prompt
|
|
||||||
iterm2_prompt_end() {
|
|
||||||
printf "\033]133;B\007"
|
|
||||||
}
|
|
||||||
|
|
||||||
# There are three possible paths in life.
|
|
||||||
#
|
|
||||||
# 1) A command is entered at the prompt and you press return.
|
|
||||||
# The following steps happen:
|
|
||||||
# * iterm2_preexec is invoked
|
|
||||||
# * PS1 is set to ITERM2_PRECMD_PS1
|
|
||||||
# * ITERM2_SHOULD_DECORATE_PROMPT is set to 1
|
|
||||||
# * The command executes (possibly reading or modifying PS1)
|
|
||||||
# * iterm2_precmd is invoked
|
|
||||||
# * ITERM2_PRECMD_PS1 is set to PS1 (as modified by command execution)
|
|
||||||
# * PS1 gets our escape sequences added to it
|
|
||||||
# * zsh displays your prompt
|
|
||||||
# * You start entering a command
|
|
||||||
#
|
|
||||||
# 2) You press ^C while entering a command at the prompt.
|
|
||||||
# The following steps happen:
|
|
||||||
# * (iterm2_preexec is NOT invoked)
|
|
||||||
# * iterm2_precmd is invoked
|
|
||||||
# * iterm2_before_cmd_executes is called since we detected that iterm2_preexec was not run
|
|
||||||
# * (ITERM2_PRECMD_PS1 and PS1 are not messed with, since PS1 already has our escape
|
|
||||||
# sequences and ITERM2_PRECMD_PS1 already has PS1's original value)
|
|
||||||
# * zsh displays your prompt
|
|
||||||
# * You start entering a command
|
|
||||||
#
|
|
||||||
# 3) A new shell is born.
|
|
||||||
# * PS1 has some initial value, either zsh's default or a value set before this script is sourced.
|
|
||||||
# * iterm2_precmd is invoked
|
|
||||||
# * ITERM2_SHOULD_DECORATE_PROMPT is initialized to 1
|
|
||||||
# * ITERM2_PRECMD_PS1 is set to the initial value of PS1
|
|
||||||
# * PS1 gets our escape sequences added to it
|
|
||||||
# * Your prompt is shown and you may begin entering a command.
|
|
||||||
#
|
|
||||||
# Invariants:
|
|
||||||
# * ITERM2_SHOULD_DECORATE_PROMPT is 1 during and just after command execution, and "" while the prompt is
|
|
||||||
# shown and until you enter a command and press return.
|
|
||||||
# * PS1 does not have our escape sequences during command execution
|
|
||||||
# * After the command executes but before a new one begins, PS1 has escape sequences and
|
|
||||||
# ITERM2_PRECMD_PS1 has PS1's original value.
|
|
||||||
iterm2_decorate_prompt() {
|
|
||||||
# This should be a raw PS1 without iTerm2's stuff. It could be changed during command
|
|
||||||
# execution.
|
|
||||||
ITERM2_PRECMD_PS1="$PS1"
|
|
||||||
ITERM2_SHOULD_DECORATE_PROMPT=""
|
|
||||||
|
|
||||||
# Add our escape sequences just before the prompt is shown.
|
|
||||||
# Use ITERM2_SQUELCH_MARK for people who can't mdoify PS1 directly, like powerlevel9k users.
|
|
||||||
# This is gross but I had a heck of a time writing a correct if statetment for zsh 5.0.2.
|
|
||||||
local PREFIX=""
|
|
||||||
if [[ $PS1 == *"$(iterm2_prompt_mark)"* ]]; then
|
|
||||||
PREFIX=""
|
|
||||||
elif [[ "${ITERM2_SQUELCH_MARK-}" != "" ]]; then
|
|
||||||
PREFIX=""
|
|
||||||
else
|
|
||||||
PREFIX="%{$(iterm2_prompt_mark)%}"
|
|
||||||
fi
|
|
||||||
PS1="$PREFIX$PS1%{$(iterm2_prompt_end)%}"
|
|
||||||
ITERM2_DECORATED_PS1="$PS1"
|
|
||||||
}
|
|
||||||
|
|
||||||
iterm2_precmd() {
|
|
||||||
local STATUS="$?"
|
|
||||||
if [ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]; then
|
|
||||||
# You pressed ^C while entering a command (iterm2_preexec did not run)
|
|
||||||
iterm2_before_cmd_executes
|
|
||||||
if [ "$PS1" != "${ITERM2_DECORATED_PS1-}" ]; then
|
|
||||||
# PS1 changed, perhaps in another precmd. See issue 9938.
|
|
||||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
iterm2_after_cmd_executes "$STATUS"
|
|
||||||
|
|
||||||
if [ -n "$ITERM2_SHOULD_DECORATE_PROMPT" ]; then
|
|
||||||
iterm2_decorate_prompt
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# This is not run if you press ^C while entering a command.
|
|
||||||
iterm2_preexec() {
|
|
||||||
# Set PS1 back to its raw value prior to executing the command.
|
|
||||||
PS1="$ITERM2_PRECMD_PS1"
|
|
||||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
|
||||||
iterm2_before_cmd_executes
|
|
||||||
}
|
|
||||||
|
|
||||||
# If hostname -f is slow on your system set iterm2_hostname prior to
|
|
||||||
# sourcing this script. We know it is fast on macOS so we don't cache
|
|
||||||
# it. That lets us handle the hostname changing like when you attach
|
|
||||||
# to a VPN.
|
|
||||||
if [ -z "${iterm2_hostname-}" ]; then
|
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
|
||||||
iterm2_hostname=`hostname -f 2>/dev/null`
|
|
||||||
# Some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option.
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
iterm2_hostname=`hostname`
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
[[ -z ${precmd_functions-} ]] && precmd_functions=()
|
|
||||||
precmd_functions=($precmd_functions iterm2_precmd)
|
|
||||||
|
|
||||||
[[ -z ${preexec_functions-} ]] && preexec_functions=()
|
|
||||||
preexec_functions=($preexec_functions iterm2_preexec)
|
|
||||||
|
|
||||||
iterm2_print_state_data
|
|
||||||
printf "\033]1337;ShellIntegrationVersion=14;shell=zsh\007"
|
|
||||||
fi
|
|
||||||
fi
|
|
|
@ -203,7 +203,7 @@ generate_bar_disk() {
|
||||||
}
|
}
|
||||||
|
|
||||||
print_banner() {
|
print_banner() {
|
||||||
if [ ! -f "$HOME/.cache/hey-banner-printed" ]; then
|
if [ ! -f "${XDG_CACHE_HOME:-$HOME/.cache}/hey-banner-printed" ]; then
|
||||||
if command -v lolcat >/dev/null && command -v figlet >/dev/null; then
|
if command -v lolcat >/dev/null && command -v figlet >/dev/null; then
|
||||||
figlet "Hey" | lolcat -f
|
figlet "Hey" | lolcat -f
|
||||||
printf "\\n"
|
printf "\\n"
|
||||||
|
@ -211,8 +211,8 @@ print_banner() {
|
||||||
printf "\\n%s\\n" "$(figlet -t -f "$BANNER_FONTPATH" " Hey")"
|
printf "\\n%s\\n" "$(figlet -t -f "$BANNER_FONTPATH" " Hey")"
|
||||||
printf "\\n"
|
printf "\\n"
|
||||||
fi
|
fi
|
||||||
mkdir -p "$HOME/.cache"
|
mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}"
|
||||||
touch "$HOME/.cache/hey-banner-printed"
|
touch "${XDG_CACHE_HOME:-$HOME/.cache}/hey-banner-printed"
|
||||||
else
|
else
|
||||||
if command -v neofetch > /dev/null; then
|
if command -v neofetch > /dev/null; then
|
||||||
neofetch
|
neofetch
|
||||||
|
|
|
@ -167,7 +167,7 @@ default_gnome_extensions:
|
||||||
- if command -v yum > /dev/null; then sudo yum install -y libgda libgda-sqlite; fi
|
- if command -v yum > /dev/null; then sudo yum install -y libgda libgda-sqlite; fi
|
||||||
- if command -v pacman > /dev/null; then sudo pacman -Sy libgda; fi
|
- if command -v pacman > /dev/null; then sudo pacman -Sy libgda; fi
|
||||||
- if command -v zypper > /dev/null; then sudo zypper install -y libgda-6_0-sqlite typelib-1_0-Gda-6_0 typelib-1_0-GSound-1_0; fi
|
- if command -v zypper > /dev/null; then sudo zypper install -y libgda-6_0-sqlite typelib-1_0-Gda-6_0 typelib-1_0-GSound-1_0; fi
|
||||||
- dconf write /org/gnome/shell/extensions/pano/database-location "\\\"$HOME/.local/share/pano\\\""
|
- dconf write /org/gnome/shell/extensions/pano/database-location "\\\"${XDG_DATA_HOME:-$HOME/.local/share}/pano\\\""
|
||||||
- dconf write /org/gnome/shell/extensions/pano/history-length 50
|
- dconf write /org/gnome/shell/extensions/pano/history-length 50
|
||||||
- dconf write /org/gnome/shell/extensions/pano/play-audio-on-copy true
|
- dconf write /org/gnome/shell/extensions/pano/play-audio-on-copy true
|
||||||
- dconf write /org/gnome/shell/extensions/pano/session-only-mode true
|
- dconf write /org/gnome/shell/extensions/pano/session-only-mode true
|
||||||
|
|
|
@ -423,7 +423,7 @@ if command -v hoard > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/ho
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### iTerm2
|
### iTerm2
|
||||||
[ ! -f "$HOME/.local/scripts/iterm2.zsh" ] || source "$HOME/.local/scripts/iterm2.zsh"
|
[ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/iterm/iterm2.zsh" ] || source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/iterm/iterm2.zsh"
|
||||||
|
|
||||||
### Java (asdf)
|
### Java (asdf)
|
||||||
[ ! -f "$ASDF_DATA_DIR/plugins/java/set-java-home.zsh" ] || source "$ASDF_DATA_DIR/plugins/java/set-java-home.zsh"
|
[ ! -f "$ASDF_DATA_DIR/plugins/java/set-java-home.zsh" ] || source "$ASDF_DATA_DIR/plugins/java/set-java-home.zsh"
|
||||||
|
@ -479,7 +479,7 @@ if command -v brew > /dev/null && command -v sdkman-cli > /dev/null; then
|
||||||
export SDKMAN_DIR="$(brew --prefix sdkman-cli)/libexec"
|
export SDKMAN_DIR="$(brew --prefix sdkman-cli)/libexec"
|
||||||
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||||
elif [ -f "$SDKMAN_DIR/bin/sdkman-init.sh" ]; then
|
elif [ -f "$SDKMAN_DIR/bin/sdkman-init.sh" ]; then
|
||||||
export SDKMAN_DIR="$XDG_DATA_HOME/sdkman"
|
export SDKMAN_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/sdkman"
|
||||||
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
. "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -433,10 +433,10 @@ find "$HOME/.local/bin" -maxdepth 1 -mindepth 1 -type f | while read -r BINFILE;
|
||||||
done
|
done
|
||||||
|
|
||||||
### Run chezmoi init
|
### Run chezmoi init
|
||||||
if [ ! -f "$HOME/.config/chezmoi/chezmoi.yaml" ]; then
|
if [ ! -f "${XDG_CONFIG_HOME:-$HOME/.config}/chezmoi/chezmoi.yaml" ]; then
|
||||||
### Show README.md snippet
|
### Show README.md snippet
|
||||||
if command -v glow > /dev/null; then
|
if command -v glow > /dev/null; then
|
||||||
glow "$HOME/.local/share/chezmoi/docs/CHEZMOI-INTRO.md"
|
glow "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/CHEZMOI-INTRO.md"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Prompt for variables
|
### Prompt for variables
|
||||||
|
@ -497,6 +497,6 @@ fi
|
||||||
|
|
||||||
logg success 'Provisioning complete!'
|
logg success 'Provisioning complete!'
|
||||||
|
|
||||||
if command -v glow > /dev/null && [ -f "$HOME/.local/share/chezmoi/docs/POST-INSTALL.md" ]; then
|
if command -v glow > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/terminal/post-install.md" ]; then
|
||||||
glow "$HOME/.local/share/chezmoi/docs/POST-INSTALL.md"
|
glow "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/terminal/post-install.md"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -420,8 +420,8 @@ else
|
||||||
sudo sed -i '/# TEMPORARY FOR INSTALL DOCTOR/d' /etc/sudoers || logg warn 'Failed to remove passwordless sudo from the /etc/sudoers file'
|
sudo sed -i '/# TEMPORARY FOR INSTALL DOCTOR/d' /etc/sudoers || logg warn 'Failed to remove passwordless sudo from the /etc/sudoers file'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# @description Render the `docs/POST-INSTALL.md` file to the terminal at the end of the provisioning process
|
# @description Render the `docs/terminal/post-install.md` file to the terminal at the end of the provisioning process
|
||||||
logg success 'Provisioning complete!'
|
logg success 'Provisioning complete!'
|
||||||
if command -v glow > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/POST-INSTALL.md" ]; then
|
if command -v glow > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/terminal/post-install.md" ]; then
|
||||||
glow "$HOME/.local/share/chezmoi/docs/POST-INSTALL.md"
|
glow "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/terminal/post-install.md"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -300,8 +300,8 @@ else
|
||||||
sudo sed -i '/# TEMPORARY FOR INSTALL DOCTOR/d' /etc/sudoers || logg warn 'Failed to remove passwordless sudo from the /etc/sudoers file'
|
sudo sed -i '/# TEMPORARY FOR INSTALL DOCTOR/d' /etc/sudoers || logg warn 'Failed to remove passwordless sudo from the /etc/sudoers file'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# @description Render the `docs/POST-INSTALL.md` file to the terminal at the end of the provisioning process
|
# @description Render the `docs/terminal/post-install.md` file to the terminal at the end of the provisioning process
|
||||||
logg success 'Provisioning complete!'
|
logg success 'Provisioning complete!'
|
||||||
if command -v glow > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/POST-INSTALL.md" ]; then
|
if command -v glow > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/terminal/post-install.md" ]; then
|
||||||
glow "$HOME/.local/share/chezmoi/docs/POST-INSTALL.md"
|
glow "${XDG_DATA_HOME:-$HOME/.local/share}/chezmoi/docs/terminal/post-install.md"
|
||||||
fi
|
fi
|
||||||
|
|
12
software.yml
12
software.yml
|
@ -1386,7 +1386,7 @@ softwarePackages:
|
||||||
_name: Cod
|
_name: Cod
|
||||||
go: github.com/dim-an/cod@master
|
go: github.com/dim-an/cod@master
|
||||||
iproute2mac:
|
iproute2mac:
|
||||||
_bin:
|
_bin:
|
||||||
_github: https://github.com/brona/iproute2mac
|
_github: https://github.com/brona/iproute2mac
|
||||||
_name: iproute2mac
|
_name: iproute2mac
|
||||||
brew:darwin: iproute2mac
|
brew:darwin: iproute2mac
|
||||||
|
@ -2739,7 +2739,7 @@ softwarePackages:
|
||||||
port: xsv
|
port: xsv
|
||||||
brew: xsv
|
brew: xsv
|
||||||
nix-env: xsv
|
nix-env: xsv
|
||||||
|
|
||||||
haproxy:
|
haproxy:
|
||||||
_bin: haproxy
|
_bin: haproxy
|
||||||
_github: https://github.com/haproxy/haproxy
|
_github: https://github.com/haproxy/haproxy
|
||||||
|
@ -4812,7 +4812,7 @@ softwarePackages:
|
||||||
_bin: atuin
|
_bin: atuin
|
||||||
_github: https://github.com/ellie/atuin
|
_github: https://github.com/ellie/atuin
|
||||||
_name: Atuin
|
_name: Atuin
|
||||||
_post: source "$XDG_CONFIG_HOME/shell/private.sh" && atuin register -u "$ATUIN_USERNAME" -e "$ATUIN_EMAIL" -p "$ATUIN_PASSWORD" && atuin import auto && atuin sync
|
_post: source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/private.sh" && atuin register -u "$ATUIN_USERNAME" -e "$ATUIN_EMAIL" -p "$ATUIN_PASSWORD" && atuin import auto && atuin sync
|
||||||
brew: atuin
|
brew: atuin
|
||||||
cargo: atuin
|
cargo: atuin
|
||||||
pacman: atuin
|
pacman: atuin
|
||||||
|
@ -4823,7 +4823,7 @@ softwarePackages:
|
||||||
_github: https://github.com/ddworken/hishtory
|
_github: https://github.com/ddworken/hishtory
|
||||||
_name: hiSHtory
|
_name: hiSHtory
|
||||||
_todo: Check for Homebrew version
|
_todo: Check for Homebrew version
|
||||||
_post: source "$XDG_CONFIG_HOME/shell/private.sh" && echo y | hishtory init "$HISHTORY_USER_SECRET"
|
_post: source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/private.sh" && echo y | hishtory init "$HISHTORY_USER_SECRET"
|
||||||
script: curl https://hishtory.dev/install.py | python3 -
|
script: curl https://hishtory.dev/install.py | python3 -
|
||||||
git-town:
|
git-town:
|
||||||
_bin: git-town
|
_bin: git-town
|
||||||
|
@ -9089,7 +9089,7 @@ softwarePackages:
|
||||||
_when:cask: '! test -d "/Applications/Tailscale.app" && ! test -d "$HOME/Applications/Tailscale.app"'
|
_when:cask: '! test -d "/Applications/Tailscale.app" && ! test -d "$HOME/Applications/Tailscale.app"'
|
||||||
cask: tailscale
|
cask: tailscale
|
||||||
choco: tailscale
|
choco: tailscale
|
||||||
|
|
||||||
task:
|
task:
|
||||||
_bin: task
|
_bin: task
|
||||||
_desc: A task runner / simpler Make alternative written in Go
|
_desc: A task runner / simpler Make alternative written in Go
|
||||||
|
@ -9914,7 +9914,7 @@ softwarePackages:
|
||||||
_home: https://volta.sh
|
_home: https://volta.sh
|
||||||
_name: volta-vm
|
_name: volta-vm
|
||||||
_post: |
|
_post: |
|
||||||
export VOLTA_HOME="$XDG_DATA_HOME/volta"
|
export VOLTA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/volta"
|
||||||
export PATH="$VOLTA_HOME/bin:$PATH"
|
export PATH="$VOLTA_HOME/bin:$PATH"
|
||||||
volta setup
|
volta setup
|
||||||
volta install node@latest
|
volta install node@latest
|
||||||
|
|
20
start.sh
20
start.sh
|
@ -296,18 +296,18 @@ function ensureTaskInstalled() {
|
||||||
logger error "System type not recognized. You must install task manually." && exit 1
|
logger error "System type not recognized. You must install task manually." && exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
mkdir -p "$HOME/.cache/megabyte/start.sh"
|
mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh"
|
||||||
if [ -f "$HOME/.cache/megabyte/start.sh/bodega-update-check" ]; then
|
if [ -f "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh/bodega-update-check" ]; then
|
||||||
TASK_UPDATE_TIME="$(cat "$HOME/.cache/megabyte/start.sh/bodega-update-check")"
|
TASK_UPDATE_TIME="$(cat "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh/bodega-update-check")"
|
||||||
else
|
else
|
||||||
TASK_UPDATE_TIME="$(date +%s)"
|
TASK_UPDATE_TIME="$(date +%s)"
|
||||||
echo "$TASK_UPDATE_TIME" > "$HOME/.cache/megabyte/start.sh/bodega-update-check"
|
echo "$TASK_UPDATE_TIME" > "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh/bodega-update-check"
|
||||||
fi
|
fi
|
||||||
# shellcheck disable=SC2004
|
# shellcheck disable=SC2004
|
||||||
TIME_DIFF="$(($(date +%s) - $TASK_UPDATE_TIME))"
|
TIME_DIFF="$(($(date +%s) - $TASK_UPDATE_TIME))"
|
||||||
# Only run if it has been at least 15 minutes since last attempt
|
# Only run if it has been at least 15 minutes since last attempt
|
||||||
if [ "$TIME_DIFF" -gt 900 ] || [ "$TIME_DIFF" -lt 5 ]; then
|
if [ "$TIME_DIFF" -gt 900 ] || [ "$TIME_DIFF" -lt 5 ]; then
|
||||||
date +%s > "$HOME/.cache/megabyte/start.sh/bodega-update-check"
|
date +%s > "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh/bodega-update-check"
|
||||||
logger info "Checking for latest version of Task"
|
logger info "Checking for latest version of Task"
|
||||||
CURRENT_VERSION="$(task --version | cut -d' ' -f3 | cut -c 2-)"
|
CURRENT_VERSION="$(task --version | cut -d' ' -f3 | cut -c 2-)"
|
||||||
LATEST_VERSION="$(curl -s "$TASK_RELEASE_API" | grep tag_name | cut -c 17- | sed 's/\",//')"
|
LATEST_VERSION="$(curl -s "$TASK_RELEASE_API" | grep tag_name | cut -c 17- | sed 's/\",//')"
|
||||||
|
@ -450,12 +450,12 @@ function ensureTaskfiles() {
|
||||||
if [ -z "$ENSURED_TASKFILES" ]; then
|
if [ -z "$ENSURED_TASKFILES" ]; then
|
||||||
# shellcheck disable=SC2030
|
# shellcheck disable=SC2030
|
||||||
task donothing || BOOTSTRAP_EXIT_CODE=$?
|
task donothing || BOOTSTRAP_EXIT_CODE=$?
|
||||||
mkdir -p "$HOME/.cache/megabyte/start.sh"
|
mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh"
|
||||||
if [ -f "$HOME/.cache/megabyte/start.sh/ensure-taskfiles" ]; then
|
if [ -f "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh/ensure-taskfiles" ]; then
|
||||||
TASK_UPDATE_TIME="$(cat "$HOME/.cache/megabyte/start.sh/ensure-taskfiles")"
|
TASK_UPDATE_TIME="$(cat "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh/ensure-taskfiles")"
|
||||||
else
|
else
|
||||||
TASK_UPDATE_TIME="$(date +%s)"
|
TASK_UPDATE_TIME="$(date +%s)"
|
||||||
echo "$TASK_UPDATE_TIME" > "$HOME/.cache/megabyte/start.sh/ensure-taskfiles"
|
echo "$TASK_UPDATE_TIME" > "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh/ensure-taskfiles"
|
||||||
fi
|
fi
|
||||||
# shellcheck disable=SC2004
|
# shellcheck disable=SC2004
|
||||||
TIME_DIFF="$(($(date +%s) - $TASK_UPDATE_TIME))"
|
TIME_DIFF="$(($(date +%s) - $TASK_UPDATE_TIME))"
|
||||||
|
@ -463,7 +463,7 @@ function ensureTaskfiles() {
|
||||||
if [ -n "$BOOTSTRAP_EXIT_CODE" ] || [ "$TIME_DIFF" -gt 3600 ] || [ "$TIME_DIFF" -lt 5 ] || [ -n "$FORCE_TASKFILE_UPDATE" ]; then
|
if [ -n "$BOOTSTRAP_EXIT_CODE" ] || [ "$TIME_DIFF" -gt 3600 ] || [ "$TIME_DIFF" -lt 5 ] || [ -n "$FORCE_TASKFILE_UPDATE" ]; then
|
||||||
logger info 'Grabbing latest Taskfiles by downloading shared-master.tar.gz'
|
logger info 'Grabbing latest Taskfiles by downloading shared-master.tar.gz'
|
||||||
# shellcheck disable=SC2031
|
# shellcheck disable=SC2031
|
||||||
date +%s > "$HOME/.cache/megabyte/start.sh/ensure-taskfiles"
|
date +%s > "${XDG_CACHE_HOME:-$HOME/.cache}/megabyte/start.sh/ensure-taskfiles"
|
||||||
ENSURED_TASKFILES="true"
|
ENSURED_TASKFILES="true"
|
||||||
if [ -d common/.config/taskfiles ]; then
|
if [ -d common/.config/taskfiles ]; then
|
||||||
if [[ "$OSTYPE" == 'darwin'* ]]; then
|
if [[ "$OSTYPE" == 'darwin'* ]]; then
|
||||||
|
|
Loading…
Reference in a new issue