mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-15 14:42:37 +00:00
Compare commits
112 Commits
1b349b11c3
...
arch
| Author | SHA1 | Date | |
|---|---|---|---|
|
5d6cb3a843
|
|||
|
5561f3ccaf
|
|||
|
3a82ae15df
|
|||
|
d26ca008c0
|
|||
|
d29876b367
|
|||
|
24440f845b
|
|||
|
4a08de9573
|
|||
|
b1c3b16cc6
|
|||
|
b159565288
|
|||
|
df876d2cac
|
|||
|
e052f0c394
|
|||
|
0d916fe960
|
|||
|
1b504cca65
|
|||
|
fb0e4d705b
|
|||
|
b9f248926b
|
|||
|
f798ef2e4e
|
|||
|
fa47fcaed7
|
|||
|
f39a9113d6
|
|||
|
207e4469b2
|
|||
|
047c241df8
|
|||
|
b8bf70f117
|
|||
|
bec884f866
|
|||
|
943427b3e1
|
|||
|
eae3bfbc90
|
|||
|
6621475808
|
|||
|
090a0681ca
|
|||
|
3acaf486c0
|
|||
|
80c6eefe8c
|
|||
|
0c80780ade
|
|||
|
5ea0ef74e4
|
|||
|
5bad99f712
|
|||
|
44aec09d62
|
|||
|
a0dcba3810
|
|||
|
7356d129cc
|
|||
|
eece231724
|
|||
|
3446460827
|
|||
|
1e60f88ec4
|
|||
|
45666a5911
|
|||
|
46186e2741
|
|||
|
fe25f1bf19
|
|||
|
c8212b7587
|
|||
|
4b674c40c9
|
|||
|
8daa596205
|
|||
|
9977a8806b
|
|||
|
c667bfb8ee
|
|||
|
2ed9208e6a
|
|||
|
0be8bcd1a2
|
|||
|
dcb186393e
|
|||
|
b7ce95dc66
|
|||
|
358b9719f1
|
|||
|
89b12fc5fa
|
|||
|
23a27446df
|
|||
|
c44c2cf5ea
|
|||
|
9d6b99206a
|
|||
|
d19a33f4f0
|
|||
|
9c7d395c6b
|
|||
|
2f9c68acfb
|
|||
|
df109c3803
|
|||
|
cbe53484fa
|
|||
|
2aa9f4e839
|
|||
|
ad593bc25f
|
|||
|
790ba581aa
|
|||
|
e57262b4d3
|
|||
|
e63e4f4fab
|
|||
|
86d3a54e3b
|
|||
|
cf05f11759
|
|||
|
059dba6f18
|
|||
|
00c9c77bcc
|
|||
|
52cbe2ad89
|
|||
|
f1b65e955e
|
|||
|
3c98a008c8
|
|||
|
74011a46bc
|
|||
|
e972dd331c
|
|||
|
9c007c9434
|
|||
|
381a0450e5
|
|||
|
af7b46efa5
|
|||
|
f269906fd5
|
|||
|
307a971371
|
|||
|
6b13291fff
|
|||
|
b4b7fa0a84
|
|||
|
d166c246ef
|
|||
|
746167a9c8
|
|||
|
419752b381
|
|||
|
79da2db401
|
|||
|
0da387b1b9
|
|||
|
e1ed84d343
|
|||
|
d5f1d56b94
|
|||
|
97f3047989
|
|||
|
18fc260a75
|
|||
|
5811d5602b
|
|||
|
d172a0071b
|
|||
|
2995edfc86
|
|||
|
10987bd255
|
|||
|
0045e6149c
|
|||
|
3081c6b9b3
|
|||
|
e154efcac4
|
|||
|
71eae2eb5b
|
|||
|
9af452c849
|
|||
|
0636832796
|
|||
|
05cb700cb1
|
|||
|
a03617608d
|
|||
|
ef933bd3aa
|
|||
|
6b9f2203c1
|
|||
|
e0214a49d2
|
|||
|
b090430cd8
|
|||
|
e53cef27a0
|
|||
|
43f18eb45a
|
|||
|
c1eae18c67
|
|||
|
4d73fede8b
|
|||
|
ba06819221
|
|||
|
ba81c53054
|
|||
|
36fd0558b0
|
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
[submodule "mail"]
|
||||
path = mail
|
||||
url = ssh://git@git.housh.dev:2222/michael/mail.git
|
||||
[submodule "env/.config/nvim"]
|
||||
path = env/.config/nvim
|
||||
url = https://github.com/m-housh/mhoush.nvim.git
|
||||
4
.prettierrc
Normal file
4
.prettierrc
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"proseWrap": "always"
|
||||
"printWidth": 100
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
proseWrap: always
|
||||
printWidth: 120
|
||||
73
TODO.md
73
TODO.md
@@ -1,34 +1,59 @@
|
||||
# TODO
|
||||
|
||||
- Add zsh functions to dots cli manager.
|
||||
- Add tmux plugins to dots cli manager.
|
||||
- Add tmux-powerline linking to `dots` cli manager.
|
||||
- Clean up zet commands, maybe make a gum / fzf filter script.
|
||||
- Update README to reflect ansible installation
|
||||
- Update ansible to do gpg installation.
|
||||
- Update ansible to include sketchybar.
|
||||
A list of in-progress and completed todo's.
|
||||
|
||||
# Arch Todos
|
||||
## Arch Todos
|
||||
|
||||
- Separate scripts that are used for configurations / store them somewhere aside
|
||||
- [ ] Update README, it's way out of date.
|
||||
- [x] Separate scripts that are used for configurations / store them somewhere aside
|
||||
from `~/.local/bin`
|
||||
- Clipse didn't work when installed on a new machine when I try to use the
|
||||
- [x] Add neomutt configuration files into the repo (or probably a private repo)
|
||||
- [x] Clipse didn't work when installed on a new machine when I try to use the
|
||||
config in the dotfiles, but works if I use the default config. Need to explore
|
||||
why (current thoughts are it has to do with creating the
|
||||
clipboard_history.json file and not letting clipse do it automatically).
|
||||
- Set sddm login theme, currently it doesn't allow me to echo values into the
|
||||
/etc/sddm.conf file, also need to edit the theme in
|
||||
`/usr/share/sddm/themes/catppuccin-mocha/theme.conf` to use the wallpaper as a
|
||||
background image.
|
||||
- Note: The background needs to be copied into the theme's background
|
||||
directory. It didn't seem to work when I just set the path to somewhere in
|
||||
my home directory.
|
||||
- Add script to generate yubikey authentication using the pam-u2f module
|
||||
[documentation](https://wiki.archlinux.org/title/Universal_2nd_Factor).
|
||||
- Note: that the directory this is stored in MUST be ~/.config/Yubico (I tried
|
||||
using ~/.config/yubico and it didn't work)
|
||||
- Move keyboard (kanata) systemd service to be started as a '--user' service, as
|
||||
- [x] Need to add the following system packages for neovim/render-markdown.nvim
|
||||
- [x] `libtexprintf`
|
||||
- [ ] Add pipewire-zeroconf to runs.
|
||||
- [ ] Setup pipewire config to allow streaming output to homepod's.
|
||||
- [See arch.wiki](https://wiki.archlinux.org/title/PipeWire)
|
||||
|
||||
### Bootstrapping a new machine
|
||||
|
||||
- [ ] Need to confirm bootstrap does things properly with git submodules. Currently the
|
||||
system run handles installing packages needed for my yubikey, probably need to automate
|
||||
installing the public key into the keyring.
|
||||
- [x] Add gpg public key import into `runs/after/system`
|
||||
- [ ] Need to ensure ssh keys are setup before private submodules are loaded / installed,
|
||||
so I need to make sure that Yubikey setup runs early and works for ssh authentication.
|
||||
- [ ] Setup a new machine / virtual machine to test, as it's hard to test the scripts once a machine is setup.
|
||||
- [ ] Need to add `repos` script when bootstrapping.
|
||||
|
||||
### Keyboard / kanata
|
||||
|
||||
- [x] Move keyboard (kanata) systemd service to be started as a '--user' service, as
|
||||
it seems to not work when used on a desktop (mac mini) vs. laptop.
|
||||
- [ ] Need to update kanatactl to generate udev rules, etc. (see
|
||||
- [x] Need to update kanatactl to generate udev rules, etc. (see
|
||||
here)[https://github.com/jtroo/kanata/blob/main/docs/setup-linux.md]
|
||||
- Add neomutt configuration files into the repo (or probably a private repo)
|
||||
- [ ] Need to rethink symbol / number keyboard layers.
|
||||
- [ ] Move symbols to their own layer.
|
||||
- [ ] I would like to have a symbols layer that I can hold modifier keys with a symbol
|
||||
and would also like to possibly pass through underlying key / experiment so that
|
||||
I can use default keybinds in certain applications (i.e. neovim `[b`, etc.).
|
||||
- [x] Remove pkg sub-commands from kanatactl, it is available via package manager now.
|
||||
|
||||
### Runs (package installs)
|
||||
|
||||
- [x] Should runs just export / echo a list of packages, then the `run` script can handle the package
|
||||
manager options / command.
|
||||
- [x] Think about adding a `before` and an `after` directory for runs, so that they can perform setup tasks after
|
||||
the packages are installed.
|
||||
- [x] The `before` and `after` file should have the same name as the `run` file.
|
||||
- [ ] This could allow to remove / move the `system` script into the `after` directory.
|
||||
- [ ] Look into install packages with `nvim --headless`, not sure if this possible when using the new package
|
||||
manager builtin to neovim as it prompts for user input to install packages.
|
||||
- With lazy this was done with `nvim --headless "+Lazy! sync" +qa`
|
||||
|
||||
### Mail
|
||||
|
||||
- [ ] Remove outlook / office email setup, this has been moved to proton.
|
||||
|
||||
15
bootstrap
15
bootstrap
@@ -4,8 +4,8 @@
|
||||
#
|
||||
|
||||
if [ -z "$DEV_ENV" ]; then
|
||||
echo "env var DEV_ENV needs to be present"
|
||||
exit 1
|
||||
echo "env var DEV_ENV needs to be present"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# if i just did DEV_ENV=$(pwd) ./run then this is needed for the rest of the
|
||||
@@ -15,15 +15,16 @@ export DEV_ENV="$DEV_ENV"
|
||||
args=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ "$1" =~ dry ]]; then
|
||||
args="--dry-run"
|
||||
fi
|
||||
if [[ "$1" =~ dry ]]; then
|
||||
args="--dry-run"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Args to bootstrap scripts: $args"
|
||||
echo "Installing packages may require your password multiple times."
|
||||
|
||||
echo "Running packages" && $DEV_ENV/run "$args"
|
||||
echo "Installing configuration" && $DEV_ENV/dev-env "$args"
|
||||
# TODO: Need to run system run early, then once ssh keys are setup pull
|
||||
# git submodules, then run config install again.
|
||||
echo "Running packages" && $DEV_ENV/run "$args"
|
||||
echo "Installing webapps" && $DEV_ENV/webapp "$args"
|
||||
echo "Starting system services" && $DEV_ENV/system "$args"
|
||||
|
||||
149
dev-env
149
dev-env
@@ -7,98 +7,108 @@
|
||||
dry_run="0"
|
||||
|
||||
if [ -z "$XDG_CONFIG_HOME" ]; then
|
||||
echo "no xdg config home"
|
||||
echo "using ~/.config"
|
||||
XDG_CONFIG_HOME=$HOME/.config
|
||||
echo "no xdg config home"
|
||||
echo "using ~/.config"
|
||||
XDG_CONFIG_HOME=$HOME/.config
|
||||
fi
|
||||
|
||||
if [ -z "$XDG_DATA_HOME" ]; then
|
||||
echo "no xdg data home"
|
||||
echo "using ~/.local/share"
|
||||
XDG_DATA_HOME=$HOME/.local/share
|
||||
echo "no xdg data home"
|
||||
echo "using ~/.local/share"
|
||||
XDG_DATA_HOME=$HOME/.local/share
|
||||
fi
|
||||
|
||||
if [ -z "$DEV_ENV" ]; then
|
||||
echo "env var DEV_ENV needs to be present"
|
||||
exit 1
|
||||
echo "env var DEV_ENV needs to be present"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $1 =~ ^--dry ]]; then
|
||||
dry_run="1"
|
||||
dry_run="1"
|
||||
fi
|
||||
|
||||
log() {
|
||||
if [[ $dry_run == "1" ]]; then
|
||||
echo "[DRY_RUN]: $1"
|
||||
else
|
||||
echo "$1"
|
||||
fi
|
||||
if [[ $dry_run == "1" ]]; then
|
||||
echo "[DRY_RUN]: $1"
|
||||
else
|
||||
echo "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
log "env: $DEV_ENV"
|
||||
|
||||
# Removes a destination directory and copies all files to the destination.
|
||||
update_dirs() {
|
||||
log "copying over files from: $1"
|
||||
pushd $1 &>/dev/null
|
||||
(
|
||||
# Copy everything except systemd, share, and zsh folders, they need treated differently.
|
||||
configs=$(
|
||||
find . -mindepth 1 -maxdepth 1 -type d \
|
||||
\( -name "systemd" -o -name "zsh" -o -name "share" -o -name "scripts" -o -name "kanata" \) \
|
||||
-prune -o -type d -print
|
||||
)
|
||||
for c in $configs; do
|
||||
directory=${2%/}/${c#./}
|
||||
log " removing: rm -rf $directory"
|
||||
log "copying over files from: $1"
|
||||
pushd $1 &>/dev/null
|
||||
(
|
||||
# Copy everything except systemd, share, and zsh folders, they need treated differently.
|
||||
configs=$(
|
||||
find . -mindepth 1 -maxdepth 1 -type d \
|
||||
\( -name "systemd" -o -name "zsh" -o -name "share" -o -name "scripts" -o -name "kanata" \) \
|
||||
-prune -o -type d -print
|
||||
)
|
||||
for c in $configs; do
|
||||
directory=${2%/}/${c#./}
|
||||
log " removing: rm -rf $directory"
|
||||
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
rm -rf $directory
|
||||
fi
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
rm -rf $directory
|
||||
fi
|
||||
|
||||
log " copying env: cp $c $2"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
cp -r ./$c $2
|
||||
fi
|
||||
done
|
||||
log " copying env: cp $c $2"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
cp -r ./$c $2
|
||||
fi
|
||||
done
|
||||
|
||||
)
|
||||
popd &>/dev/null
|
||||
)
|
||||
popd &>/dev/null
|
||||
}
|
||||
|
||||
# Removes a destination file and copies a single file to the destination.
|
||||
copy() {
|
||||
log "removing: $2"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
rm $2 &>/dev/null
|
||||
fi
|
||||
log "copying: $1 to $2"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
cp $1 $2
|
||||
fi
|
||||
log "removing: $2"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
rm $2 &>/dev/null
|
||||
fi
|
||||
log "copying: $1 to $2"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
cp $1 $2
|
||||
fi
|
||||
}
|
||||
|
||||
# Copy all files from a directory into another directory.
|
||||
copy_files() {
|
||||
log "copying over files from: $1"
|
||||
pushd "$1" &>/dev/null || exit 1
|
||||
(
|
||||
for f in $(find . -mindepth 1 -maxdepth 1 -type f); do
|
||||
log "copying over files from: $1"
|
||||
pushd "$1" &>/dev/null || exit 1
|
||||
(
|
||||
for f in $(find . -mindepth 1 -maxdepth 1 -type f); do
|
||||
|
||||
declare dest
|
||||
dest="$2/$(basename "$f")"
|
||||
declare dest
|
||||
dest="$2/$(basename "$f")"
|
||||
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
rm -rf $dest >/dev/null 2>&1
|
||||
fi
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
rm -rf $dest >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
log " copying env: cp $f $dest"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
cp $f $dest
|
||||
fi
|
||||
done
|
||||
)
|
||||
popd &>/dev/null || exit 1
|
||||
log " copying env: cp $f $dest"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
cp $f $dest
|
||||
fi
|
||||
done
|
||||
)
|
||||
popd &>/dev/null || exit 1
|
||||
}
|
||||
|
||||
email() {
|
||||
if command -v mailctl; then
|
||||
log "Updating using mailctl..."
|
||||
[[ $dry_run == "0" ]] && mailctl update && mailctl config
|
||||
else
|
||||
log "Installing mailctl..."
|
||||
[[ $dry_run == "0" ]] && . "$DEV_ENV/mail/install"
|
||||
fi
|
||||
}
|
||||
|
||||
############################## MAIN ##############################
|
||||
@@ -109,10 +119,12 @@ update_dirs $DEV_ENV/env/.local $HOME/.local
|
||||
|
||||
# SCRIPTS
|
||||
mkdir -p ~/.local/scripts/{hypr,utils} >/dev/null 2>&1
|
||||
mkdir -p ~/.local/scripts/utils/kanatactl >/dev/null 2>&1
|
||||
mkdir -p ~/.local/scripts/utils/{kanatactl,hpa,shorten-url} >/dev/null 2>&1
|
||||
update_dirs $DEV_ENV/env/.local/scripts/hypr $HOME/.local/scripts/hypr
|
||||
copy_files $DEV_ENV/env/.local/scripts/hypr $HOME/.local/scripts/hypr
|
||||
copy_files "$DEV_ENV/env/.local/scripts/utils/kanatactl" "$HOME/.local/scripts/utils/kanatactl"
|
||||
copy_files "$DEV_ENV/env/.local/scripts/utils/hpa" "$HOME/.local/scripts/utils/hpa"
|
||||
copy_files "$DEV_ENV/env/.local/scripts/utils/shorten-url" "$HOME/.local/scripts/utils/shorten-url"
|
||||
copy_files $DEV_ENV/env/.local/scripts $HOME/.local/scripts
|
||||
|
||||
# SYSTEMD
|
||||
@@ -142,8 +154,8 @@ copy_files $DEV_ENV/env/wallpapers $HOME/wallpapers
|
||||
mkdir $HOME/Pictures >/dev/null 2>&1
|
||||
mkdir -p $XDG_DATA_HOME/clipse/tmp_files
|
||||
copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env
|
||||
copy $DEV_ENV/env/.markdownlint.jsonc $HOME/.makrdownlint.jsonc
|
||||
copy $DEV_ENV/env/.prettierrc.yaml $HOME/.prettierrc.yaml
|
||||
copy $DEV_ENV/env/.markdownlint.jsonc $HOME/.markdownlint.jsonc
|
||||
copy $DEV_ENV/env/.prettierrc $HOME/.prettierrc
|
||||
|
||||
mkdir -p $XDG_DATA_HOME/applications/icons
|
||||
copy_files $DEV_ENV/env/.local/share/applications $XDG_DATA_HOME/applications
|
||||
@@ -153,9 +165,12 @@ copy_files $DEV_ENV/env/.local/share/applications/icons $XDG_DATA_HOME/applicati
|
||||
mkdir $HOME/pkgbuilds
|
||||
update_dirs $DEV_ENV/env/pkgbuilds $HOME/pkgbuilds
|
||||
|
||||
# Email.
|
||||
email
|
||||
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
systemctl --user daemon-reload
|
||||
hyprctl reload
|
||||
espanso service restart
|
||||
exec zsh -l
|
||||
systemctl --user daemon-reload
|
||||
hyprctl reload
|
||||
espanso service restart
|
||||
exec zsh -l
|
||||
fi
|
||||
|
||||
76
devcontainer-env
Executable file
76
devcontainer-env
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# Intsalls appropriate dotfiles inside a devcontainer context.
|
||||
|
||||
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"}
|
||||
DEV_ENV=${DEV_ENV:-""}
|
||||
|
||||
if [ ! -d "$DEV_ENV" ]; then
|
||||
echo "[ERROR]: DEV_ENV variable does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log() {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
copy_dir() {
|
||||
local dir=${1:-""}
|
||||
local path="${DEV_ENV}/${dir}"
|
||||
|
||||
if [ -z "$dir" ] || [ ! -d "$path" ]; then
|
||||
log "[ERROR]: Directory does not exist: $dir"
|
||||
exit 1
|
||||
else
|
||||
log "Copying dir: $dir"
|
||||
cp -R "$path" "$XDG_CONFIG_HOME"
|
||||
fi
|
||||
}
|
||||
|
||||
copy_file() {
|
||||
local file=${1:-""}
|
||||
|
||||
if [[ -z "$file" ]] || [[ ! -f "$file" ]]; then
|
||||
log "[ERROR]: file does not exist: $file"
|
||||
exit 1
|
||||
else
|
||||
log "Copying file: $file"
|
||||
cp "$DEV_ENV/$file" "$HOME"
|
||||
fi
|
||||
}
|
||||
|
||||
# MAIN
|
||||
dirs=(
|
||||
env/.config/eza
|
||||
env/.config/git
|
||||
env/.config/ripgrep
|
||||
env/.config/starship
|
||||
env/.config/yazi
|
||||
env/.config/zsh
|
||||
)
|
||||
|
||||
files=(
|
||||
env/.markdownlint.jsonc
|
||||
env/.prettierrc
|
||||
env/.tmux.conf
|
||||
env/.zshenv
|
||||
)
|
||||
|
||||
for dir in "${dirs[@]}"; do
|
||||
copy_dir "$dir"
|
||||
done
|
||||
|
||||
for file in "${files[@]}"; do
|
||||
copy_file "$file"
|
||||
done
|
||||
|
||||
# Install neovim config
|
||||
git submodule update --init --remote env/.config/nvim
|
||||
source env/.config/nvim/install.sh
|
||||
|
||||
# Install my scripts
|
||||
cp -R env/.local/scripts "$HOME/.local"
|
||||
75
env/.config/aap/config.toml
vendored
Normal file
75
env/.config/aap/config.toml
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# This config is setup for running inside the docker container.
|
||||
#
|
||||
# NOTE:
|
||||
# Configuration settings for the `hpa` command line tool.
|
||||
# You can delete settings that are not applicable to your use case.
|
||||
|
||||
# Default arguments / options that get passed into `ansible-playbook` commands.
|
||||
# WARNING: Do not put arguments / options that contain spaces in the same string,
|
||||
# they should be separate strings, for example do not do something like
|
||||
# ['--tags debug'], instead use ['--tags', 'debug'].
|
||||
#
|
||||
args = ['--tags', 'debug']
|
||||
|
||||
# Set to true if you want to pass the vault args to `ansible-playbook` commands.
|
||||
useVaultArgs = true
|
||||
|
||||
# NOTE:
|
||||
# Configuration for running the generate command(s). This allows custimizations
|
||||
# to the files that get used to generate the final output (generally a pdf).
|
||||
# See `pandoc --help`. Below are the defaults that get used, which only need
|
||||
# adjusted if your template does not follow the default template design or if
|
||||
# you add extra files to your template that need to be included in the final
|
||||
# output. Also be aware that any of the files specified in the `files` or
|
||||
# `includeInHeader` options, need to be inside the `buildDirectory` when generating
|
||||
# the final output file.
|
||||
|
||||
# [generate]
|
||||
# this relative to the project directory.
|
||||
# buildDirectory = '.build'
|
||||
# pdfEngine = 'xelatex'
|
||||
# includeInHeader = [
|
||||
# 'head.tex',
|
||||
# 'footer.tex'
|
||||
# ]
|
||||
# files = [
|
||||
# 'Report.md',
|
||||
# 'Definitions.md'
|
||||
# ]
|
||||
# outputFileName = 'Report'
|
||||
|
||||
# NOTE:
|
||||
# These are more for local development of the ansible playbook and should not be needed
|
||||
# in most cases. Uncomment the lines if you want to customize the playbook and use it
|
||||
# instead of the provided / default playbook.
|
||||
|
||||
[playbook]
|
||||
directory = '/root/.local/share/hpa/playbook'
|
||||
inventory = '/root/.local/share/hpa/playbook/inventory.ini'
|
||||
version = 'main'
|
||||
|
||||
# NOTE:
|
||||
# These are to declare where your template files are either on your local system or
|
||||
# a remote git repository.
|
||||
[template]
|
||||
# The directory path on your local system to the template files.
|
||||
directory = '/root/.local/share/hpa/airflow-assessment-template'
|
||||
vars = 'repo_vars'
|
||||
|
||||
# The url to a git repository that contains your template files.
|
||||
# url = 'https://git.example.com/consult-template.git'
|
||||
|
||||
# The version, tag, branch, or sha of the template files to clone from the remote
|
||||
# template repository. In general it is best practice to use a version instead of a
|
||||
# branch.
|
||||
# version = '1.0.0'
|
||||
|
||||
# NOTE:
|
||||
# Holds settings for `ansible-vault` commands.
|
||||
[vault]
|
||||
# Arguments to pass to commands that use `ansible-vault`, such as encrypting or decrypting
|
||||
# files.
|
||||
args = ['--vault-password-file=/run/secrets/vault-pass']
|
||||
|
||||
# An id to use when encrypting `ansible-vault` files.
|
||||
#encryptId = 'myId'
|
||||
2
env/.config/ghostty/config
vendored
2
env/.config/ghostty/config
vendored
@@ -3,7 +3,7 @@ theme = Catppuccin Mocha
|
||||
confirm-close-surface = false
|
||||
|
||||
font-family = "Fira Code"
|
||||
font-size = 13
|
||||
font-size = 18
|
||||
font-thicken = false
|
||||
|
||||
window-save-state = always
|
||||
|
||||
5
env/.config/git/config
vendored
5
env/.config/git/config
vendored
@@ -8,6 +8,7 @@
|
||||
[user]
|
||||
name = Michael Housh
|
||||
email = michael@mhoush.com
|
||||
signingkey = 0x90D3EB6274D5B7CF
|
||||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
@@ -29,6 +30,7 @@
|
||||
default = simple
|
||||
autoSetupRemote = true
|
||||
followTags = true
|
||||
recurseSubmodules = on-demand
|
||||
|
||||
[fetch]
|
||||
prune = true
|
||||
@@ -64,3 +66,6 @@
|
||||
autoSquash = true
|
||||
autoStash = true
|
||||
updateRefs = true
|
||||
|
||||
[submodule]
|
||||
recurse = true
|
||||
|
||||
11
env/.config/hpa/config.toml
vendored
11
env/.config/hpa/config.toml
vendored
@@ -1,3 +1,5 @@
|
||||
# This config is setup for running inside the docker container.
|
||||
#
|
||||
# NOTE:
|
||||
# Configuration settings for the `hpa` command line tool.
|
||||
# You can delete settings that are not applicable to your use case.
|
||||
@@ -42,8 +44,8 @@ useVaultArgs = true
|
||||
# instead of the provided / default playbook.
|
||||
|
||||
[playbook]
|
||||
directory = '/playbook'
|
||||
inventory = '/playbook/inventory.ini'
|
||||
directory = '/root/.local/share/hpa/playbook'
|
||||
inventory = '/root/.local/share/hpa/playbook/inventory.ini'
|
||||
version = 'main'
|
||||
|
||||
# NOTE:
|
||||
@@ -51,7 +53,8 @@ version = 'main'
|
||||
# a remote git repository.
|
||||
[template]
|
||||
# The directory path on your local system to the template files.
|
||||
directory = '/template'
|
||||
directory = '/root/.local/share/hpa/template'
|
||||
vars = 'repo_vars'
|
||||
|
||||
# The url to a git repository that contains your template files.
|
||||
# url = 'https://git.example.com/consult-template.git'
|
||||
@@ -66,7 +69,7 @@ directory = '/template'
|
||||
[vault]
|
||||
# Arguments to pass to commands that use `ansible-vault`, such as encrypting or decrypting
|
||||
# files.
|
||||
args = [ '--vault-password-file=/run/secrets/vault-pass' ]
|
||||
args = ['--vault-password-file=/run/secrets/vault-pass']
|
||||
|
||||
# An id to use when encrypting `ansible-vault` files.
|
||||
#encryptId = 'myId'
|
||||
|
||||
@@ -6,12 +6,10 @@
|
||||
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
||||
# Or execute your favorite apps at launch like this:
|
||||
|
||||
exec-once = pidof hyprpaper | uwsm app -- hyprpaper
|
||||
exec-once = uwsm app -- hyprpaper
|
||||
exec-once = pidof hypridle | uwsm app -- hypridle
|
||||
exec-once = uwsm app -- elephant
|
||||
exec-once = uwsm app -- swaync
|
||||
# exec-once = uwsm app -- walker --gapplication-service &
|
||||
exec-once = uwsm app -- waybar
|
||||
exec-once = pidof hyprlauncher | uwsm app -- hyprlauncher -d
|
||||
exec-once = pidof swaync | uwsm app -- swaync
|
||||
exec-once = pidof waybar | uwsm app -- waybar
|
||||
exec-once = uwsm app -- clipse -listen
|
||||
#exec-once = protonmail-bridge-core -n
|
||||
|
||||
@@ -10,7 +10,7 @@ input {
|
||||
kb_options = ctrl:nocaps
|
||||
kb_rules =
|
||||
|
||||
repeat_rate = 35
|
||||
repeat_rate = 50
|
||||
repeat_delay = 200
|
||||
|
||||
follow_mouse = 2
|
||||
@@ -24,9 +24,9 @@ input {
|
||||
}
|
||||
|
||||
# https://wiki.hyprland.org/Configuring/Variables/#gestures
|
||||
gestures {
|
||||
workspace_swipe = false
|
||||
}
|
||||
# gestures {
|
||||
# workspace_swipe = false
|
||||
# }
|
||||
|
||||
# Example per-device config
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
|
||||
@@ -14,9 +14,9 @@ $terminal = uwsm app -- ghostty
|
||||
$browser = uwsm app -- brave
|
||||
$fileManager = $terminal -e yazi
|
||||
$fileBrowser = uwsm app -- nautilus
|
||||
$menu = uwsm app -- walker
|
||||
$menu = hyprlauncher
|
||||
$scripts = ~/.local/scripts/hypr
|
||||
$pwa = $scripts/launch-webapp
|
||||
$pwa = $scripts/webapp launch
|
||||
$tmuxSessionator = ~/.local/scripts/tmux-sessionator
|
||||
$clipboardHistory = com.ghostty.clipse $terminal --class=com.ghostty.clipse -e clipse
|
||||
$uninstallDesktop = $terminal --class=com.ghostty.float -e $scripts/uninstall-desktop-app
|
||||
@@ -41,9 +41,9 @@ bindd = $mainMod, A, [A]i - launch / focus, exec,
|
||||
bindd = $mainMod SHIFT, A, [A]i - new window, exec, $pwa "https://ollama.housh.dev"
|
||||
bindd = $mainMod, B, New [b]rowser, exec, $browser
|
||||
bindd = $mainMod SHIFT, B, New private [b]rowser, exec, $browser --incognito
|
||||
bindd = $mainMod, C, [C]alendar, exec, $pwa --or-focus "https://www.icloud.com/calendar"
|
||||
bindd = $mainMod, C, [C]alendar, togglespecialworkspace, calendar
|
||||
bindd = $mainMod SHIFT, C, [C]onfig folder in tmux session, exec, $terminal -e $tmuxSessionator ~/.config
|
||||
bindd = $mainMod, D, [D]ispatch app - special workspace, exec, $pwa --special dispatch $housecallPro
|
||||
bindd = $mainMod, D, [D]ispatch app - special workspace, togglespecialworkspace, dispatch
|
||||
bindd = $mainMod SHIFT, D, [D]ispatch app - new window, exec, $pwa --new $housecallPro
|
||||
bindd = $mainMod, E, [E]mail - personal, exec, $pwa --or-focus "https://mail.proton.me"
|
||||
bindd = $mainMod SHIFT, E, [E]mail - work, exec, $scripts/launch --or-focus thunderbird uwsm app -- thunderbird
|
||||
@@ -53,14 +53,15 @@ bindd = $mainMod, G, [G]itea, exec,
|
||||
bindd = $mainMod SHIFT, G, [G]ithub, exec, $pwa --or-focus "https://github.com"
|
||||
bindd = $mainMod, H, Focus window - left, movefocus, l # move window focus using vim keys
|
||||
bindd = $mainMod SHIFT, H, Workspace - back, workspace, -1
|
||||
bindd = $mainMod, I, Localsend, exec, $scripts/launch --or-close localsend uwsm app -- localsend
|
||||
bindd = $mainMod, J, Focus window - down, movefocus, d # move window focus using vim keys
|
||||
bindd = $mainMod, K, Focus window - up, movefocus, u # move window focus using vim keys
|
||||
bindd = $mainMod, L, Focus window - right, movefocus, r # move window focus using vim keys
|
||||
bindd = $mainMod SHIFT, L, Workspace - forward, workspace, +1
|
||||
bindd = $mainMod, M, [M]usic - apple, exec, $pwa --special music "https://music.apple.com"
|
||||
bindd = $mainMod, M, [M]usic - jellyfin-tui, togglespecialworkspace, music
|
||||
bindd = $mainMod SHIFT, M, [M]enu bar - toggle visible, exec, $scripts/waybarctl --toggle
|
||||
bindd = $mainMod, O, Purchase [o]rders, exec, $pwa --special dispatch "https://po.housh.dev"
|
||||
bindd = $mainMod, P, [P]assword manager, exec, $pwa --special pass "https://pass.proton.me"
|
||||
bindd = $mainMod, P, [P]assword manager, togglespecialworkspace, pass
|
||||
bindd = $mainMod SHIFT, P, [P]hotos, exec, $pwa --or-focus "https://photos.housh.dev"
|
||||
bindd = $mainMod SHIFT, R, [R]estart menu bar, exec, $scripts/waybarctl --restart
|
||||
bindd = $mainMod, S, Toggle [s]pecial workspace, togglespecialworkspace, magic # use $windowMod S to send window to the special workspace
|
||||
13
env/.config/hypr/hyprland.conf
vendored
13
env/.config/hypr/hyprland.conf
vendored
@@ -6,12 +6,13 @@
|
||||
# Refer to the wiki for more information.
|
||||
# https://wiki.hyprland.org/Configuring/
|
||||
|
||||
source = ~/.config/hypr/env.conf
|
||||
source = ~/.config/hypr/monitors.conf
|
||||
source = ~/.config/hypr/windows.conf
|
||||
source = ~/.config/hypr/keybinds.conf
|
||||
source = ~/.config/hypr/input.conf
|
||||
source = ~/.config/hypr/autostart.conf
|
||||
source = ~/.config/hypr/hyprenv.conf
|
||||
source = ~/.config/hypr/hyprmonitors.conf
|
||||
source = ~/.config/hypr/hyprwindows.conf
|
||||
source = ~/.config/hypr/hyprworkspaces.conf
|
||||
source = ~/.config/hypr/hyprkeybinds.conf
|
||||
source = ~/.config/hypr/hyprinput.conf
|
||||
source = ~/.config/hypr/hyprautostart.conf
|
||||
|
||||
#####################
|
||||
### LOOK AND FEEL ###
|
||||
|
||||
2
env/.config/hypr/hyprlauncher.conf
vendored
Normal file
2
env/.config/hypr/hyprlauncher.conf
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
desktop_launch_prefix = uwsm app --
|
||||
@@ -4,7 +4,5 @@
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor= ,preferred,auto,auto
|
||||
#monitor = HDMI-A-1, preferred, 0x0, auto
|
||||
#monitor = HDMI-A-1, preferred, 0x0, 1.66667
|
||||
|
||||
|
||||
8
env/.config/hypr/hyprtoolkit.conf
vendored
Normal file
8
env/.config/hypr/hyprtoolkit.conf
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
background = rgb(1e1e2e)
|
||||
base = rgb(b4befe)
|
||||
alternate_base = rgb(cdd6f4)
|
||||
text = rgb(cdd6f4)
|
||||
bright_text = rgb(89b4fa)
|
||||
accent = rgb(b4befe)
|
||||
accent_secondary = rgb(cba6f7)
|
||||
|
||||
47
env/.config/hypr/hyprwindows.conf
vendored
Normal file
47
env/.config/hypr/hyprwindows.conf
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
###############
|
||||
### WINDOWS ###
|
||||
###############
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
|
||||
# windowrule = float, tag:floating-window
|
||||
# windowrule = center, tag:floating-window
|
||||
# windowrule = size 60% 60%, tag:floating-window
|
||||
#
|
||||
# # Weather tui
|
||||
# windowrule = float, class:^(com.ghostty.weather)$
|
||||
# windowrule = center, class:^(com.ghostty.weather)$
|
||||
# windowrule = size 90% 80%, class:^(com.ghostty.weather)$
|
||||
#
|
||||
# # Force windows to be a floating window
|
||||
# windowrule = tag +floating-window, class:^(blueberry.py|org.gnome.Nautilus|com.ghostty.float)$
|
||||
# windowrule = tag +floating-window, class:^(com.ghostty.windowctl)$
|
||||
# windowrule = tag +floating-window, class:^(com.ghostty.utils-launcher)$
|
||||
# windowrule = tag +floating-window, class:^(com.ghostty.homelab-launcher)$
|
||||
#
|
||||
# # Force to stay focused when visible.
|
||||
# windowrule = stayfocused, class:(blueberry.py)
|
||||
# windowrule = stayfocused, class:Pinentry.gtk
|
||||
# windowrule = stayfocused, class:com.ghostty.float
|
||||
# windowrule = stayfocused, class:com.ghostty.windowctl
|
||||
# windowrule = stayfocused, class:^(com.ghostty.utils-launcher)$
|
||||
#
|
||||
# # Clipboard history tui in floating window.
|
||||
# windowrule = tag +floating-window, class:.*clipse.*
|
||||
# windowrule = stayfocused, class:.*clipse.*
|
||||
#
|
||||
# # Ignore maximize requests from apps. You'll probably like this.
|
||||
# windowrule = suppressevent maximize, class:.*
|
||||
#
|
||||
# # Just a dash of opacity by default.
|
||||
# windowrule = opacity 0.97 0.92, class:.*
|
||||
# # No opacity on youtube.
|
||||
# windowrule = opacity 1.0, class:.*youtube.com.*
|
||||
#
|
||||
# # Fix some dragging issues with XWayland
|
||||
# windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
|
||||
#
|
||||
# # To get more information about a window’s class, title, XWayland status or its size, you can use `hyprctl clients`. (From Hyprland Wiki)
|
||||
# windowrulev2 = float,class:^(one.alynx.showmethekey)$
|
||||
# windowrulev2 = float,class:^(showmethekey-gtk)$ # make window floating
|
||||
# windowrulev2 = pin,class:^(showmethekey-gtk)$ # pin window
|
||||
15
env/.config/hypr/hyprworkspaces.conf
vendored
Normal file
15
env/.config/hypr/hyprworkspaces.conf
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
##################
|
||||
### WORKSPACES ###
|
||||
##################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||
|
||||
$scripts = ~/.local/scripts/hypr
|
||||
$pwa = $scripts/webapp launch
|
||||
$housecallPro = $pwa "https://pro.housecallpro.com/app/calendar_new"
|
||||
|
||||
workspace = special:hidden, invisible
|
||||
workspace = special:pass,on-created-empty: $pwa "https://pass.proton.me"
|
||||
workspace = special:dispatch,on-created-empty: $housecallPro && $housecallPro
|
||||
workspace = special:music,on-created-empty: ghostty --class=com.ghostty.music -e jellyfin-tui
|
||||
workspace = special:calendar,on-created-empty: uwsm app -- gnome-calendar
|
||||
48
env/.config/hypr/windows.conf
vendored
48
env/.config/hypr/windows.conf
vendored
@@ -1,48 +0,0 @@
|
||||
##############################
|
||||
### WINDOWS AND WORKSPACES ###
|
||||
##############################
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||
#
|
||||
|
||||
windowrule = float, tag:floating-window
|
||||
windowrule = center, tag:floating-window
|
||||
windowrule = size 60% 60%, tag:floating-window
|
||||
|
||||
# Weather tui
|
||||
windowrule = float, class:^(com.ghostty.weather)$
|
||||
windowrule = center, class:^(com.ghostty.weather)$
|
||||
windowrule = size 90% 80%, class:^(com.ghostty.weather)$
|
||||
|
||||
# Force windows to be a floating window
|
||||
windowrule = tag +floating-window, class:^(blueberry.py|org.gnome.Nautilus|com.ghostty.float)$
|
||||
windowrule = tag +floating-window, class:^(com.ghostty.windowctl)$
|
||||
windowrule = tag +floating-window, class:^(com.ghostty.utils-launcher)$
|
||||
windowrule = tag +floating-window, class:^(com.ghostty.homelab-launcher)$
|
||||
|
||||
# Force to stay focused when visible.
|
||||
windowrule = stayfocused, class:(blueberry.py)
|
||||
windowrule = stayfocused, class:Pinentry.gtk
|
||||
windowrule = stayfocused, class:com.ghostty.float
|
||||
windowrule = stayfocused, class:com.ghostty.windowctl
|
||||
windowrule = stayfocused, class:^(com.ghostty.utils-launcher)$
|
||||
|
||||
# Clipboard history tui in floating window.
|
||||
windowrule = tag +floating-window, class:.*clipse.*
|
||||
windowrule = stayfocused, class:.*clipse.*
|
||||
|
||||
# Ignore maximize requests from apps. You'll probably like this.
|
||||
windowrule = suppressevent maximize, class:.*
|
||||
|
||||
# Just a dash of opacity by default.
|
||||
windowrule = opacity 0.97 0.92, class:.*
|
||||
# No opacity on youtube.
|
||||
windowrule = opacity 1.0, class:.*youtube.com.*
|
||||
|
||||
# Fix some dragging issues with XWayland
|
||||
windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
|
||||
|
||||
workspace = special:hidden, invisible
|
||||
workspace = special:pass, class:.*pass.proton.me.*
|
||||
workspace = special:dispatch, class:.*pro.housecallpro.com.*
|
||||
14
env/.config/hypr/workspaces.conf
vendored
14
env/.config/hypr/workspaces.conf
vendored
@@ -1,14 +0,0 @@
|
||||
|
||||
# Set work spaces 1-5 to be on external monitor
|
||||
workspace = 1, monitor:1
|
||||
workspace = 2, monitor:1
|
||||
workspace = 3, monitor:1
|
||||
workspace = 4, monitor:1
|
||||
workspace = 5, monitor:1
|
||||
|
||||
# Set work spaces 6-10 to be on internal monitor
|
||||
workspace = 6, monitor:0
|
||||
workspace = 7, monitor:0
|
||||
workspace = 8, monitor:0
|
||||
workspace = 9, monitor:0
|
||||
workspace = 10, monitor:0
|
||||
2
env/.config/kanata/voyager.kbd
vendored
2
env/.config/kanata/voyager.kbd
vendored
@@ -27,7 +27,7 @@
|
||||
;; Variables
|
||||
(defvar
|
||||
tap-higher 400
|
||||
tap-time 200
|
||||
tap-time 150
|
||||
tap-time-plus 300
|
||||
hold-time-plus 300
|
||||
hold-time 200
|
||||
|
||||
1
env/.config/nvim
vendored
Submodule
1
env/.config/nvim
vendored
Submodule
Submodule env/.config/nvim added at 5f3d1733e7
8
env/.config/nvim/.gitignore
vendored
8
env/.config/nvim/.gitignore
vendored
@@ -1,8 +0,0 @@
|
||||
tt.*
|
||||
.tests
|
||||
doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
||||
15
env/.config/nvim/.neoconf.json
vendored
15
env/.config/nvim/.neoconf.json
vendored
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
201
env/.config/nvim/LICENSE
vendored
201
env/.config/nvim/LICENSE
vendored
@@ -1,201 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
4
env/.config/nvim/README.md
vendored
4
env/.config/nvim/README.md
vendored
@@ -1,4 +0,0 @@
|
||||
# 💤 LazyVim
|
||||
|
||||
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
|
||||
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.
|
||||
20
env/.config/nvim/after/ftplugin/markdown.lua
vendored
20
env/.config/nvim/after/ftplugin/markdown.lua
vendored
@@ -1,20 +0,0 @@
|
||||
-- Markdown specific key maps.
|
||||
--
|
||||
local todos = require("todo-comments")
|
||||
local keywords = { "WARN", "WARNING", "IMPORTANT" }
|
||||
|
||||
-- Show all the warnings in the quick fix list.
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>tw",
|
||||
"<CMD>Trouble todo toggle filter = {tag = {WARN, IMPORTANT}}<CR>",
|
||||
{ desc = "[T]odo [W]arnings" }
|
||||
)
|
||||
|
||||
vim.keymap.set("n", "]w", function()
|
||||
todos.jump_next({ keywords = keywords })
|
||||
end, { desc = "Next [W]arning" })
|
||||
|
||||
vim.keymap.set("n", "[w", function()
|
||||
todos.jump_prev({ keywords = keywords })
|
||||
end, { desc = "Previous [W]arning" })
|
||||
2
env/.config/nvim/after/ftplugin/swift.lua
vendored
2
env/.config/nvim/after/ftplugin/swift.lua
vendored
@@ -1,2 +0,0 @@
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
15
env/.config/nvim/init.lua
vendored
15
env/.config/nvim/init.lua
vendored
@@ -1,15 +0,0 @@
|
||||
-- bootstrap lazy.nvim, LazyVim and your plugin
|
||||
vim.g.netrw_browsex_viewer = "xdg-open"
|
||||
|
||||
require("config.lazy")
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*"] = function(path, bufnr)
|
||||
local first_line = vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1] or ""
|
||||
if first_line:match("^#!.*zsh") then
|
||||
return "bash"
|
||||
end
|
||||
end,
|
||||
},
|
||||
})
|
||||
27
env/.config/nvim/lazyvim.json
vendored
27
env/.config/nvim/lazyvim.json
vendored
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"extras": [
|
||||
"lazyvim.plugins.extras.coding.mini-snippets",
|
||||
"lazyvim.plugins.extras.coding.mini-surround",
|
||||
"lazyvim.plugins.extras.editor.fzf",
|
||||
"lazyvim.plugins.extras.editor.harpoon2",
|
||||
"lazyvim.plugins.extras.formatting.prettier",
|
||||
"lazyvim.plugins.extras.lang.ansible",
|
||||
"lazyvim.plugins.extras.lang.clangd",
|
||||
"lazyvim.plugins.extras.lang.cmake",
|
||||
"lazyvim.plugins.extras.lang.docker",
|
||||
"lazyvim.plugins.extras.lang.git",
|
||||
"lazyvim.plugins.extras.lang.json",
|
||||
"lazyvim.plugins.extras.lang.markdown",
|
||||
"lazyvim.plugins.extras.lang.sql",
|
||||
"lazyvim.plugins.extras.lang.tailwind",
|
||||
"lazyvim.plugins.extras.lang.tex",
|
||||
"lazyvim.plugins.extras.lang.toml",
|
||||
"lazyvim.plugins.extras.lang.yaml",
|
||||
"lazyvim.plugins.extras.util.startuptime"
|
||||
],
|
||||
"install_version": 8,
|
||||
"news": {
|
||||
"NEWS.md": "11866"
|
||||
},
|
||||
"version": 8
|
||||
}
|
||||
86
env/.config/nvim/lua/config/autocmds.lua
vendored
86
env/.config/nvim/lua/config/autocmds.lua
vendored
@@ -1,86 +0,0 @@
|
||||
local defaultGroupOptions = { clear = true }
|
||||
local markdownGroup = vim.api.nvim_create_augroup("MyMarkdownGroup", defaultGroupOptions)
|
||||
local createCmd = vim.api.nvim_create_autocmd
|
||||
|
||||
createCmd("BufEnter", {
|
||||
pattern = "*.md",
|
||||
group = markdownGroup,
|
||||
callback = function(_)
|
||||
-- HACK: Set filetype to markdown for '.md' files.
|
||||
-- Not sure why it doesn't detect these as markdown files, but this fixes the issue.
|
||||
vim.cmd.setlocal("filetype=markdown")
|
||||
vim.cmd.setlocal("textwidth=120")
|
||||
vim.cmd.setlocal("spell spelllang=en_us")
|
||||
end,
|
||||
})
|
||||
|
||||
-- Hyprlang LSP
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
pattern = { "*.hl", "hypr*.conf" },
|
||||
callback = function(event)
|
||||
print(string.format("starting hyprls for %s", vim.inspect(event)))
|
||||
vim.lsp.start({
|
||||
name = "hyprlang",
|
||||
cmd = { "hyprls" },
|
||||
root_dir = vim.fn.getcwd(),
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- Markdown
|
||||
-- createCmd("BufWritePost", {
|
||||
-- pattern = { "*.md", "*.markdown" },
|
||||
-- group = markdownGroup,
|
||||
-- callback = function(_)
|
||||
-- -- local cursor = vim.fn.getpos(".")
|
||||
-- vim.cmd("FormatWrite")
|
||||
-- -- vim.fn.setpos(".", cursor)
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
-- Set neomutt compose email file types to markdown.
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
pattern = "neomutt*",
|
||||
callback = function()
|
||||
vim.cmd.setlocal("filetype=markdown")
|
||||
vim.cmd.setlocal("textwidth=120")
|
||||
vim.cmd.setlocal("spell spelllang=en_us")
|
||||
end
|
||||
})
|
||||
|
||||
-- Go
|
||||
createCmd("BufWritePre", {
|
||||
pattern = "*.go",
|
||||
callback = function()
|
||||
require("go.format").goimport()
|
||||
end,
|
||||
group = vim.api.nvim_create_augroup("GoFormat", defaultGroupOptions),
|
||||
})
|
||||
|
||||
-- GoPass
|
||||
vim.api.nvim_exec2(
|
||||
[[
|
||||
autocmd BufNewFile,BufRead /private/**/gopass** setlocal noswapfile nobackup noundofile shada=""
|
||||
]],
|
||||
{}
|
||||
)
|
||||
|
||||
-- Highlight when yanking.
|
||||
createCmd("TextYankPost", {
|
||||
desc = "Highlight when yanking text.",
|
||||
group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- Force zsh scripts to use bash syntax hyighlighting.
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
local first_line = vim.api.nvim_buf_get_lines(args.buf, 0, 1, false)[1] or ""
|
||||
if first_line:match("^#!.*zsh") then
|
||||
vim.bo[args.buf].filetype = "bash"
|
||||
end
|
||||
end,
|
||||
})
|
||||
54
env/.config/nvim/lua/config/keymaps.lua
vendored
54
env/.config/nvim/lua/config/keymaps.lua
vendored
@@ -1,54 +0,0 @@
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
|
||||
local keymap = vim.keymap.set
|
||||
local default_options = { noremap = true, silent = true }
|
||||
local wk = require("which-key")
|
||||
|
||||
local wk_add = function(mode, keymaps)
|
||||
wk.add(keymaps, { mode = mode, silent = true })
|
||||
end
|
||||
|
||||
keymap("i", "jk", "<ESC>", default_options)
|
||||
|
||||
local make_executable = function()
|
||||
local file = vim.fn.expand("%:p")
|
||||
vim.cmd("silent !chmod +x " .. file)
|
||||
print("Made " .. file .. " executable")
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Normal Mode
|
||||
--------------------------------------------------------------------------------
|
||||
wk_add("n", {
|
||||
{ "<Left>", ":vertical resize +1<CR>", desc = "Resize Pane Left" },
|
||||
{ "<Right>", ":vertical resize -1<CR>", desc = "Resize Pane Right" },
|
||||
{ "<Up>", "resize -1<CR>", desc = "Resize Pane Up" },
|
||||
{ "<Down>", "resize +1<CR>", desc = "Resize Pane Down" },
|
||||
|
||||
{ "<leader>n", "<CMD>:noh<CR>", desc = "[N]o highlighting" },
|
||||
{ "<leader>s", "<CMD>:set spell!<CR>", desc = "[S]pell check toggle" },
|
||||
{ "<C-s>", "<CMD>:write<CR>", desc = "[S]ave" },
|
||||
|
||||
{ "J", ":move .+1<CR>==", desc = "Move line down" },
|
||||
{ "K", ":move .-2<CR>==", desc = "Move line up" },
|
||||
|
||||
{ "<leader>x", make_executable, desc = "Make current file e[x]ecutable" },
|
||||
{ "<leader>z", "<CMD>:ZenMode<CR>", desc = "[Z]en Mode" },
|
||||
})
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Visual Mode
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
vim.keymap.set("v", "K", ":move '<-2<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
|
||||
vim.keymap.set("v", "J", ":move '>+1<CR>gv=gv", { desc = "Move selected block up.", silent = true, noremap = true })
|
||||
|
||||
-- Toggle term key maps, that get attached when terminal is opened.
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { buffer = 0 }
|
||||
keymap("t", "<esc>", [[<C-\><C-n>]], opts)
|
||||
end
|
||||
|
||||
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
|
||||
69
env/.config/nvim/lua/config/lazy.lua
vendored
69
env/.config/nvim/lua/config/lazy.lua
vendored
@@ -1,69 +0,0 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
{
|
||||
import = "lazyvim.plugins.extras.editor.mini-files",
|
||||
opts = {
|
||||
options = {
|
||||
use_as_default_explorer = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
import = "lazyvim.plugins.extras.coding.blink",
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
["<C-y>"] = { "select_and_accept" },
|
||||
},
|
||||
},
|
||||
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = {
|
||||
enabled = true, -- check for plugin updates periodically
|
||||
notify = false, -- notify on update
|
||||
}, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
72
env/.config/nvim/lua/config/options.lua
vendored
72
env/.config/nvim/lua/config/options.lua
vendored
@@ -1,72 +0,0 @@
|
||||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
-- Add any additional options here
|
||||
--
|
||||
local o = vim.opt
|
||||
local wo = vim.wo
|
||||
local fn = vim.fn
|
||||
|
||||
vim.cmd.set("inccommand=split")
|
||||
o.filetype = "on"
|
||||
o.updatetime = 500 -- faster completion
|
||||
o.timeoutlen = 800 -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
o.ttimeoutlen = 300 -- Time in milliseconds to wait for a key code sequence to complete
|
||||
o.backup = false -- creates a backup file
|
||||
o.swapfile = false -- enable/disable swap file creation
|
||||
o.dir = fn.stdpath("data") .. "/swp" -- swap file directory
|
||||
o.undofile = false -- enable/disable undo file creation
|
||||
o.undodir = fn.stdpath("data") .. "/undodir" -- set undo directory
|
||||
o.history = 500 -- Use the 'history' option to set the number of lines from command mode that are remembered.
|
||||
o.hidden = true -- required to keep multiple buffers and open multiple buffers
|
||||
--o.clipboard = "unnamedplus" -- allows neovim to access the system clipboard
|
||||
o.fileencoding = "utf-8" -- the encoding written to a file
|
||||
o.conceallevel = 0 -- so that `` is visible in markdown files
|
||||
o.number = true -- set numbered lines
|
||||
o.relativenumber = true -- set relative numbered lines
|
||||
o.cmdheight = 1 -- space for displaying messages/commands
|
||||
o.showmode = false -- we don't need to see things like -- INSERT -- anymore
|
||||
o.showtabline = 2 -- always show tabs
|
||||
o.laststatus = 2 -- The value of this option influences when the last window will have a status line (2 always)
|
||||
o.smartcase = true -- smart case
|
||||
o.smartindent = true -- make indenting smarter again
|
||||
o.splitbelow = true -- force all horizontal splits to go below current window
|
||||
o.splitright = true -- force all vertical splits to go to the right of current window
|
||||
o.autoindent = true -- turn on auto indent.
|
||||
o.expandtab = true -- convert tabs to spaces
|
||||
o.smarttab = true -- turn on smart tab
|
||||
o.shiftwidth = 2 -- the number of spaces inserted for each indentation
|
||||
o.tabstop = 2 -- how many columns a tab counts for
|
||||
o.termguicolors = true -- set term gui colors (most terminals support this)
|
||||
o.cursorline = true -- highlight the current line
|
||||
o.scrolloff = 20 -- Minimal number of screen lines to keep above and below the cursor
|
||||
o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally
|
||||
o.hlsearch = false -- highlight all matches on previous search pattern
|
||||
o.ignorecase = true -- ignore case in search patterns
|
||||
o.foldenable = false -- disable folding; enable with zi
|
||||
o.foldmethod = "expr"
|
||||
o.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.cmd.set("nolist") -- don't show listchars.
|
||||
-- o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<"
|
||||
o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣"
|
||||
o.shortmess = o.shortmess + "c" -- prevent "pattern not found" messages
|
||||
wo.colorcolumn = "99999"
|
||||
o.wildmode = "full"
|
||||
o.lazyredraw = false -- do not redraw screen while running macros
|
||||
o.grepprg = "rg --hidden --vimgrep --smart-case --"
|
||||
o.completeopt = { "menu", "menuone", "noselect", "noinsert" } -- A comma separated list of options for Insert mode completion
|
||||
o.wildignorecase = true -- When set case is ignored when completing file names and directories
|
||||
o.wildignore = [[
|
||||
.git,.hg,.svn
|
||||
*.aux,*.out,*.toc
|
||||
*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
|
||||
*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
|
||||
*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
|
||||
*.mp3,*.oga,*.ogg,*.wav,*.flac
|
||||
*.eot,*.otf,*.ttf,*.woff
|
||||
*.doc,*.pdf,*.cbr,*.cbz
|
||||
*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
|
||||
*.swp,.lock,.DS_Store,._*
|
||||
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
|
||||
]]
|
||||
o.viminfo = "" -- disable viminfo from copying information from current session, for security.
|
||||
vim.g.snacks_animate = false
|
||||
8
env/.config/nvim/lua/plugins/cmp.lua
vendored
8
env/.config/nvim/lua/plugins/cmp.lua
vendored
@@ -1,8 +0,0 @@
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "default"
|
||||
}
|
||||
}
|
||||
}
|
||||
9
env/.config/nvim/lua/plugins/colorscheme.lua
vendored
9
env/.config/nvim/lua/plugins/colorscheme.lua
vendored
@@ -1,9 +0,0 @@
|
||||
return {
|
||||
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 },
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "catppuccin",
|
||||
},
|
||||
},
|
||||
}
|
||||
4
env/.config/nvim/lua/plugins/disabled.lua
vendored
4
env/.config/nvim/lua/plugins/disabled.lua
vendored
@@ -1,4 +0,0 @@
|
||||
return {
|
||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
||||
{ "akinsho/bufferline.nvim", enabled = false },
|
||||
}
|
||||
23
env/.config/nvim/lua/plugins/fidget.lua
vendored
23
env/.config/nvim/lua/plugins/fidget.lua
vendored
@@ -1,23 +0,0 @@
|
||||
return {
|
||||
"j-hui/fidget.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local fidget = require("fidget")
|
||||
fidget.setup({
|
||||
notification = {
|
||||
window = {
|
||||
normal_hl = "String", -- Base highlight group in the notification window
|
||||
winblend = 0, -- Background color opacity in the notification window
|
||||
border = "rounded", -- Border around the notification window
|
||||
zindex = 45, -- Stacking priority of the notification window
|
||||
max_width = 0, -- Maximum width of the notification window
|
||||
max_height = 0, -- Maximum height of the notification window
|
||||
x_padding = 1, -- Padding from right edge of window boundary
|
||||
y_padding = 1, -- Padding from bottom edge of window boundary
|
||||
align = "bottom", -- How to align the notification window
|
||||
relative = "editor", -- What the notification window position is relative to
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
30
env/.config/nvim/lua/plugins/formatter.lua
vendored
30
env/.config/nvim/lua/plugins/formatter.lua
vendored
@@ -1,30 +0,0 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters = {
|
||||
["markdown-toc"] = {
|
||||
condition = function(_, ctx)
|
||||
for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do
|
||||
if line:find("<!%-%- toc %-%->") then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
["markdownlint-cli2"] = {
|
||||
condition = function(_, ctx)
|
||||
local diag = vim.tbl_filter(function(d)
|
||||
return d.source == "markdownlint"
|
||||
end, vim.diagnostic.get(ctx.buf))
|
||||
return #diag > 0
|
||||
end,
|
||||
},
|
||||
},
|
||||
formatters_by_ft = {
|
||||
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||
["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
|
||||
lua = { "stulua" },
|
||||
swift = { "swiftformat" },
|
||||
},
|
||||
},
|
||||
}
|
||||
78
env/.config/nvim/lua/plugins/harpoon.lua
vendored
78
env/.config/nvim/lua/plugins/harpoon.lua
vendored
@@ -1,78 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
opts = {
|
||||
settings = {
|
||||
save_on_toggle = true,
|
||||
sync_on_ui_close = true,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<C-e>",
|
||||
function()
|
||||
require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())
|
||||
end,
|
||||
desc = "Open Harpoon window.",
|
||||
},
|
||||
{
|
||||
"<leader>a",
|
||||
function()
|
||||
require("harpoon"):list():add()
|
||||
end,
|
||||
desc = "[A]dd to the harpoon list.",
|
||||
},
|
||||
{
|
||||
"<A-y>",
|
||||
function()
|
||||
require("harpoon"):list():select(1)
|
||||
end,
|
||||
desc = "Select first harpoon buffer.",
|
||||
},
|
||||
{
|
||||
"<A-u>",
|
||||
function()
|
||||
require("harpoon"):list():select(2)
|
||||
end,
|
||||
desc = "Select second harpoon buffer.",
|
||||
},
|
||||
{
|
||||
"<A-i>",
|
||||
function()
|
||||
require("harpoon"):list():select(3)
|
||||
end,
|
||||
desc = "Select third harpoon buffer.",
|
||||
},
|
||||
{
|
||||
"<A-o>",
|
||||
function()
|
||||
require("harpoon"):list():select(4)
|
||||
end,
|
||||
desc = "Select fourth harpoon buffer.",
|
||||
},
|
||||
{
|
||||
"<C-[>",
|
||||
function()
|
||||
require("harpoon"):list():prev()
|
||||
end,
|
||||
desc = "Previous harpoon buffer.",
|
||||
},
|
||||
{
|
||||
"<C-]>",
|
||||
function()
|
||||
require("harpoon"):list():next()
|
||||
end,
|
||||
desc = "Next harpoon buffer.",
|
||||
},
|
||||
-- Extensions
|
||||
require("harpoon"):extend({
|
||||
UI_CREATE = function(cx)
|
||||
vim.keymap.set("n", "<C-v>", function()
|
||||
require("harpoon").ui:select_menu_item({ vsplit = true })
|
||||
end, { buffer = cx.buffer, desc = "Open in [V]split" })
|
||||
end,
|
||||
}),
|
||||
},
|
||||
},
|
||||
}
|
||||
29
env/.config/nvim/lua/plugins/init.lua
vendored
29
env/.config/nvim/lua/plugins/init.lua
vendored
@@ -1,29 +0,0 @@
|
||||
-- Plugins that don't require much configuration are in here.
|
||||
--
|
||||
return {
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
indent = { enabled = false },
|
||||
},
|
||||
},
|
||||
{
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
cmd = {
|
||||
"TmuxNavigateLeft",
|
||||
"TmuxNavigateDown",
|
||||
"TmuxNavigateUp",
|
||||
"TmuxNavigateRight",
|
||||
"TmuxNavigatePrevious",
|
||||
"TmuxNavigatorProcessList",
|
||||
},
|
||||
keys = {
|
||||
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
|
||||
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
|
||||
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
|
||||
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
|
||||
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
|
||||
},
|
||||
},
|
||||
}
|
||||
12
env/.config/nvim/lua/plugins/lint.lua
vendored
12
env/.config/nvim/lua/plugins/lint.lua
vendored
@@ -1,12 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters = {
|
||||
markdownlint = {
|
||||
args = { "--config", "~/.markdownlint.jsonc", "--" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
169
env/.config/nvim/lua/plugins/lsp.lua
vendored
169
env/.config/nvim/lua/plugins/lsp.lua
vendored
@@ -1,169 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"clangd",
|
||||
"marksman",
|
||||
"shfmt",
|
||||
"tinymist",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"cmake",
|
||||
"dockerfile",
|
||||
"editorconfig",
|
||||
"ini",
|
||||
"jq",
|
||||
"latex",
|
||||
"make",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
servers = {
|
||||
bashls = {},
|
||||
clangd = {},
|
||||
dockerls = {},
|
||||
gopls = {},
|
||||
harper_ls = {},
|
||||
jsonls = {},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
marksman = {},
|
||||
sourcekit = {},
|
||||
tinymist = {
|
||||
settings = {
|
||||
formatterMode = "typstyle",
|
||||
},
|
||||
},
|
||||
yamlls = {},
|
||||
},
|
||||
setup = {
|
||||
clangd = function(_, opts)
|
||||
opts.capabilities.offsetEncoding = { "utf-16" }
|
||||
end,
|
||||
sourcekit = function(_, opts)
|
||||
opts.cmd = {
|
||||
vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) or nil,
|
||||
}
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- return {
|
||||
-- "neovim/nvim-lspconfig",
|
||||
-- event = { "BufReadPre", "BufNewFile" },
|
||||
-- dependencies = {
|
||||
-- "hrsh7th/cmp-nvim-lsp",
|
||||
-- { "antosha417/nvim-lsp-file-operations", config = true },
|
||||
-- "williamboman/mason.nvim",
|
||||
-- "williamboman/mason-lspconfig.nvim",
|
||||
-- {
|
||||
-- "folke/lazydev.nvim",
|
||||
-- ft = "lua",
|
||||
-- opts = {
|
||||
-- library = {
|
||||
-- { path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- config = function()
|
||||
-- require("mason").setup()
|
||||
-- require("mason-lspconfig").setup({
|
||||
-- opts = {
|
||||
-- ensure_installed = lsp_servers,
|
||||
-- },
|
||||
-- })
|
||||
-- local lspconfig = require("lspconfig")
|
||||
-- local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
-- local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
-- local opts = { noremap = true, silent = true }
|
||||
-- local on_attach = function(_, bufnr)
|
||||
-- opts.buffer = bufnr
|
||||
--
|
||||
-- opts.desc = "Show line diagnostics"
|
||||
-- vim.keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
|
||||
--
|
||||
-- opts.desc = "Show diagnostics in Telescope"
|
||||
-- vim.keymap.set("n", "<leader><leader>d", "<CMD>Telescope diagnostics bufnr=0<CR>", opts)
|
||||
--
|
||||
-- opts.desc = "Show documentation for what is under cursor"
|
||||
-- vim.keymap.set("n", "<C-k>", vim.lsp.buf.hover, opts)
|
||||
--
|
||||
-- opts.desc = "[G]oto [D]efinition"
|
||||
-- vim.keymap.set("n", "gd", "<cmd>Telescope lsp_definitions trim_text=true<cr>", opts)
|
||||
--
|
||||
-- opts.desc = "[G]oto [D]eclaration"
|
||||
-- vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||
--
|
||||
-- opts.desc = "LSP [C]ode [A]ction"
|
||||
-- vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
|
||||
--
|
||||
-- --opts.desc = "[R]e-[N]ame"
|
||||
-- --vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
|
||||
--
|
||||
-- opts.desc = "[R]eload or start LSP"
|
||||
-- vim.keymap.set("n", "<leader>rl", ":LspRestart | :LspStart<CR>", opts)
|
||||
--
|
||||
-- opts.desc = "Goto previous diagnostic"
|
||||
-- vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
|
||||
--
|
||||
-- opts.desc = "Goto next diagnostic"
|
||||
-- vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
|
||||
-- end
|
||||
--
|
||||
-- for _, lsp in ipairs(lsp_servers) do
|
||||
-- lspconfig[lsp].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- on_init = function(client)
|
||||
-- -- HACK: to fix some issues with LSP
|
||||
-- -- more details: https://github.com/neovim/neovim/issues/19237#issuecomment-2237037154
|
||||
-- client.offset_encoding = "utf-8"
|
||||
-- end,
|
||||
-- cmd = lsp == "sourcekit" and { vim.trim(vim.fn.system("xcrun -f sourcekit-lsp")) } or nil,
|
||||
-- })
|
||||
-- end
|
||||
--
|
||||
-- -- nice icons
|
||||
-- local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
-- for type, icon in pairs(signs) do
|
||||
-- local hl = "DiagnosticSign" .. type
|
||||
-- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
-- end
|
||||
--
|
||||
-- -- For some reason I was having trouble getting this to work inside the on-attach, so it's here.
|
||||
-- vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e-[N]ame" })
|
||||
-- end,
|
||||
-- }
|
||||
39
env/.config/nvim/lua/plugins/luasnip.lua
vendored
39
env/.config/nvim/lua/plugins/luasnip.lua
vendored
@@ -1,39 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
opts = function()
|
||||
LazyVim.cmp.actions.snippet_forward = function()
|
||||
if require("luasnip").jumpable(1) then
|
||||
require("luasnip").jump(1)
|
||||
return true
|
||||
end
|
||||
end
|
||||
LazyVim.cmp.actions.snippet_stop = function()
|
||||
if require("luasnip").expand_or_jumpable() then -- or just jumpable(1) is fine?
|
||||
require("luasnip").unlink_current()
|
||||
return true
|
||||
end
|
||||
end
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<C-k>",
|
||||
mode = { "i", "s" },
|
||||
function()
|
||||
if ls.expand_or_jumpable() then
|
||||
ls.expand_or_jump()
|
||||
end
|
||||
end
|
||||
},
|
||||
{
|
||||
"<C-j>",
|
||||
mode = { "i", "s" },
|
||||
function()
|
||||
if ls.jumpable(-1) then
|
||||
ls.jump(-1)
|
||||
end
|
||||
end
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
40
env/.config/nvim/lua/plugins/oil.lua
vendored
40
env/.config/nvim/lua/plugins/oil.lua
vendored
@@ -1,40 +0,0 @@
|
||||
return {
|
||||
"stevearc/oil.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
opts = {
|
||||
columns = { "icon" },
|
||||
keymaps = {
|
||||
["<C-h>"] = false,
|
||||
["<M-h>"] = "actions.select_split",
|
||||
["<C-v>"] = {
|
||||
"actions.select",
|
||||
opts = { vertical = true },
|
||||
desc = "Open the entry in a vertical split",
|
||||
},
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
is_hidden_file = function(name, _) -- second arg is bufnr, but not currently used.
|
||||
-- Don't show .DS_Store in output.
|
||||
-- local is_ds_store = name ~= ".DS_Store"
|
||||
-- return not is_ds_store
|
||||
return false
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
-- Show the parent directory in current window.
|
||||
{ "-", "<CMD>Oil<CR>", desc = "Open parent directory." },
|
||||
-- Open parent directory in floating window.
|
||||
{
|
||||
"<space>-",
|
||||
function()
|
||||
require("oil").toggle_float()
|
||||
end,
|
||||
desc = "Open parent directory in floating window.",
|
||||
},
|
||||
},
|
||||
}
|
||||
47
env/.config/nvim/lua/plugins/snacks.lua
vendored
47
env/.config/nvim/lua/plugins/snacks.lua
vendored
@@ -1,47 +0,0 @@
|
||||
-- NOTE: Header looks jacked up here, but fine when rendered in the ui.
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
picker = {
|
||||
hidden = true,
|
||||
ignored = true
|
||||
},
|
||||
image = {
|
||||
doc = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
dashboard = {
|
||||
row = nil,
|
||||
col = nil,
|
||||
preset = {
|
||||
header = [[
|
||||
*
|
||||
+++++
|
||||
+++++++++
|
||||
==+++++++++++
|
||||
+===:+++++++++++*
|
||||
+======--+++++++++++*##+====
|
||||
+==========:=+++++++++++#+====
|
||||
+=============-=++++++++++++====
|
||||
+================-:+++++++++++++==
|
||||
+===================--++++++++++++++*
|
||||
+======================--+++++++++++++++*
|
||||
=========================-++++++++++++++++
|
||||
==========================:+++++++++++++++
|
||||
===========================:++++++++++++++
|
||||
===========================-.-++++++++++++
|
||||
===========================-::.=++++++++++
|
||||
===========================----..=++++++++
|
||||
===========================------..:=+++++
|
||||
===========================--------:...-++
|
||||
===========================------------:.:
|
||||
===========================---------------
|
||||
===========================---------------
|
||||
===========================---------------
|
||||
]],
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
11
env/.config/nvim/lua/plugins/telescope.lua
vendored
11
env/.config/nvim/lua/plugins/telescope.lua
vendored
@@ -1,11 +0,0 @@
|
||||
return {
|
||||
{
|
||||
import = "lazyvim.plugins.extras.editor.telescope",
|
||||
enabled = false,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"swift",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
14
env/.config/nvim/lua/plugins/todo-comment.lua
vendored
14
env/.config/nvim/lua/plugins/todo-comment.lua
vendored
@@ -1,14 +0,0 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"folke/trouble.nvim",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>xt", false },
|
||||
{ "<leader>xT", false },
|
||||
{ "<leader>tq", "<CMD>Trouble todo toggle<CR>", desc = "[T]odo [Q]uick fix list." },
|
||||
{ "<leader><leader>t", "<CMD>TodoTelescope<CR>", desc = "[T]odo telescope list." },
|
||||
{ "<leader>tl", "<CMD>TodoLocList<CR>", desc = "[T]odo [L]ocation list." },
|
||||
},
|
||||
}
|
||||
15
env/.config/nvim/lua/plugins/typst-preview.lua
vendored
15
env/.config/nvim/lua/plugins/typst-preview.lua
vendored
@@ -1,15 +0,0 @@
|
||||
return {
|
||||
'chomosuke/typst-preview.nvim',
|
||||
ft = 'typst', -- or ft = 'typst'
|
||||
version = '1.*',
|
||||
opts = {
|
||||
debug = true,
|
||||
}, -- lazy.nvim will implicitly calls `setup {}`
|
||||
keys = {
|
||||
{
|
||||
"<leader>tp",
|
||||
"<CMD>TypstPreviewToggle<CR>",
|
||||
desc = "Toggle typst preview."
|
||||
},
|
||||
}
|
||||
}
|
||||
73
env/.config/nvim/lua/plugins/xcodebuild.lua
vendored
73
env/.config/nvim/lua/plugins/xcodebuild.lua
vendored
@@ -1,73 +0,0 @@
|
||||
local progress_handle
|
||||
|
||||
return {
|
||||
"wojciech-kulik/xcodebuild.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
show_build_progress_bar = false,
|
||||
logs = {
|
||||
auto_open_on_success_tests = false,
|
||||
auto_open_on_failed_tests = false,
|
||||
auto_open_on_success_build = false,
|
||||
auto_open_on_failed_build = false,
|
||||
auto_focus = false,
|
||||
auto_close_on_app_launch = true,
|
||||
only_summary = true,
|
||||
notify = function(message, severity)
|
||||
local fidget = require("fidget")
|
||||
if progress_handle then
|
||||
progress_handle.message = message
|
||||
if not message:find("Loading") then
|
||||
progress_handle:finish()
|
||||
progress_handle = nil
|
||||
if vim.trim(message) ~= "" then
|
||||
fidget.notify(message, severity)
|
||||
end
|
||||
end
|
||||
else
|
||||
fidget.notify(message, severity)
|
||||
end
|
||||
end,
|
||||
notify_progress = function(message)
|
||||
local progress = require("fidget.progress")
|
||||
|
||||
if progress_handle then
|
||||
progress_handle.title = ""
|
||||
progress_handle.message = message
|
||||
else
|
||||
progress_handle = progress.handle.create({
|
||||
message = message,
|
||||
lsp_client = { name = "xcodebuild.nvim" },
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
code_coverage = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>X", "<cmd>XcodebuildPicker<cr>", desc = "Show Xcodebuild Actions" },
|
||||
{ "<leader>xf", "<cmd>XcodebuildProjectManager<cr>", desc = "Show Project Manager Actions" },
|
||||
{ "<leader>xb", "<cmd>XcodebuildBuild<cr>", desc = "Build Project" },
|
||||
{ "<leader>xB", "<cmd>XcodebuildBuildForTesting<cr>", desc = "Build For Testing" },
|
||||
{ "<leader>xr", "<cmd>XcodebuildBuildRun<cr>", desc = "Build & Run Project" },
|
||||
{ "<leader>xt", "<cmd>XcodebuildTest<cr>", desc = "Run Tests" },
|
||||
{ "<leader>xt", "<cmd>XcodebuildTestSelected<cr>", desc = "Run Selected Tests" },
|
||||
{ "<leader>xT", "<cmd>XcodebuildTestClass<cr>", desc = "Run This Test Class" },
|
||||
{ "<leader>xl", "<cmd>XcodebuildToggleLogs<cr>", desc = "Toggle Xcodebuild Logs" },
|
||||
{ "<leader>xc", "<cmd>XcodebuildToggleCodeCoverage<cr>", desc = "Toggle Code Coverage" },
|
||||
{ "<leader>xC", "<cmd>XcodebuildShowCodeCoverageReport<cr>", desc = "Show Code Coverage Report" },
|
||||
{ "<leader>xe", "<cmd>XcodebuildTestExplorerToggle<cr>", desc = "Toggle Test Explorer" },
|
||||
{ "<leader>xs", "<cmd>XcodebuildFailingSnapshots<cr>", desc = "Show Failing Snapshots" },
|
||||
{ "<leader>xd", "<cmd>XcodebuildSelectDevice<cr>", desc = "Select Device" },
|
||||
{ "<leader>xp", "<cmd>XcodebuildSelectTestPlan<cr>", desc = "Select Test Plan" },
|
||||
{ "<leader>xq", "<cmd>Telescope quickfix<cr", desc = "Show QuickFix List" },
|
||||
{ "<leader>xx", "<cmd>XcodebuildQuickfixLine<cr>", desc = "Quickfix Line" },
|
||||
{ "<leader>xa", "<cmd>XcodebuildCodeActions<cr>", desc = "Show Code Actions" },
|
||||
},
|
||||
}
|
||||
17
env/.config/nvim/snippets/init.lua
vendored
17
env/.config/nvim/snippets/init.lua
vendored
@@ -1,17 +0,0 @@
|
||||
-- Setup snippets here.
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local ms = ls.multi_snippet
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local t = ls.text_node
|
||||
|
||||
ls.add_snippets("lua", {
|
||||
s("hello", {
|
||||
t('print("hello '),
|
||||
i(1),
|
||||
t(' world")'),
|
||||
}),
|
||||
})
|
||||
41
env/.config/nvim/snippets/lua.lua
vendored
41
env/.config/nvim/snippets/lua.lua
vendored
@@ -1,41 +0,0 @@
|
||||
-- Setup snippets here.
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local ms = ls.multi_snippet
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local t = ls.text_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
|
||||
ls.add_snippets("lua", {
|
||||
-- Setup a new snippet file.
|
||||
s("sf", {
|
||||
t({
|
||||
"-- Setup snippets.",
|
||||
'local ls = require("luasnip")',
|
||||
"local s = ls.snippet",
|
||||
"local sn = ls.snippet_node",
|
||||
"local ms = ls.multi_snippet",
|
||||
"local i = ls.insert_node",
|
||||
"local f = ls.function_node",
|
||||
"local c = ls.choice_node",
|
||||
"local t = ls.text_node",
|
||||
"-- Add snippets",
|
||||
}),
|
||||
t('ls.add_snippets("'),
|
||||
i(1, "<file-type>"),
|
||||
t({
|
||||
'", {',
|
||||
"\t-- Define snippets here.",
|
||||
"})",
|
||||
}),
|
||||
}),
|
||||
s("c", {
|
||||
c(1, {
|
||||
fmt("{}", { i(1), t("debug") }),
|
||||
fmt("{}", { i(1), t("warning") }),
|
||||
}),
|
||||
}),
|
||||
})
|
||||
131
env/.config/nvim/snippets/swift.lua
vendored
131
env/.config/nvim/snippets/swift.lua
vendored
@@ -1,131 +0,0 @@
|
||||
-- Setup snippets.
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local ms = ls.multi_snippet
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local t = ls.text_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local rep = require("luasnip.extras").rep
|
||||
-- Add snippets
|
||||
ls.add_snippets("swift", {
|
||||
-- Add a dependency snippet.
|
||||
s({ trig = "@d", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })),
|
||||
|
||||
-- Add a dependency client.
|
||||
s(
|
||||
{
|
||||
trig = "@dc",
|
||||
desc = "Add a dependency client.",
|
||||
},
|
||||
fmt(
|
||||
[[
|
||||
public extension DependencyValues {{
|
||||
var {}: {} {{
|
||||
get {{ self[{}.self] }}
|
||||
set {{ self[{}.self] = newValue }}
|
||||
}}
|
||||
}}
|
||||
|
||||
@DependencyClient
|
||||
public struct {} {{
|
||||
|
||||
// Insert interface here.
|
||||
{}
|
||||
}}
|
||||
|
||||
extension {}: TestDependencyKey {{
|
||||
public static let testValue: {} = Self()
|
||||
}}
|
||||
|
||||
]],
|
||||
{
|
||||
i(1, "<name>"),
|
||||
i(2, "<Dependency>"),
|
||||
rep(2),
|
||||
rep(2),
|
||||
rep(2),
|
||||
i(0),
|
||||
rep(2),
|
||||
rep(2),
|
||||
}
|
||||
)
|
||||
),
|
||||
|
||||
s(
|
||||
{ trig = "str", desc = "Add a struct" },
|
||||
fmt(
|
||||
[[
|
||||
struct {}: {} {{
|
||||
{}
|
||||
}}
|
||||
]],
|
||||
{ i(1, "<Name>"), i(2, "<Protocols>"), i(0) }
|
||||
)
|
||||
),
|
||||
|
||||
-- Decorate a type or function with an @_spi(...)
|
||||
s({ trig = "@_s", desc = "Add spi modifier." }, fmt("@_spi({})", { i(1, "name") })),
|
||||
|
||||
-- Add an @_spi(...) import ...
|
||||
s(
|
||||
{ trig = "@_si", desc = "Import with spi." },
|
||||
fmt(
|
||||
[[
|
||||
@_spi({}) import {}
|
||||
{}
|
||||
]],
|
||||
{ i(1, "name"), i(2, "module"), i(0) }
|
||||
)
|
||||
),
|
||||
|
||||
-- Document a function
|
||||
-- TODO: add dynamic number of prameters.
|
||||
s(
|
||||
{ trig = "docf", desc = "Document a function." },
|
||||
fmt(
|
||||
[[
|
||||
/// {}
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - {}: {}
|
||||
]],
|
||||
{ i(1, "A short description."), i(2, "<param>"), i(3, "Describe the parameter.") }
|
||||
)
|
||||
),
|
||||
|
||||
-- Add a parameter to a documentation string.
|
||||
s(
|
||||
{ trig = "param", desc = "Add a parameter to documentation" },
|
||||
fmt(
|
||||
[[
|
||||
/// - {}: {}
|
||||
]],
|
||||
{ i(1, "<param>"), i(2, "<description>") }
|
||||
)
|
||||
),
|
||||
|
||||
-- Add a withDependencies
|
||||
s(
|
||||
{ trig = "wd", desc = "withDependencies" },
|
||||
fmt(
|
||||
[[
|
||||
withDependencies {{
|
||||
$0.{} = {}
|
||||
}} operation: {{
|
||||
@Dependency(\.{}) var {}
|
||||
{}
|
||||
}}
|
||||
]],
|
||||
{
|
||||
i(1, "<dependency>"),
|
||||
i(2, "<override>"),
|
||||
rep(1),
|
||||
rep(1),
|
||||
i(0),
|
||||
}
|
||||
)
|
||||
),
|
||||
})
|
||||
21
env/.config/nvim/spell/en.utf-8.add
vendored
21
env/.config/nvim/spell/en.utf-8.add
vendored
@@ -1,21 +0,0 @@
|
||||
MeasureQuick
|
||||
Housh
|
||||
sealtite
|
||||
Subcool
|
||||
OEM
|
||||
NEC
|
||||
AHJ
|
||||
CFM
|
||||
Hydronic
|
||||
subpar
|
||||
quo
|
||||
IAQ
|
||||
wc
|
||||
HVAC
|
||||
dehumidification
|
||||
ansible
|
||||
orchestrator
|
||||
ethernet
|
||||
unifi
|
||||
wildcard
|
||||
Housh
|
||||
BIN
env/.config/nvim/spell/en.utf-8.add.spl
vendored
BIN
env/.config/nvim/spell/en.utf-8.add.spl
vendored
Binary file not shown.
3
env/.config/nvim/stylua.toml
vendored
3
env/.config/nvim/stylua.toml
vendored
@@ -1,3 +0,0 @@
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
column_width = 120
|
||||
7
env/.config/ripgrep/ripgreprc
vendored
Normal file
7
env/.config/ripgrep/ripgreprc
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Show hidden files
|
||||
--hidden
|
||||
# Ignore '.git' directory
|
||||
--glob=!.git/*
|
||||
--no-follow
|
||||
--color=never
|
||||
|
||||
7
env/.config/systemd/user/tmux-kill-sessions.service
vendored
Normal file
7
env/.config/systemd/user/tmux-kill-sessions.service
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
[Unit]
|
||||
Description=Tmux kill sessions service
|
||||
After=graphical-session.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=%h/.local/scripts/tmux-kill-old-sessions
|
||||
11
env/.config/systemd/user/tmux-kill-sessions.timer
vendored
Normal file
11
env/.config/systemd/user/tmux-kill-sessions.timer
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Tmux kill sessions timer
|
||||
Requires=tmux-kill-sessions.service
|
||||
|
||||
[Timer]
|
||||
OnBootSec=2h
|
||||
OnUnitActiveSec=2h
|
||||
AccuracySec=10sec
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
138
env/.config/walker/config.toml
vendored
138
env/.config/walker/config.toml
vendored
@@ -1,138 +0,0 @@
|
||||
force_keyboard_focus = true # forces keyboard forcus to stay in Walker
|
||||
close_when_open = true # close walker when invoking while already opened
|
||||
selection_wrap = false # wrap list if at bottom or top
|
||||
global_argument_delimiter = "#" # query: firefox#https://benz.dev => part after delimiter will be ignored when querying. this should be the same as in the elephant config
|
||||
keep_open_modifier = "shift" # won't close on activation, but rather select the next item in the list
|
||||
exact_search_prefix = "'" # disable fuzzy searching
|
||||
theme = "default" # theme to use
|
||||
disable_mouse = false # disable mouse (on input and list only)
|
||||
|
||||
[shell]
|
||||
anchor_top = true
|
||||
anchor_bottom = true
|
||||
anchor_left = true
|
||||
anchor_right = true
|
||||
|
||||
[placeholders]
|
||||
"default" = { input = "Search", list = "No Results" } # placeholders for input and empty list, key is the providers name, so f.e. "desktopapplications" or "menus:other"
|
||||
|
||||
# [keybinds]
|
||||
# close = "Escape"
|
||||
# next = "Down"
|
||||
# previous = "Up"
|
||||
# toggle_exact = "ctrl e"
|
||||
# resume_last_query = "ctrl r"
|
||||
# quick_activate = ["F1", "F2", "F3", "F4"]
|
||||
|
||||
[providers]
|
||||
default = [
|
||||
"desktopapplications",
|
||||
"calc",
|
||||
"runner",
|
||||
"menus",
|
||||
"websearch",
|
||||
] # providers to be queried by default
|
||||
empty = ["desktopapplications"] # providers to be queried when query is empty
|
||||
|
||||
[[providers.prefixes]]
|
||||
prefix = ";"
|
||||
provider = "providerlist"
|
||||
|
||||
[[providers.prefixes]]
|
||||
prefix = "/"
|
||||
provider = "files"
|
||||
|
||||
[[providers.prefixes]]
|
||||
prefix = "."
|
||||
provider = "symbols"
|
||||
|
||||
[[providers.prefixes]]
|
||||
prefix = "!"
|
||||
provider = "todo"
|
||||
|
||||
[[providers.prefixes]]
|
||||
prefix = "="
|
||||
provider = "calc"
|
||||
|
||||
[[providers.prefixes]]
|
||||
prefix = "@"
|
||||
provider = "websearch"
|
||||
|
||||
[[providers.prefixes]]
|
||||
prefix = ":"
|
||||
provider = "clipboard"
|
||||
|
||||
[providers.archlinuxpkgs]
|
||||
default = "install"
|
||||
install = "Return"
|
||||
remove = "ctrl d"
|
||||
|
||||
[providers.calc]
|
||||
default = "copy"
|
||||
copy = "Return"
|
||||
save = "ctrl s"
|
||||
delete = "ctrl d"
|
||||
|
||||
[providers.websearch]
|
||||
default = "search"
|
||||
search = "Return"
|
||||
remove_history = "ctrl BackSpace"
|
||||
|
||||
[providers.providerlist]
|
||||
default = "activate"
|
||||
activate = "Return"
|
||||
|
||||
[providers.clipboard]
|
||||
time_format = "%d.%m. - %H:%M" # format for the clipboard item date
|
||||
default = "copy"
|
||||
copy = "Return"
|
||||
delete = "ctrl d"
|
||||
edit = "ctrl o"
|
||||
toggle_images_only = "ctrl i"
|
||||
|
||||
[providers.desktopapplications]
|
||||
default = "start"
|
||||
start = "Return"
|
||||
start_keep_open = "shift Return"
|
||||
remove_history = "ctrl BackSpace"
|
||||
toggle_pin = "ctrl p"
|
||||
|
||||
[providers.files]
|
||||
default = "open"
|
||||
open = "Return"
|
||||
open_dir = "ctrl Return"
|
||||
copy_path = "ctrl shift c"
|
||||
copy_file = "ctrl c"
|
||||
|
||||
[providers.todo]
|
||||
default = "save"
|
||||
save = "Return"
|
||||
delete = "ctrl d"
|
||||
mark_active = "ctrl a"
|
||||
mark_done = "ctrl f"
|
||||
clear = "ctrl x"
|
||||
|
||||
[providers.runner]
|
||||
default = "start"
|
||||
start = "Return"
|
||||
start_terminal = "shift Return"
|
||||
remove_history = "ctrl BackSpace"
|
||||
|
||||
[providers.dmenu]
|
||||
default = "select"
|
||||
select = "Return"
|
||||
|
||||
[providers.symbols]
|
||||
default = "copy"
|
||||
copy = "Return"
|
||||
remove_history = "ctrl BackSpace"
|
||||
|
||||
[providers.unicode]
|
||||
default = "copy"
|
||||
copy = "Return"
|
||||
remove_history = "ctrl BackSpace"
|
||||
|
||||
[providers.menus]
|
||||
default = "activate"
|
||||
activate = "Return"
|
||||
remove_history = "ctrl BackSpace"
|
||||
9
env/.config/waybar/config.jsonc
vendored
9
env/.config/waybar/config.jsonc
vendored
@@ -6,6 +6,7 @@
|
||||
"modules-center": ["clock"],
|
||||
"modules-right": [
|
||||
"pulseaudio",
|
||||
"idle_inhibitor",
|
||||
"tray",
|
||||
"cpu",
|
||||
"memory",
|
||||
@@ -76,4 +77,12 @@
|
||||
// "format-full": "",
|
||||
"format-icons": ["", "", "", "", ""],
|
||||
},
|
||||
"idle_inhibitor": {
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"activated": "",
|
||||
"deactivated": ""
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
env/.config/waybar/style.css
vendored
9
env/.config/waybar/style.css
vendored
@@ -54,7 +54,8 @@
|
||||
#cpu,
|
||||
#memory,
|
||||
#custom-lock,
|
||||
#custom-power {
|
||||
#custom-power,
|
||||
#idle_inhibitor {
|
||||
background-color: @background;
|
||||
padding: 0.5rem 1rem;
|
||||
margin: 5px 0;
|
||||
@@ -69,12 +70,18 @@
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
|
||||
#pulseaudio {
|
||||
color: @red;
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
#idle_inhibitor {
|
||||
border-radius: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#tray {
|
||||
color: @blue;
|
||||
border-radius: 0px 10px 10px 0px;
|
||||
|
||||
33
env/.config/zsh/.zshrc
vendored
33
env/.config/zsh/.zshrc
vendored
@@ -19,17 +19,6 @@ zle -N down-line-or-beginning-search
|
||||
# Colors
|
||||
autoload -Uz colors && colors
|
||||
|
||||
#------------------------------ pager ------------------------------
|
||||
#eval "$(batman --export-env)"
|
||||
# export LESS_TERMCAP_mb="[35m" # magenta
|
||||
# export LESS_TERMCAP_md="[33m" # yellow
|
||||
# export LESS_TERMCAP_me=""
|
||||
# export LESS_TERMCAP_se=""
|
||||
# export LESS_TERMCAP_so="[34m" # blue
|
||||
# export LESS_TERMCAP_ue=""
|
||||
# export LESS_TERMCAP_so="[4m" # underline
|
||||
# export LESSHISTFILE="-"
|
||||
|
||||
#------------------------------ path ------------------------------
|
||||
|
||||
# Helper function to prepend to the $PATH
|
||||
@@ -70,7 +59,8 @@ path_prepend \
|
||||
"$SCRIPTS/mail" \
|
||||
"$HOME/.local/pnpm" \
|
||||
"$CARGO_HOME/bin" \
|
||||
"$HOME/.local/bin"
|
||||
"$HOME/.local/bin" \
|
||||
"$XDG_DATA_HOME/bob/nvim-bin"
|
||||
|
||||
# last arg will be first in $FPATH
|
||||
fpath_prepend \
|
||||
@@ -96,8 +86,6 @@ export HISTFILESIZE=5000
|
||||
export SAVEHIST=5000
|
||||
export HISTFILE="$XDG_CONFIG_HOME/zsh/history"
|
||||
|
||||
#set -o vi
|
||||
|
||||
#------------------------------ cdpath ------------------------------
|
||||
setopt autocd
|
||||
|
||||
@@ -131,7 +119,6 @@ zsh_add_plugin "Aloxaf/fzf-tab"
|
||||
|
||||
#------------------------------ completions ------------------------------
|
||||
# case insensitive path-completion
|
||||
#zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
|
||||
|
||||
# partial completion suggestions
|
||||
@@ -153,10 +140,8 @@ _source_if "$ZDOTDIR/plugins/fzf-tab/fzf-tab.plugin.zsh"
|
||||
|
||||
#------------------------------ prompt ------------------------------
|
||||
|
||||
# Prompt / managed by brew. (`brew install starship`)
|
||||
autoload -Uz promptinit; promptinit
|
||||
eval "$(starship init zsh)"
|
||||
#prompt pure
|
||||
|
||||
#------------------------------ aliases ------------------------------
|
||||
|
||||
@@ -190,8 +175,10 @@ alias pass='PASSWORD_STORE_DIR=/home/michael/.local/share/gopass/stores/root gop
|
||||
alias pc='gopass show --clip' # get an attribute of a password file and copy to the clipboard.
|
||||
alias reload='exec zsh -l' # reload the shell, useful when making changes.
|
||||
alias s='swift' # shorthand to access swift commands
|
||||
alias st='swift test' # swift test
|
||||
alias st='swift test' # swift test
|
||||
alias ste='swift test --enable-code-coverage' # swift test with code coverage enabled.
|
||||
alias sb='swift build' # swift build
|
||||
alias syu='yay -Syu' # Update packages.
|
||||
alias t='tmux' # access tmux quickly
|
||||
alias tka='tmux kill-server' # kill tmux server and all sessions.
|
||||
alias ts='$SCRIPTS/tmux-sessionator' # create new tmux session, fuzzy finding common locations.
|
||||
@@ -201,11 +188,7 @@ alias tks='tmux kill-session -t' # kill tmux session
|
||||
alias temp='cd $(mktemp -d)' # create a temporary directory and move into it.
|
||||
alias vi='nvim' # set vi to open neovim
|
||||
alias newf='"$SCRIPTS"/newx --function' # generate a new shell function
|
||||
alias nlnv='nvim "$LOCAL_ENV"' # open local environment overrides file in neovime
|
||||
alias nvim='unset VIMINIT && unset MYVIMRC && nvim' # alias nvim to unset vimrc, useful when using both vim & neovim
|
||||
alias nvim-mhoush='NVIM_APPNAME=m-housh && nvim' # set neovim to use my config.
|
||||
alias nvim-kickstart='NVIM_APPNAME=kickstart nvim' # set neovim to use kickstart config.
|
||||
alias nvim-lazy='NVIM_APPNAME=lazy nvim' # set neovim to use lazy config.
|
||||
alias n='nvim'
|
||||
alias wget="wget --hsts-file=$XDG_DATA_HOME/wget-hsts" # set wget history location.
|
||||
# GPG Yubikey restart relearn when switching keys and stubbed.
|
||||
alias yubikeyrestart='gpg-connect-agent killagent /bye && gpg-connect-agent "scd serialno" "learn --force" /bye && gpg --card-status'
|
||||
@@ -225,6 +208,7 @@ source <(fzf --zsh)
|
||||
_source_if "$ZDOTDIR/.zshrc-local"
|
||||
_source_if "$LOCAL_ENV"
|
||||
_source_if "$SCRIPTS/catppuccin-colors"
|
||||
_source_if "$XDG_DATA_HOME/swiftly/env.sh"
|
||||
|
||||
# pnpm
|
||||
export PNPM_HOME="$XDG_DATA_HOME/pnpm"
|
||||
@@ -235,12 +219,9 @@ esac
|
||||
# pnpm end
|
||||
|
||||
# The following lines have been added by Docker Desktop to enable Docker CLI completions.
|
||||
# fpath=(/Users/michael/.docker/completions $fpath)
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
#eval "$(ssh-agent -s)" 1>/dev/null
|
||||
|
||||
########################################
|
||||
# Set things up for using gpg-agent
|
||||
|
||||
|
||||
10
env/.config/zsh/functions/dp
vendored
10
env/.config/zsh/functions/dp
vendored
@@ -1,12 +1,12 @@
|
||||
#!/bin/zsh
|
||||
|
||||
function dp() {
|
||||
[ -z "$1" ] && echo "Must supply temperature" && return 1
|
||||
[ -z "$2" ] && echo "Must supply relative humidity" && return 1
|
||||
[ -z "$1" ] && echo "Must supply temperature" && return 1
|
||||
[ -z "$2" ] && echo "Must supply relative humidity" && return 1
|
||||
|
||||
local temperature=$1
|
||||
local humidity=$2
|
||||
local temperature=$1
|
||||
local humidity=$2
|
||||
|
||||
/opt/homebrew/bin/psychrometrics dew-point --dry-bulb "$temperature" --relative-humidity "$humidity"
|
||||
psychrometrics dew-point --dry-bulb "$temperature" --relative-humidity "$humidity"
|
||||
|
||||
}
|
||||
|
||||
25
env/.config/zsh/functions/n
vendored
25
env/.config/zsh/functions/n
vendored
@@ -1,25 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# Open's neovim.
|
||||
#
|
||||
# If the argument passed in is a directory or not supplied, then
|
||||
# open neovim with telescope find files opened. Otherwise open the
|
||||
# file that is supplied.
|
||||
#
|
||||
|
||||
function n() {
|
||||
# if [ -z "$1" ]; then
|
||||
# local gitdir=$(git rev-parse --show-toplevel 2> /dev/null)
|
||||
#
|
||||
# [ -n "$gitdir" ] \
|
||||
# && nvim -c ":Telescope git_files" \
|
||||
# && return 0
|
||||
#
|
||||
# [ -d "$1" ] \
|
||||
# && nvim -c ":Telescope find_files" \
|
||||
# && return 0
|
||||
# fi
|
||||
|
||||
nvim "$@"
|
||||
}
|
||||
|
||||
10
env/.gnupg/gpg-agent.conf
vendored
10
env/.gnupg/gpg-agent.conf
vendored
@@ -2,13 +2,5 @@
|
||||
# https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html
|
||||
enable-ssh-support
|
||||
ttyname $GPG_TTY
|
||||
default-cache-ttl 60
|
||||
default-cache-ttl 120
|
||||
max-cache-ttl 120
|
||||
#pinentry-program /usr/bin/pinentry-curses
|
||||
#pinentry-program /usr/bin/pinentry-gnome3
|
||||
#pinentry-program /bin/pinentry-tty
|
||||
#pinentry-program /usr/bin/pinentry-x11
|
||||
#pinentry-program /usr/local/bin/pinentry-curses
|
||||
#pinentry-program /bin/pinentry-dmenu
|
||||
|
||||
#pinentry-program /opt/homebrew/bin/pinentry-mac
|
||||
|
||||
47
env/.local/scripts/aap
vendored
Executable file
47
env/.local/scripts/aap
vendored
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# A wrapper script to run swift-hpa in a docker container and
|
||||
# mount the correct volumes, etc.
|
||||
#
|
||||
# Make sure to run 'hpa-init' first on this machine to setup
|
||||
# dependencies, if you have not done so already.
|
||||
#
|
||||
# To attach to a shell inside the container run:
|
||||
# `hpa bash`
|
||||
#
|
||||
# To run ansible vault commands inside the container run:
|
||||
# `hpa ansible-vault ...`
|
||||
#
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
. "$SCRIPTS/utils/hpa/hpa.env"
|
||||
|
||||
############################## MAIN ##############################
|
||||
|
||||
# Don't pull images if they're prefixed with 'localhost'.
|
||||
if echo "$HPA_DOCKER_IMAGE" | grep -vq "localhost"; then
|
||||
|
||||
# Check if we should pull the image prior to running.
|
||||
last_pull="0"
|
||||
if [[ -f "$HPA_AIRFLOW_CONFIG_DIR/.lastpull" ]]; then
|
||||
last_pull=$(cat "$HPA_AIRFLOW_CONFIG_DIR/.lastpull")
|
||||
fi
|
||||
curr=$(date +%s)
|
||||
diff=$((curr - last_pull))
|
||||
|
||||
if [[ $HPA_AUTO_PULL == "1" ]] && [[ $diff -gt "$HPA_AUTO_PULL_INTERVAL" ]]; then
|
||||
. "$SCRIPTS/hpa-pull" "$HPA_AUTO_PULL_OPTS"
|
||||
fi
|
||||
fi
|
||||
|
||||
podman run --rm --interactive --tty \
|
||||
--volume "$HPA_AIRFLOW_CONFIG_DIR":/root/.config/hpa:ro \
|
||||
--volume "$HPA_DATA_DIR":/root/.local/share/hpa:ro \
|
||||
--volume "$HPA_CONSULTS_DIR":/consults \
|
||||
--volume "$PWD":/root/project \
|
||||
--secret "$HPA_VAULT_SECRET_KEY" \
|
||||
"$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG" "$@"
|
||||
68
env/.local/scripts/backup-logger
vendored
Executable file
68
env/.local/scripts/backup-logger
vendored
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
LOG_DIR="/tmp/logs"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
|
||||
Utility for logging backup runs.
|
||||
|
||||
USAGE:
|
||||
$ $THIS <flags> <msg...>
|
||||
|
||||
FLAGS:
|
||||
-h | --help: Show this help page.
|
||||
-s | --show: Show the log messages.
|
||||
--rm: Remove the log file
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
show() {
|
||||
[[ ! -f "$LOG_DIR/$LOG_FILE" ]] &&
|
||||
log --warning "Empty log file." &&
|
||||
exit 0
|
||||
|
||||
bat "$LOG_DIR/$LOG_FILE"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
declare -a msg
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "-s" ]] || [[ $1 == "--show" ]]; then
|
||||
show && exit 0
|
||||
elif [[ $1 == "--rm" ]]; then
|
||||
rm "$LOG_DIR/$LOG_FILE" && exit 0
|
||||
else
|
||||
msg+=("$1")
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
[[ -z "${msg[*]}" ]] && log --error "No message passed to log." && exit 1
|
||||
|
||||
log "${msg[@]}"
|
||||
69
env/.local/scripts/hpa
vendored
69
env/.local/scripts/hpa
vendored
@@ -1,38 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# A wrapper script to run swift-hpa in a docker container and
|
||||
# mount the correct volumes, etc.
|
||||
#
|
||||
# Make sure to run 'hpa-init' first on this machine to setup
|
||||
# dependencies, if you have not done so already.
|
||||
#
|
||||
# To attach to a shell inside the container run:
|
||||
# `hpa bash`
|
||||
#
|
||||
# To run ansible vault commands inside the container run:
|
||||
# `hpa ansible-vault ...`
|
||||
#
|
||||
|
||||
DOCKER_IMAGE="git.housh.dev/michael/swift-hpa:latest"
|
||||
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
||||
CONSULT_TEMPLATE_DIR="$XDG_DATA_HOME/hpa/template"
|
||||
CONSULT_TEMPLATE_URL="ssh://git@git.housh.dev:2222/hhe/consult-template.git"
|
||||
HPA_PLAYBOOK_DIR="$XDG_DATA_HOME/hpa/playbook"
|
||||
HPA_PLAYBOOK_URL="ssh://git@git.housh.dev:2222/michael/ansible-hpa-playbook.git"
|
||||
HPA_CONFIG_DIR="$XDG_CONFIG_HOME/hpa"
|
||||
CONSULTS_DIR=${CONSULTS_DIR:-$HOME/work/consults}
|
||||
HPA_VAULT_SECRET_KEY="${HPA_VAULT_SECRET_KEY:-vault-pass}"
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
. "$SCRIPTS/utils/hpa/hpa.env"
|
||||
|
||||
echoerr() {
|
||||
echo -e "\e[31m[ERROR]:\e[0m $*"
|
||||
}
|
||||
############################## MAIN ##############################
|
||||
|
||||
# Ensure the dependencies are installed / setup.
|
||||
[[ "$(podman secret exists $HPA_VAULT_SECRET_KEY)" == "1" ]] &&
|
||||
echoerr "Valut secret needs to be set for key: '$HPA_VAULT_SECRET_KEY'\nUse 'podman secret create '$HPA_VAULT_SECRET_KEY'" &&
|
||||
exit 1
|
||||
[[ ! -d $CONSULTS_DIR ]] && mkdir -p "$CONSULTS_DIR"
|
||||
[[ ! -d "$XDG_DATA_HOME/hpa" ]] && mkdir "$XDG_DATA_HOME/hpa"
|
||||
[[ ! -d "$HPA_PLAYBOOK_DIR" ]] && git clone "$HPA_PLAYBOOK_URL" "$HPA_PLAYBOOK_DIR"
|
||||
[[ ! -d "$CONSULT_TEMPLATE_DIR" ]] && git clone "$CONSULT_TEMPLATE_URL" "$CONSULT_TEMPLATE_DIR"
|
||||
# Don't pull images if they're prefixed with 'localhost'.
|
||||
if echo "$HPA_DOCKER_IMAGE" | grep -vq "localhost"; then
|
||||
|
||||
podman run --rm -it \
|
||||
-v "$CONSULT_TEMPLATE_DIR":/template \
|
||||
-v "$HPA_PLAYBOOK_DIR":/playbook \
|
||||
-v "$HPA_CONFIG_DIR":/config \
|
||||
-v "$CONSULTS_DIR":/consults \
|
||||
--secret "$HPA_VAULT_SECRET_KEY" \
|
||||
"$DOCKER_IMAGE" \
|
||||
"$@"
|
||||
# Check if we should pull the image prior to running.
|
||||
last_pull="0"
|
||||
if [[ -f "$HPA_CONFIG_DIR/.lastpull" ]]; then
|
||||
last_pull=$(cat "$HPA_CONFIG_DIR/.lastpull")
|
||||
fi
|
||||
curr=$(date +%s)
|
||||
diff=$((curr - last_pull))
|
||||
|
||||
if [[ $HPA_AUTO_PULL == "1" ]] && [[ $diff -gt "$HPA_AUTO_PULL_INTERVAL" ]]; then
|
||||
. "$SCRIPTS/hpa-pull" "$HPA_AUTO_PULL_OPTS"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "ARGS: $@"
|
||||
|
||||
podman run --rm --interactive --tty \
|
||||
--volume "$HPA_CONFIG_DIR":/root/.config/hpa:ro \
|
||||
--volume "$HPA_DATA_DIR":/root/.local/share/hpa:ro \
|
||||
--volume "$HPA_CONSULTS_DIR":/consults \
|
||||
--volume "$PWD":/root/project \
|
||||
--secret "$HPA_VAULT_SECRET_KEY" \
|
||||
"$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG" "$@"
|
||||
|
||||
11
env/.local/scripts/hpa-create
vendored
Executable file
11
env/.local/scripts/hpa-create
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
title="Creating project..."
|
||||
script="${SCRIPTS:-$HOME/.local/scripts}/utils/hpa/hpa-create"
|
||||
first_arg=${1:-""}
|
||||
if [[ $first_arg == "-h" ]] || [[ $first_arg == "--help" ]]; then
|
||||
. "$script" $*
|
||||
else
|
||||
# bash -c "$script $*" | tr -d '\r' | head -1
|
||||
gum spin --show-output --title "$title" -- bash -c "$script $*" | tr -d '\r' | head -1
|
||||
fi
|
||||
98
env/.local/scripts/hpa-init
vendored
Executable file
98
env/.local/scripts/hpa-init
vendored
Executable file
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
|
||||
# Load environment / shared variables.
|
||||
. "$SCRIPTS/utils/hpa/hpa.env"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
|
||||
Setup dependencies for running hpa script in docker. This only needs to be
|
||||
ran once on a new machine.
|
||||
|
||||
USAGE:
|
||||
$ $THIS <flags> <shell> <completion-file>
|
||||
|
||||
FLAGS:
|
||||
-h | --help: Show this help page.
|
||||
|
||||
DEFAULTS:
|
||||
shell: Default is 'zsh', accepts 'zsh' | 'bash' | 'fish'
|
||||
completion-file: Default is '~/.zsh/completions/_hpa'
|
||||
|
||||
ENVIRONMENT:
|
||||
CONSULTS_DIR: Set the directory where consults / projects are stored.
|
||||
(default: '~/work/consults')
|
||||
|
||||
HPA_DOCKER_TAG: Set the docker image tag to use for the hpa docker image
|
||||
(default: 'latest')
|
||||
|
||||
HPA_VAULT_SECRET_KEY: Set the key used for the ansible-vault secret.
|
||||
(default: 'vault-pass')
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
generate-completion() {
|
||||
local output_dir output type
|
||||
type=${1:-"zsh"}
|
||||
output=${2:-$HOME/.zsh/completions/_hpa}
|
||||
output_dir=$(dirname "$output")
|
||||
|
||||
log "Generating completion: type: '$type', to: $output"
|
||||
|
||||
[[ ! -d "$output_dir" ]] && mkdir -p "$output_dir"
|
||||
(
|
||||
podman run --rm -it "$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG" \
|
||||
--generate-completion-script "$type" |
|
||||
tr -d '\r'
|
||||
) >"$output"
|
||||
}
|
||||
|
||||
generate-secret() {
|
||||
log "Generating vault secret for key: '$HPA_VAULT_SECRET_KEY'"
|
||||
local secret
|
||||
secret="$(pass -c ansible/vault-pass)"
|
||||
printf "%s" "$secret" | podman secret create "$HPA_VAULT_SECRET_KEY" -
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
first_arg=${1:-""}
|
||||
if [[ $first_arg == "-h" ]] || [[ $first_arg == "--help" ]]; then
|
||||
usage && exit 0
|
||||
else
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
log "Starting init..."
|
||||
|
||||
generate-completion "$@"
|
||||
generate-secret
|
||||
|
||||
log "Generating directories, if they don't exist."
|
||||
mkdir -p "$HPA_CONSULTS_DIR" &>/dev/null
|
||||
mkdir "$HPA_DATA_DIR" &>/dev/null
|
||||
|
||||
log "Cloning required template and playbook, if they don't exist"
|
||||
[[ ! -d "$HPA_PLAYBOOK_DIR" ]] && git clone "$HPA_PLAYBOOK_URL" "$HPA_PLAYBOOK_DIR"
|
||||
[[ ! -d "$HPA_CONSULT_TEMPLATE_DIR" ]] && git clone "$HPA_CONSULT_TEMPLATE_URL" "$HPA_CONSULT_TEMPLATE_DIR"
|
||||
[[ ! -d "$HPA_AIRFLOW_TEMPLATE_DIR" ]] && git clone "$HPA_AIRFLOW_TEMPLATE_URL" "$HPA_AIRFLOW_TEMPLATE_DIR"
|
||||
fi
|
||||
112
env/.local/scripts/hpa-pull
vendored
Executable file
112
env/.local/scripts/hpa-pull
vendored
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
# Load environment / shared variables.
|
||||
. "$SCRIPTS/utils/hpa/hpa.env"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
|
||||
Pulls / updates template, playbook, docker image, etc.
|
||||
|
||||
USAGE:
|
||||
$ $THIS <flags>
|
||||
|
||||
FLAGS:
|
||||
-a | --all: Pull everything (default).
|
||||
-d | --docker: Pull docker image.
|
||||
-p | --playbook: Pull ansible-hpa-playbook.
|
||||
-t | --template: Pull consult template.
|
||||
-h | --help: Show this help page.
|
||||
|
||||
If no flags are passed in then we will pull everything.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
pull-repo() {
|
||||
local dir=${1:-""}
|
||||
[[ -z "$dir" ]] &&
|
||||
log --error "Directory not supplied to pull git repo." &&
|
||||
exit 1
|
||||
|
||||
pushd "$dir" &>/dev/null || exit 1
|
||||
(
|
||||
git pull
|
||||
)
|
||||
popd &>/dev/null
|
||||
}
|
||||
|
||||
pull-docker() {
|
||||
log --echo "Pulling docker image: '$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG'"
|
||||
podman pull "$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG"
|
||||
}
|
||||
|
||||
pull-playbook() {
|
||||
log --echo "Pulling playbook: '$HPA_PLAYBOOK_DIR'"
|
||||
pull-repo "$HPA_PLAYBOOK_DIR"
|
||||
}
|
||||
|
||||
pull-template() {
|
||||
log --echo "Pulling template: '$HPA_CONSULT_TEMPLATE_DIR'"
|
||||
pull-repo "$HPA_CONSULT_TEMPLATE_DIR"
|
||||
|
||||
log --echo "Pulling airflow assessment template: '$HPA_AIRFLOW_TEMPLATE_DIR'"
|
||||
pull-repo "$HPA_AIRFLOW_TEMPLATE_DIR"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
all_flag="1"
|
||||
docker_flag="0"
|
||||
playbook_flag="0"
|
||||
template_flag="0"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-a" ]] || [[ $1 == "--all" ]]; then
|
||||
all_flag="1"
|
||||
break
|
||||
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "-d" ]] || [[ $1 == "--docker" ]]; then
|
||||
all_flag="0"
|
||||
docker_flag="1"
|
||||
elif [[ $1 == "-p" ]] || [[ $1 == "--playbook" ]]; then
|
||||
all_flag="0"
|
||||
playbook_flag="1"
|
||||
elif [[ $1 == "-t" ]] || [[ $1 == "--template" ]]; then
|
||||
all_flag="0"
|
||||
template_flag="1"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if [[ $all_flag == "1" ]]; then
|
||||
docker_flag="1"
|
||||
playbook_flag="1"
|
||||
template_flag="1"
|
||||
fi
|
||||
|
||||
[[ $docker_flag == "1" ]] && pull-docker
|
||||
[[ $playbook_flag == "1" ]] && pull-playbook
|
||||
[[ $template_flag == "1" ]] && pull-template
|
||||
date +%s >"$HPA_CONFIG_DIR/.lastpull"
|
||||
date +%s >"$HPA_AIRFLOW_CONFIG_DIR/.lastpull"
|
||||
152
env/.local/scripts/hypr/launch
vendored
152
env/.local/scripts/hypr/launch
vendored
@@ -11,7 +11,7 @@ THIS=$(basename "$THIS_FILE")
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
cat <<EOF
|
||||
|
||||
Launch or focus / close a window based on pattern contained within the window
|
||||
class name. (Default is to focus the window).
|
||||
@@ -61,57 +61,57 @@ special_flag="0"
|
||||
special=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-c" ]] || [[ $1 == "--or-close" ]]; then
|
||||
close_flag="1"
|
||||
action="closewindow"
|
||||
elif [[ $1 == "-f" ]] || [[ $1 == "--or-focus" ]]; then
|
||||
focus_flag="1"
|
||||
action="focuswindow"
|
||||
elif [[ $1 == "-s" ]] || [[ $1 == "--special" ]]; then
|
||||
shift
|
||||
special_flag="1"
|
||||
special=$1
|
||||
elif [[ $1 == "-o" ]] || [[ $1 == "--focus-active-only" ]]; then
|
||||
focus_flag="1"
|
||||
focus_active_only_flag="1"
|
||||
action="focuswindow"
|
||||
elif [[ $1 == "-x" ]] || [[ $1 == "--close-active-only" ]]; then
|
||||
close_flag="1"
|
||||
close_active_only_flag="1"
|
||||
action="closewindow"
|
||||
elif [[ $1 == "-n" ]] || [[ $1 == "--new" ]]; then
|
||||
new_instance_flag="1"
|
||||
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ -z $pattern ]]; then
|
||||
pattern=$1
|
||||
else
|
||||
launch_cmd+=("$1")
|
||||
fi
|
||||
shift
|
||||
if [[ $1 == "-c" ]] || [[ $1 == "--or-close" ]]; then
|
||||
close_flag="1"
|
||||
action="closewindow"
|
||||
elif [[ $1 == "-f" ]] || [[ $1 == "--or-focus" ]]; then
|
||||
focus_flag="1"
|
||||
action="focuswindow"
|
||||
elif [[ $1 == "-s" ]] || [[ $1 == "--special" ]]; then
|
||||
shift
|
||||
special_flag="1"
|
||||
special=$1
|
||||
elif [[ $1 == "-o" ]] || [[ $1 == "--focus-active-only" ]]; then
|
||||
focus_flag="1"
|
||||
focus_active_only_flag="1"
|
||||
action="focuswindow"
|
||||
elif [[ $1 == "-x" ]] || [[ $1 == "--close-active-only" ]]; then
|
||||
close_flag="1"
|
||||
close_active_only_flag="1"
|
||||
action="closewindow"
|
||||
elif [[ $1 == "-n" ]] || [[ $1 == "--new" ]]; then
|
||||
new_instance_flag="1"
|
||||
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ -z $pattern ]]; then
|
||||
pattern=$1
|
||||
else
|
||||
launch_cmd+=("$1")
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
# Redirects all output of hyprctl dispatch commands.
|
||||
hypr_dispatch() {
|
||||
hyprctl dispatch "$@" >/dev/null 2>&1
|
||||
hyprctl dispatch "$@" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
toggle_special() {
|
||||
if [[ -z $special ]]; then
|
||||
log --error " No name supplied for special workspace."
|
||||
exit 1
|
||||
fi
|
||||
hypr_dispatch togglespecialworkspace $special
|
||||
if [[ -z $special ]]; then
|
||||
log --error " No name supplied for special workspace."
|
||||
exit 1
|
||||
fi
|
||||
hypr_dispatch togglespecialworkspace $special
|
||||
}
|
||||
|
||||
launch_application() {
|
||||
log "Launching..."
|
||||
log "'${launch_cmd[@]}'"
|
||||
eval exec ${launch_cmd[@]}
|
||||
log "Launching..."
|
||||
log "'${launch_cmd[*]}'"
|
||||
eval exec "${launch_cmd[*]}"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
@@ -123,11 +123,11 @@ source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
if [[ -z $pattern ]]; then
|
||||
log --error "Must supply a pattern to match the window class."
|
||||
usage && exit 1
|
||||
log --error "Must supply a pattern to match the window class."
|
||||
usage && exit 1
|
||||
elif [[ -z $launch_cmd ]]; then
|
||||
log --error "Must supply a launch command to match the window class."
|
||||
usage && exit 1
|
||||
log --error "Must supply a launch command to match the window class."
|
||||
usage && exit 1
|
||||
fi
|
||||
|
||||
log "Pattern: $pattern"
|
||||
@@ -135,13 +135,13 @@ addresses=$(hyprctl clients -j | jq ".[] | select(.class | contains(\"$pattern\"
|
||||
|
||||
# If no addresses, then launch the application.
|
||||
if [[ -z $addresses ]] || [[ $new_instance_flag == "1" ]]; then
|
||||
log "No addresses found or new instance flag set."
|
||||
# Toggle special workspace if applicable.
|
||||
if [[ $special_flag == "1" ]]; then
|
||||
log "Toggling special workspace."
|
||||
toggle_special
|
||||
fi
|
||||
launch_application && exit 0
|
||||
log "No addresses found or new instance flag set."
|
||||
# Toggle special workspace if applicable.
|
||||
if [[ $special_flag == "1" ]]; then
|
||||
log "Toggling special workspace."
|
||||
toggle_special
|
||||
fi
|
||||
launch_application && exit 0
|
||||
fi
|
||||
|
||||
active_window_workspace=$(hyprctl activewindow -j | jq -r '.workspace.name')
|
||||
@@ -150,45 +150,45 @@ active_window_workspace=$(hyprctl activewindow -j | jq -r '.workspace.name')
|
||||
# we just toggle the special workspace. This keeps "special" apps alive, but closes and / opens
|
||||
# the special workspace when invoked.
|
||||
if [[ $special_flag == "1" ]] && [[ $active_window_workspace =~ $special ]]; then
|
||||
toggle_special && exit 0
|
||||
toggle_special && exit 0
|
||||
fi
|
||||
|
||||
# Check if both close and focus flags were passed, so we don't do the
|
||||
# wrong thing.
|
||||
if [[ $focus_flag == "1" ]] && [[ $close_flag == "1" ]]; then
|
||||
log --error "Both focus and close flag were passed."
|
||||
exit 1
|
||||
log --error "Both focus and close flag were passed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for address in ${addresses[@]}; do
|
||||
# Clean the address of quotes.
|
||||
address=${address//\"/}
|
||||
log "Handling address: '$address'"
|
||||
# Clean the address of quotes.
|
||||
address=${address//\"/}
|
||||
log "Handling address: '$address'"
|
||||
|
||||
if [[ $focus_active_only_flag == "1" ]] || [[ $close_active_only_flag == "1" ]]; then
|
||||
# get the workspace name for the address.
|
||||
workspace=$(hyprctl clients -j | jq -r ".[] | select(.address == \"$address\") | .workspace.name")
|
||||
if [[ $focus_active_only_flag == "1" ]] || [[ $close_active_only_flag == "1" ]]; then
|
||||
# get the workspace name for the address.
|
||||
workspace=$(hyprctl clients -j | jq -r ".[] | select(.address == \"$address\") | .workspace.name")
|
||||
|
||||
# check that the window is on the active workspace.
|
||||
if [[ $active_window_workspace == $workspace ]]; then
|
||||
log "Performing action: '$action', on window: '$address'"
|
||||
hypr_dispatch $action "address:$address"
|
||||
# early out if focusing a window.
|
||||
[[ $focus_active_only_flag ]] && exit 0
|
||||
else
|
||||
# the window is not on the active workspace, so skip it.
|
||||
log "Skipping window: $address"
|
||||
fi
|
||||
else
|
||||
# We don't have the focus_active_only_flag or close_active_only_flag set, so we perform
|
||||
# the action on the window.
|
||||
log "Performing action: '$action', on window: '$address'"
|
||||
hypr_dispatch $action "address:$address"
|
||||
fi
|
||||
# check that the window is on the active workspace.
|
||||
if [[ $active_window_workspace == $workspace ]]; then
|
||||
log "Performing action: '$action', on window: '$address'"
|
||||
hypr_dispatch $action "address:$address"
|
||||
# early out if focusing a window.
|
||||
[[ $focus_active_only_flag ]] && exit 0
|
||||
else
|
||||
# the window is not on the active workspace, so skip it.
|
||||
log "Skipping window: $address"
|
||||
fi
|
||||
else
|
||||
# We don't have the focus_active_only_flag or close_active_only_flag set, so we perform
|
||||
# the action on the window.
|
||||
log "Performing action: '$action', on window: '$address'"
|
||||
hypr_dispatch $action "address:$address"
|
||||
fi
|
||||
done
|
||||
|
||||
# If we made it here and focus_active_only_flag was set, then we did not
|
||||
# find a window on the active workspace, so we launch a new window.
|
||||
if [[ $focus_active_only_flag == "1" ]]; then
|
||||
launch_application
|
||||
launch_application
|
||||
fi
|
||||
|
||||
28
env/.local/scripts/hypr/logging
vendored
28
env/.local/scripts/hypr/logging
vendored
@@ -43,14 +43,14 @@ warn_flag="0"
|
||||
error_flag="0"
|
||||
|
||||
__msg() {
|
||||
if [[ -z "$@" ]]; then
|
||||
if [[ -z "$*" ]]; then
|
||||
echo -e "\e[31m[ERROR]:\e[0m No logs were supplied."
|
||||
exit 1
|
||||
fi
|
||||
if [[ $warn_flag == "1" ]]; then
|
||||
echo -e "\e[33m[WARN]:\e[0m $@"
|
||||
echo -e "\e[33m[WARN]:\e[0m $*"
|
||||
elif [[ $error_flag == "1" ]]; then
|
||||
echo -e "\e[31m[ERROR]:\e[0m $@"
|
||||
echo -e "\e[31m[ERROR]:\e[0m $*"
|
||||
else
|
||||
echo "$@"
|
||||
fi
|
||||
@@ -72,6 +72,7 @@ logging() {
|
||||
|
||||
# Reset flags
|
||||
log_flag="0"
|
||||
echo_flag="0"
|
||||
warn_flag="0"
|
||||
error_flag="0"
|
||||
source_file=""
|
||||
@@ -79,11 +80,11 @@ logging() {
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-w" ]] || [[ $1 == "--warn" ]] || [[ $1 == "--warning" ]]; then
|
||||
log_flag="1"
|
||||
warn_flag="1"
|
||||
elif [[ $1 == "-e" ]] || [[ $1 =~ ^--error ]]; then
|
||||
log_flag="1"
|
||||
error_flag="1"
|
||||
elif [[ $1 =~ ^--echo ]]; then
|
||||
echo_flag="1"
|
||||
elif [[ $1 == "-s" ]] || [[ $1 =~ ^--source ]]; then
|
||||
shift
|
||||
source_file="$1"
|
||||
@@ -100,20 +101,21 @@ logging() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $args ]]; then
|
||||
if [[ -z "${args[*]}" ]]; then
|
||||
echo -e "\e[31m[ERROR]:\e[0m No log message supplied."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
msg="$(__msg ${args[@]})"
|
||||
msg="$(__msg "${args[@]}")"
|
||||
|
||||
if [[ $LOG_ENABLE_DRY_RUN == "0" ]]; then
|
||||
if [[ $LOG_ENABLE_DRY_RUN == "0" ]] && [[ $log_flag == "1" ]]; then
|
||||
# Loop over log files logging message to each file.
|
||||
for i in "${!LOG_FILE[@]}"; do
|
||||
local file=${LOG_DIR}/${LOG_FILE[i]}
|
||||
local id=$LOG_INVOCATION_ID
|
||||
local label=${LOG_LABEL[i]:-"$LOG_LABEL"}
|
||||
local time=$(date '+%D %H:%M:%S')
|
||||
local time
|
||||
time=$(date '+%D %H:%M:%S')
|
||||
|
||||
if [[ -z $file ]] || [[ -z $id ]] || [[ -z $label ]]; then
|
||||
echo "Logging not properly setup."
|
||||
@@ -130,6 +132,8 @@ logging() {
|
||||
echo -e "[id: $id]$msg"
|
||||
elif [[ $warn_flag == "1" ]]; then
|
||||
echo -e "[id: $id]$msg"
|
||||
elif [[ $echo_flag == "1" ]]; then
|
||||
echo -e "$msg"
|
||||
fi
|
||||
else
|
||||
# Dry run mode, so just log to the console
|
||||
@@ -168,7 +172,7 @@ setup-logging() {
|
||||
|
||||
if [[ -n $LOG_LABEL ]] && [[ ! $LOG_LABEL =~ $label ]]; then
|
||||
LOG_LABEL+=("${LOG_LABEL[@]}=>$label")
|
||||
elif [[ ! $LOG_LABEL =~ $label ]]; then
|
||||
elif [[ ! ${LOG_LABEL[*]} =~ $label ]]; then
|
||||
LOG_LABEL+=("$label")
|
||||
fi
|
||||
|
||||
@@ -179,9 +183,9 @@ setup-logging() {
|
||||
}
|
||||
|
||||
print_logger_env() {
|
||||
echo "LOG_FILE: ${LOG_FILE[@]}"
|
||||
echo "LOG_FILE: ${LOG_FILE[*]}"
|
||||
echo "LOG_INVOCATION_ID: $LOG_INVOCATION_ID"
|
||||
echo "LOG_LABEL: ${LOG_LABEL[@]}"
|
||||
echo "LOG_LABEL: ${LOG_LABEL[*]}"
|
||||
}
|
||||
|
||||
export -f setup-logging
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# Adapted from https://github.com/basecamp/omarchy/tree/master?tab=readme-ov-file
|
||||
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
THIS=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$(basename "$THIS_FILE")}
|
||||
LOG_FILE=${LOG_FILE:-"$THIS.log"}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
|
||||
function usage() {
|
||||
cat <<EOF
|
||||
@@ -237,7 +239,7 @@ EOF
|
||||
|
||||
# Setup logging file and label
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$THIS.log" "$THIS"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
export LOG_ENABLE_DRY_RUN="$dry_run"
|
||||
|
||||
if [[ -z "$XDG_DATA_HOME" ]]; then
|
||||
@@ -287,7 +289,7 @@ set_icon_ref
|
||||
|
||||
# Check that an exec command is set, or default to the 'launch-webapp' script.
|
||||
if [[ -z $exec_cmd ]]; then
|
||||
exec_cmd="$SCRIPTS/hypr/launch-webapp $app_url"
|
||||
exec_cmd="$SCRIPTS/hypr/webapp launch $app_url"
|
||||
fi
|
||||
|
||||
log "\e[032mCreating web app:\e[0m $desktop_file"
|
||||
@@ -4,7 +4,7 @@
|
||||
SCRIPTS="${SCRIPTS:-$HOME/.local/scripts}"
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$(basename "$THIS_FILE")}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
|
||||
usage() {
|
||||
@@ -29,7 +29,7 @@ NOTES:
|
||||
|
||||
Any extra arguments after '--' get passed directly to the browser invocation.
|
||||
|
||||
$ launch-webapp https://example.com -- --some-random-flag-for-browser=1
|
||||
$ $THIS https://example.com -- --some-random-flag-for-browser=1
|
||||
|
||||
Any options passed in prior to the '--' get sent to the 'launch' script, so you can pass
|
||||
options that are not specifically shown here, but the ones shown would be the most commonly
|
||||
@@ -94,9 +94,9 @@ fi
|
||||
# Any left over args after "--"
|
||||
app_args="$@"
|
||||
|
||||
log "URL: $url"
|
||||
log "Launch args: ${launch_args[@]}"
|
||||
log "App args: ${app_args}"
|
||||
log "Launching URL: $url"
|
||||
log " Launch args: ${launch_args[@]}"
|
||||
log " App args: ${app_args}"
|
||||
|
||||
$SCRIPTS/hypr/launch "${launch_args[@]}" "$(pattern)" \
|
||||
setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$url" "$app_args"
|
||||
57
env/.local/scripts/hypr/webapp
vendored
Executable file
57
env/.local/scripts/hypr/webapp
vendored
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Utility for launching or installing a progressive web app.
|
||||
|
||||
USAGE:
|
||||
$ $THIS <flags> <command>
|
||||
|
||||
FLAGS:
|
||||
-h | --help: Show this help page.
|
||||
|
||||
COMMANDS:
|
||||
install: Generate a '.desktop' file for a web app.
|
||||
launch: Launch a url as a web app.
|
||||
|
||||
RUN '$THIS <command> --help' for more information about a command.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage
|
||||
elif [[ $1 == "install" ]]; then
|
||||
shift
|
||||
THIS="$THIS install" "$SCRIPTS/hypr/utils/webapp/install" "$@"
|
||||
elif [[ $1 == "launch" ]]; then
|
||||
shift
|
||||
THIS="$THIS launch" "$SCRIPTS/hypr/utils/webapp/launch" "$@"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
59
env/.local/scripts/kanatactl
vendored
59
env/.local/scripts/kanatactl
vendored
@@ -15,10 +15,9 @@ DEV_ENV=${DEV_ENV:-""}
|
||||
KBD=${KBD:-""} # Keyboard config to use, either "voyager" or "macbook"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
cat <<EOF
|
||||
|
||||
Manages kanata qmk keyboard program, which needs to be built locally. Currently the linux builds
|
||||
are only for x86. Also manages the kanata systemd service.
|
||||
Manages kanata qmk keyboard program, which needs to be built locally. Also manages the kanata systemd service.
|
||||
|
||||
USAGE:
|
||||
|
||||
@@ -30,8 +29,6 @@ FLAGS:
|
||||
COMMANDS:
|
||||
config: Commands for the kanata keyboard configuration file(s).
|
||||
service: Commands for the kanata systemd service.
|
||||
pkg: Commands for the kanata package.
|
||||
bootstrap: Bootstrap a new machine, performs installation, enables, and starts kanata systemd service.
|
||||
logs: View the log file.
|
||||
|
||||
Run "$THIS <command> --help" for more information about a command.
|
||||
@@ -41,17 +38,7 @@ EOF
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
# Bootstrap a new machine, by building and installing the kanata executable,
|
||||
# installing the systemd service files, and enable / start the service.
|
||||
bootstrap() {
|
||||
log "Bootstrapping new system..."
|
||||
$THIS_FILE pkg install
|
||||
$THIS_FILE service install
|
||||
$THIS_FILE service enable
|
||||
$THIS_FILE service start
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
@@ -63,29 +50,23 @@ source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "bootstrap" ]]; then
|
||||
bootstrap && exit 0
|
||||
elif [[ $1 == "config" ]]; then
|
||||
shift
|
||||
THIS="$THIS config" $SCRIPTS/utils/kanatactl/config "$@"
|
||||
exit $?
|
||||
elif [[ $1 == "service" ]]; then
|
||||
shift
|
||||
THIS="$THIS service" $SCRIPTS/utils/kanatactl/service "$@"
|
||||
exit $?
|
||||
elif [[ $1 == "pkg" ]]; then
|
||||
shift
|
||||
THIS="$THIS pkg" $SCRIPTS/utils/kanatactl/pkg "$@"
|
||||
exit $?
|
||||
elif [[ $1 == "logs" ]]; then
|
||||
bat ${LOG_DIR:-/tmp/logs}/$LOG_FILE && exit 0
|
||||
elif [[ $1 == "update" ]]; then
|
||||
install_or_update "Updating" && exit 0
|
||||
else
|
||||
break
|
||||
fi
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "config" ]]; then
|
||||
shift
|
||||
THIS="$THIS config" $SCRIPTS/utils/kanatactl/config "$@"
|
||||
exit $?
|
||||
elif [[ $1 == "service" ]]; then
|
||||
shift
|
||||
THIS="$THIS service" $SCRIPTS/utils/kanatactl/service "$@"
|
||||
exit $?
|
||||
elif [[ $1 == "logs" ]]; then
|
||||
bat ${LOG_DIR:-/tmp/logs}/$LOG_FILE && exit 0
|
||||
elif [[ $1 == "update" ]]; then
|
||||
install_or_update "Updating" && exit 0
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# If we've made it here, then we didn't handle the command.
|
||||
|
||||
96
env/.local/scripts/shorten-url
vendored
Executable file
96
env/.local/scripts/shorten-url
vendored
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# Global variables
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"} && export LOG_FILE
|
||||
|
||||
# Local variables
|
||||
declare -a args
|
||||
no_spin_flag="0"
|
||||
create_flag="0"
|
||||
logs_flag="0"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Shorten url utility script.
|
||||
|
||||
USAGE:
|
||||
$THIS <flags> <command>
|
||||
|
||||
FLAGS:
|
||||
--no-spin: Disable spinners for commands.
|
||||
-h | --help: Show this help page.
|
||||
|
||||
COMMANDS:
|
||||
create: Create a new shortened url.
|
||||
logs: View or remove the logs.
|
||||
|
||||
Run '$THIS <command> --help' for more information on a command.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
#
|
||||
# This gets exported for subcommands to use.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
} && export -f log
|
||||
|
||||
create() {
|
||||
script="$SCRIPTS/utils/shorten-url/create"
|
||||
export THIS="${THIS} create"
|
||||
|
||||
if [[ $no_spin_flag == "1" ]]; then
|
||||
bash -c "$script ${args[*]}"
|
||||
else
|
||||
title="Generating short url..."
|
||||
gum spin --show-output --title="$title" -- bash -c "$script ${args[*]}"
|
||||
fi
|
||||
}
|
||||
|
||||
logs() {
|
||||
script="$SCRIPTS/utils/shorten-url/logs"
|
||||
export THIS="$THIS logs"
|
||||
source "$script" "${args[*]}"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "--no-spin" ]]; then
|
||||
no_spin_flag="1"
|
||||
elif [[ $1 == "create" ]]; then
|
||||
create_flag="1"
|
||||
elif [[ $1 == "logs" ]]; then
|
||||
logs_flag="1"
|
||||
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
no_spin_flag="1"
|
||||
args+=("$1")
|
||||
else
|
||||
args+=("$1")
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if [[ $create_flag == "1" ]]; then
|
||||
create
|
||||
elif [[ $logs_flag == "1" ]]; then
|
||||
logs
|
||||
else
|
||||
# If we made it here, no subcommands were executed.
|
||||
usage
|
||||
fi
|
||||
107
env/.local/scripts/swift-dev
vendored
Executable file
107
env/.local/scripts/swift-dev
vendored
Executable file
@@ -0,0 +1,107 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
|
||||
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
||||
IMAGE="git.housh.dev/michael/swift-dev-container"
|
||||
IMAGE_TAG="latest"
|
||||
|
||||
declare cmd dir pull_flag run_flag
|
||||
cmd=""
|
||||
dir=""
|
||||
pull_flag="0"
|
||||
run_flag="1"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Runs neovim inside swift-dev-container docker container for working on swift projects.
|
||||
|
||||
Currently I'm unable to get swift to install on arch linux, so this gives me working lsp, etc.
|
||||
|
||||
USAGE:
|
||||
$ $THIS <flags> <command> -- <docker comand>
|
||||
|
||||
FLAGS:
|
||||
-h | --help: Show this help page.
|
||||
-p | --pull: Used with run command, to pull/update image before running.
|
||||
-t | --tag <tag>: Used with run command to specify the image tag to use.
|
||||
|
||||
COMMANDS:
|
||||
pull <tag>: Pull the dev container image, tag is optional (default; 'latest').
|
||||
run <dir> (default): Run the dev container in the directory, if directory not supplied it
|
||||
will default to PWD.
|
||||
|
||||
NOTES:
|
||||
Run command is implied / default, so it's not required to be passed if you just want to run the
|
||||
container. For example in your swift project directory you can run 'swift-dev' and a container
|
||||
will start.
|
||||
|
||||
This will properly mount '~/.config/nvim' and '~/.local/share/nvim' inside the container.
|
||||
|
||||
If you would like to run a custom command / not run neovim in the container then it MUST follow
|
||||
'--'. For example, 'swift-dev -- /bin/bash'.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
pull() {
|
||||
log "Pulling image: '$IMAGE:$IMAGE_TAG'"
|
||||
podman pull "$IMAGE:$IMAGE_TAG"
|
||||
}
|
||||
|
||||
run() {
|
||||
[[ -z $dir ]] && dir="$PWD"
|
||||
[[ -z $cmd ]] && cmd="/root/.local/share/bob/nvim-bin/nvim"
|
||||
log "Running '$IMAGE:$IMAGE_TAG', in: '$dir'"
|
||||
podman run -it --rm \
|
||||
--volume "$XDG_CONFIG_HOME/nvim":/root/.config/nvim \
|
||||
--volume "$XDG_DATA_HOME/nvim":/root/.local/share/nvim \
|
||||
--volume "$dir":/root/dev \
|
||||
"$IMAGE:$IMAGE_TAG" "$cmd"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "-p" ]] || [[ $1 == "--pull" ]]; then
|
||||
pull_flag="1"
|
||||
elif [[ $1 == "-t" ]] || [[ $1 == "--tag" ]]; then
|
||||
[[ -n ${2:-""} ]] || (log --error "Must supply a tag" && exit 1)
|
||||
IMAGE_TAG=$2
|
||||
shift
|
||||
elif [[ $1 == "pull" ]]; then
|
||||
run_flag="0"
|
||||
pull_flag="1"
|
||||
elif [[ $1 == "--" ]]; then
|
||||
shift
|
||||
cmd="$*"
|
||||
elif [[ ! $1 == "run" ]]; then
|
||||
dir="$1"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
[[ $pull_flag = "1" ]] && pull
|
||||
[[ $run_flag = "1" ]] && run
|
||||
43
env/.local/scripts/tmux-kill-old-sessions
vendored
Executable file
43
env/.local/scripts/tmux-kill-old-sessions
vendored
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Kills tmux sessions that are past the threshold to free up resources.
|
||||
#
|
||||
# Adapted from https://gist.github.com/dhulihan/4c65e868851660fb0d8bfa2d059e7967
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
|
||||
# Threshold
|
||||
TOO_OLD_THRESHOLD=7200 # 2 hours
|
||||
NOW=$(date +%s)
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
tmux ls -F '#{session_name}:#{session_activity}' | while read -r line; do
|
||||
session_name=${line%:*}
|
||||
last_activity=${line#*:}
|
||||
elapsed=$((NOW - last_activity))
|
||||
|
||||
if [[ "$elapsed" -gt "$TOO_OLD_THRESHOLD" ]]; then
|
||||
log "$session_name is ${elapsed}s inactive, killing..."
|
||||
tmux kill-session -t "$session_name"
|
||||
fi
|
||||
done
|
||||
2
env/.local/scripts/tmux-sessionator
vendored
2
env/.local/scripts/tmux-sessionator
vendored
@@ -55,7 +55,9 @@ function create_session() {
|
||||
function create_email_session() {
|
||||
tmux new-session -ds email -n work neomutt
|
||||
tmux new-window -t email -d -n personal neomutt
|
||||
tmux new-window -t email -d -n iCloud neomutt
|
||||
tmux send-keys -t email.1 'i2'
|
||||
tmux send-keys -t email.3 'i3'
|
||||
}
|
||||
|
||||
############################## MAIN ##############################
|
||||
|
||||
162
env/.local/scripts/utils/hpa/hpa-create
vendored
Executable file
162
env/.local/scripts/utils/hpa/hpa-create
vendored
Executable file
@@ -0,0 +1,162 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# NOTE: This script is required so that we can use 'gum spin' during creation
|
||||
# of the project, otherwise the spinner doesn't actually show up when
|
||||
# the utility functions live in the same file.
|
||||
# https://github.com/charmbracelet/gum/issues/419
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
# Load environment / shared variables.
|
||||
. "$SCRIPTS/utils/hpa/hpa.env"
|
||||
|
||||
declare airflow_flag no_git_flag no_push_flag date_opt
|
||||
airflow_flag="0"
|
||||
no_git_flag="0"
|
||||
no_push_flag="0"
|
||||
date_opt=$(date '+%Y.%m.%d')
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
|
||||
A utility script to generate a new home performance assessment project or
|
||||
airflow assessment project.
|
||||
|
||||
All output from the 'hpa' command get suppressed so that this script can
|
||||
be piped / used to automatically cd into the directory after creation to
|
||||
quickly get to work on the new project.
|
||||
|
||||
This generates projects directories with the format of '2025.11.06.Customer',
|
||||
will appropriately set the directory to use inside the docker container used
|
||||
to generate the project, and then echo the local directory that was created.
|
||||
|
||||
It also initializes the project as a git repository.
|
||||
|
||||
USAGE:
|
||||
$ $THIS <flags> <customer>
|
||||
|
||||
FLAGS:
|
||||
-a | --airflow: Generate using the airflow assessment project template.
|
||||
-d | --date: Override the date the project was started.
|
||||
-g | --no-git: Do not initialize a git repository for the project.
|
||||
-h | --help: Show this help page.
|
||||
-p | --no-push: Do not push project to remote repository.
|
||||
|
||||
ENVIRONMENT:
|
||||
CONSULTS_DIR: Sets the location of new projects
|
||||
(default: ~/work/consults)
|
||||
|
||||
CONSULT_ORIGIN_BASE_URL: Sets the base url for the project git origin.
|
||||
(default: ssh://git@git.housh.dev:2222/consults)
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
create() {
|
||||
local customer container_dir script suffix
|
||||
customer=${1:-""}
|
||||
|
||||
[[ -z $customer ]] &&
|
||||
log --error "Must supply a customer name for the project" &&
|
||||
exit 1
|
||||
|
||||
log "Generating project for: '$customer'"
|
||||
|
||||
# Setup approriate configuration and project suffix.
|
||||
if [[ $airflow_flag == "1" ]]; then
|
||||
suffix="AAP"
|
||||
script="$SCRIPTS/aap"
|
||||
else
|
||||
suffix="HPA"
|
||||
script="$SCRIPTS/hpa"
|
||||
fi
|
||||
|
||||
[[ ! -f $SCRIPTS/hpa ]] &&
|
||||
log --error "Unable to find the script: '$script'." &&
|
||||
exit 1
|
||||
|
||||
log "Using script: '$script'"
|
||||
|
||||
container_dir=$(
|
||||
"$script" create --quiet "/consults/$date_opt.$customer.$suffix"
|
||||
)
|
||||
echo "$HPA_CONSULTS_DIR/$(basename "$container_dir")"
|
||||
}
|
||||
|
||||
initialize-git() {
|
||||
local dir
|
||||
read -r dir
|
||||
|
||||
dir=$(echo "$dir" | tr -d '\r' | head -1)
|
||||
|
||||
if [[ $no_git_flag == "0" ]]; then
|
||||
|
||||
[[ ! -d $dir ]] &&
|
||||
log --error "Could not initialize git directory not found: '$dir'" &&
|
||||
exit 1
|
||||
|
||||
log "Initializing git repository"
|
||||
|
||||
pushd "$dir" &>/dev/null || exit 1
|
||||
(
|
||||
git init
|
||||
git lfs install
|
||||
git lfs track '*.png'
|
||||
git lfs track '*.pdf'
|
||||
git add .
|
||||
git commit --all --message="Initial commit"
|
||||
git remote add origin "$HPA_CONSULT_ORIGIN_BASE_URL/$(basename "$dir")"
|
||||
if [[ $no_push_flag == "0" ]]; then
|
||||
git push --set-upstream origin main
|
||||
fi
|
||||
) &>/dev/null
|
||||
popd &>/dev/null
|
||||
else
|
||||
log "Skipping git initialization"
|
||||
fi
|
||||
|
||||
echo "$dir"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
declare customer output
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "-a" ]] || [[ $1 == "--airflow" ]]; then
|
||||
airflow_flag="1"
|
||||
elif [[ $1 == "-d" ]] || [[ $1 == "--date" ]]; then
|
||||
shift
|
||||
date_opt="$1"
|
||||
elif [[ $1 == "-g" ]] || [[ $1 == "--no-git" ]]; then
|
||||
no_git_flag="1"
|
||||
elif [[ $1 == "-p" ]] || [[ $1 == "--no-push" ]]; then
|
||||
no_push_flag="1"
|
||||
else
|
||||
customer=$1
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
output=$(create "$customer" | initialize-git)
|
||||
echo "$output"
|
||||
57
env/.local/scripts/utils/hpa/hpa.env
vendored
Executable file
57
env/.local/scripts/utils/hpa/hpa.env
vendored
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Set's up environment variables used in the various 'hpa*' scripts.
|
||||
#
|
||||
# This allows them all to be set / declared in one place, then those
|
||||
# scripts just need to source this file to use them.
|
||||
#
|
||||
# All variables can be overriden by setting in your shell env.
|
||||
|
||||
# XDG vars.
|
||||
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
||||
|
||||
# Docker vars.
|
||||
HPA_DOCKER_IMAGE=${HPA_DOCKER_IMAGE:-"git.housh.dev/michael/swift-hpa"}
|
||||
HPA_DOCKER_TAG=${HPA_DOCKER_TAG:-"latest"}
|
||||
|
||||
# Auto pull options to be ran before running the hpa docker
|
||||
# container, default is always pull new images and repositories.
|
||||
HPA_AUTO_PULL=${HPA_AUTO_PULL:="1"}
|
||||
HPA_AUTO_PULL_INTERVAL="3600" # 1 hour
|
||||
HPA_AUTO_PULL_OPTS=${HPA_AUTO_PULL_OPTS:-"--all"}
|
||||
|
||||
HPA_CONFIG_DIR="$XDG_CONFIG_HOME/hpa"
|
||||
HPA_DATA_DIR="$XDG_DATA_HOME/hpa"
|
||||
HPA_PLAYBOOK_DIR="$HPA_DATA_DIR/playbook"
|
||||
HPA_PLAYBOOK_URL="ssh://git@git.housh.dev:2222/michael/ansible-hpa-playbook.git"
|
||||
HPA_VAULT_SECRET_KEY="${HPA_VAULT_SECRET_KEY:-vault-pass}"
|
||||
|
||||
# Consults vars.
|
||||
HPA_CONSULTS_DIR=${CONSULTS_DIR:-$HOME/work/consults}
|
||||
HPA_CONSULT_ORIGIN_BASE_URL=${CONSULT_ORIGIN_BASE_URL:-"ssh://git@git.housh.dev:2222/consults"}
|
||||
HPA_CONSULT_TEMPLATE_DIR=${HPA_DATA_DIR}/template
|
||||
HPA_CONSULT_TEMPLATE_URL="ssh://git@git.housh.dev:2222/hhe/consult-template.git"
|
||||
|
||||
# Airflow assessment vars.
|
||||
HPA_AIRFLOW_CONFIG_DIR="${XDG_CONFIG_HOME}/aap"
|
||||
HPA_AIRFLOW_TEMPLATE_DIR="${HPA_DATA_DIR}/airflow-assessment-template"
|
||||
HPA_AIRFLOW_TEMPLATE_URL="ssh://git@git.housh.dev:2222/hhe/airflow-assessment-template.git"
|
||||
|
||||
export HPA_AUTO_PULL
|
||||
export HPA_AUTO_PULL_INTERVAL
|
||||
export HPA_AUTO_PULL_OPTS
|
||||
export HPA_CONSULTS_DIR
|
||||
export HPA_CONSULT_ORIGIN_BASE_URL
|
||||
export HPA_CONSULT_TEMPLATE_DIR
|
||||
export HPA_CONSULT_TEMPLATE_URL
|
||||
export HPA_CONFIG_DIR
|
||||
export HPA_DATA_DIR
|
||||
export HPA_DOCKER_IMAGE
|
||||
export HPA_DOCKER_TAG
|
||||
export HPA_PLAYBOOK_URL
|
||||
export HPA_PLAYBOOK_DIR
|
||||
export HPA_VAULT_SECRET_KEY
|
||||
export HPA_AIRFLOW_CONFIG_DIR
|
||||
export HPA_AIRFLOW_TEMPLATE_DIR
|
||||
export HPA_AIRFLOW_TEMPLATE_URL
|
||||
193
env/.local/scripts/utils/kanatactl/pkg
vendored
193
env/.local/scripts/utils/kanatactl/pkg
vendored
@@ -1,193 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]}
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Manage the kanata package / crate.
|
||||
|
||||
USAGE:
|
||||
|
||||
$ $THIS <command> <flags> <args...>
|
||||
|
||||
FLAGS:
|
||||
-h | --help: Show this help page.
|
||||
|
||||
COMMANDS:
|
||||
install: Install the kanata package.
|
||||
update: Updates the kanata package.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
kanata_dir="$XDG_CACHE_HOME/kanata"
|
||||
kanata_url="https://github.com/jtroo/kanata.git"
|
||||
kanata_current_version=""
|
||||
|
||||
install_mode="0"
|
||||
update_mode="0"
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
get_current_version() {
|
||||
if [[ $(command -v /usr/bin/kanata) ]]; then
|
||||
kanata_current_version=$(/usr/bin/kanata --version)
|
||||
# Remove 'kanata ' from output of the version command.
|
||||
kanata_current_version="${kanata_current_version#kanata *}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Get's kanat versions by git tag and filter's out versions that are less than our
|
||||
# current version number.
|
||||
get_versions() {
|
||||
get_current_version
|
||||
local rows=()
|
||||
local tag=""
|
||||
local has_seen_current="0"
|
||||
for tag in $(git tag --list 'v*' | sort --version-sort); do
|
||||
if [[ $has_seen_current == "1" ]] || [[ -z $kanata_current_version ]]; then
|
||||
rows+=("$tag\n")
|
||||
elif [[ $tag =~ $kanata_current_version ]]; then
|
||||
has_seen_current="1"
|
||||
fi
|
||||
done
|
||||
echo "$(echo -e "${rows[@]}" | sort --version-sort --reverse | tr -d ' ')"
|
||||
}
|
||||
|
||||
# Present an fzf menu to choose a version to install / update to.
|
||||
prompt_for_version_to_install() {
|
||||
local rows=$(get_versions)
|
||||
if [[ -z $rows ]]; then
|
||||
log --error "No versions to select." && exit 1
|
||||
else
|
||||
echo $(printf '%s\n' "${rows[@]}" | fzf --header='Which version would you like to install?')
|
||||
fi
|
||||
}
|
||||
|
||||
# Compares the selected version to the installed version.
|
||||
compare_versions() {
|
||||
# An example selection at this point: 'v1.9.0'
|
||||
local selection=""
|
||||
read -r selection
|
||||
|
||||
if [[ $(command -v /usr/bin/kanata) ]] && [[ -n $selection ]]; then
|
||||
|
||||
[[ -z $kanata_current_version ]] && get_current_version
|
||||
local selected_version=${selection#v*} # remove the 'v' from selected version.
|
||||
|
||||
log "Comparing selected: '$selected_version' to installed '$kanata_current_version'"
|
||||
if [[ $selected_version == $kanata_current_version ]]; then
|
||||
log --warn "Selected version matches the currently installed version." && exit 1
|
||||
fi
|
||||
fi
|
||||
echo "$selection"
|
||||
}
|
||||
|
||||
# Check's out the selected version tag and builds the kanata executable.
|
||||
build_selection() {
|
||||
# An example selection at this point: 'v1.9.0'
|
||||
local selection=""
|
||||
read -r selection
|
||||
|
||||
if [[ -z $selection ]]; then
|
||||
log --error "Selection is empty." && exit 1
|
||||
# Handle logged messages instead of an actual selection.
|
||||
elif [[ $selection =~ "[WARN]" ]] || [[ $selection =~ "[ERROR]" ]]; then
|
||||
echo $selection && exit 1
|
||||
fi
|
||||
|
||||
if [[ $selection =~ ^v ]]; then
|
||||
log "Building kanata..."
|
||||
# checkout the selected version tag and build.
|
||||
git checkout $selection
|
||||
cargo build --release --features cmd
|
||||
echo "done"
|
||||
fi
|
||||
}
|
||||
|
||||
# Copies the most recently built kanata executable to the '/usr/bin' directory.
|
||||
#
|
||||
copy_to_usr_bin() {
|
||||
|
||||
# This is the end of the install / update pipe, so it loops over output of
|
||||
# the other commands in the pipe printing it to the console, while waiting on the
|
||||
# build to be done.
|
||||
while read line; do
|
||||
if [[ $line == "done" ]]; then
|
||||
log "Copying to '/usr/bin/kanata'" && echo "Copying to '/usr/bin/kanata'"
|
||||
sudo cp target/release/kanata /usr/bin
|
||||
echo "Done!"
|
||||
else
|
||||
echo "$line"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
title() {
|
||||
if [[ $update_mode == "1" ]]; then
|
||||
echo "Updating"
|
||||
else
|
||||
echo "Installing"
|
||||
fi
|
||||
}
|
||||
|
||||
# Handles both install or update commands, as they do the same thing.
|
||||
install_or_update() {
|
||||
local mode=$(title)
|
||||
|
||||
log "$mode kanata..."
|
||||
local should_pull="1"
|
||||
|
||||
if [[ ! -d $kanata_dir ]]; then
|
||||
log "Cloning repo."
|
||||
should_pull="0"
|
||||
git clone $kanata_url $kanata_dir
|
||||
fi
|
||||
|
||||
pushd $kanata_dir &>/dev/null
|
||||
(
|
||||
[[ $should_pull == "1" ]] && git pull origin main >/dev/null 2>&1
|
||||
prompt_for_version_to_install | compare_versions | build_selection | copy_to_usr_bin
|
||||
)
|
||||
popd &>/dev/null
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "install" ]]; then
|
||||
shift
|
||||
install_mode="1"
|
||||
install_or_update "$@"
|
||||
exit $?
|
||||
elif [[ $1 == "update" ]]; then
|
||||
shift
|
||||
update_mode="1"
|
||||
install_or_update "$@"
|
||||
exit $?
|
||||
fi
|
||||
done
|
||||
|
||||
# If we made it here, then none of the commands handled the arguments, so show the
|
||||
# usage and exit
|
||||
usage && exit 1
|
||||
152
env/.local/scripts/utils/kanatactl/service
vendored
152
env/.local/scripts/utils/kanatactl/service
vendored
@@ -11,8 +11,15 @@ THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
DEV_ENV=${DEV_ENV:-""}
|
||||
|
||||
declare user_flag system_flag prompt_flag mode
|
||||
declare -a args
|
||||
user_flag="1"
|
||||
system_flag="0"
|
||||
prompt_flag="0"
|
||||
mode=""
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
cat <<EOF
|
||||
Manages the kanata systemd service.
|
||||
|
||||
USAGE:
|
||||
@@ -21,6 +28,9 @@ USAGE:
|
||||
|
||||
FLAGS:
|
||||
-h | --help: Show this help page.
|
||||
--user: Setup systemd service as a user service (default).
|
||||
--system: Setup systemd service as a system service.
|
||||
--prompt: Prompt the user to install service as system or user service.
|
||||
|
||||
COMMANDS:
|
||||
enable: Enable the kanata service.
|
||||
@@ -40,52 +50,90 @@ EOF
|
||||
|
||||
# Logging utility function, use in place of echo.
|
||||
log() {
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
logging log --source "$THIS_FILE" "$@"
|
||||
}
|
||||
|
||||
enable_service() {
|
||||
log "Enabling kanata service..."
|
||||
sudo systemctl enable kanata.service
|
||||
log "Enabling kanata service..."
|
||||
if [[ $user_flag == "1" ]]; then
|
||||
systemctl --user enable --now kanata.service
|
||||
else
|
||||
sudo systemctl enable --now kanata.service
|
||||
fi
|
||||
}
|
||||
|
||||
get_status() {
|
||||
log "Getting kanata service status..."
|
||||
systemctl status kanata.service
|
||||
log "Getting kanata service status..."
|
||||
systemctl status kanata.service
|
||||
}
|
||||
|
||||
prompt_user() {
|
||||
log "Prompting user for how they would like to setup kanata systemd service..."
|
||||
local choice
|
||||
choice=$(echo -e "user\nsystem" | fzf --header "How would you like to setup the kanata systemd service?")
|
||||
if [[ $choice == "system" ]]; then
|
||||
user_flag="0"
|
||||
system_flag="1"
|
||||
elif [[ $choice == "user" ]]; then
|
||||
user_flag="1"
|
||||
system_flag="0"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
install_service() {
|
||||
if [[ -z $DEV_ENV ]]; then
|
||||
log --error "DEV_ENV is not set properly." && exit 1
|
||||
fi
|
||||
local service_dir="user"
|
||||
|
||||
# Ensure the configuration is copied / setup otherwise the keyboard may not work.
|
||||
"$SCRIPTS/kanatactl" config install "$@"
|
||||
if [[ -z $DEV_ENV ]]; then
|
||||
log --error "DEV_ENV is not set properly." && exit 1
|
||||
fi
|
||||
log "Starting install service..."
|
||||
|
||||
log "Installing kanata service..."
|
||||
[[ -f /etc/systemd/system/kanata.service ]] && sudo rm -rf /etc/systemd/system/kanata.service
|
||||
sudo cp "$DEV_ENV/env/etc/systemd/system/kanata.service" /etc/systemd/system
|
||||
sudo systemctl daemon-reload
|
||||
# Ensure the configuration is copied / setup otherwise the keyboard may not work.
|
||||
"$SCRIPTS/kanatactl" config install "$@"
|
||||
|
||||
# Prompt the user for how they would like to install the systemd service, if the
|
||||
# prompt flag is set.
|
||||
[[ $prompt_flag == "1" ]] && prompt_user || exit 1
|
||||
|
||||
[[ $system_flag == "1" ]] && service_dir="system"
|
||||
|
||||
log "Installing kanata service as: '$service_dir' service..."
|
||||
|
||||
if [[ $service_dir == "system" ]]; then
|
||||
[[ -f /etc/systemd/system/kanata.service ]] && sudo rm -rf /etc/systemd/system/kanata.service
|
||||
sudo cp "$DEV_ENV/env/etc/systemd/system/kanata.service" /etc/systemd/system
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now kanata.service
|
||||
else
|
||||
[[ -f ~/.config/systemd/user/kanata.service ]] && rm -rf ~/.config/systemd/user/kanata.service
|
||||
mkdir -p ~/.config/systemd/user &>/dev/null
|
||||
cp "$DEV_ENV/env/etc/systemd/user/kanata.service" ~/.config/systemd/user
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now kanata.service
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
log "Starting kanata service..."
|
||||
systemctl start kanata.service
|
||||
log "Starting kanata service..."
|
||||
systemctl start kanata.service
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
log "Stopping kanata service..."
|
||||
sudo systemctl stop kanata.service
|
||||
log "Stopping kanata service..."
|
||||
sudo systemctl stop kanata.service
|
||||
}
|
||||
|
||||
disable_service() {
|
||||
log "Disabling kanata service..."
|
||||
stop_service
|
||||
sudo systemctl disable kanata.service
|
||||
log "Disabling kanata service..."
|
||||
stop_service
|
||||
sudo systemctl disable kanata.service
|
||||
}
|
||||
|
||||
restart_service() {
|
||||
log "Restarting kanata service..."
|
||||
sudo systemctl restart kanata.service
|
||||
log "Restarting kanata service..."
|
||||
sudo systemctl restart kanata.service
|
||||
}
|
||||
|
||||
################################################################################
|
||||
@@ -96,26 +144,42 @@ restart_service() {
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
# Parse flags / arguments.
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "disable" ]]; then
|
||||
disable_service && exit $?
|
||||
elif [[ $1 == "enable" ]]; then
|
||||
enable_service && exit $?
|
||||
elif [[ $1 == "install" ]]; then
|
||||
shift
|
||||
install_service "$@" && exit $?
|
||||
elif [[ $1 == "start" ]]; then
|
||||
start_service && exit $?
|
||||
elif [[ $1 == "status" ]]; then
|
||||
get_status && exit $?
|
||||
elif [[ $1 == "stop" ]]; then
|
||||
stop_service && exit $?
|
||||
elif [[ $1 == "restart" ]]; then
|
||||
restart_service && exit $?
|
||||
fi
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "--user" ]]; then
|
||||
user_flag="1"
|
||||
elif [[ $1 == "--system" ]]; then
|
||||
system_flag="1"
|
||||
elif [[ $1 == "--prompt" ]]; then
|
||||
prompt_flag="1"
|
||||
# Set first non-flag to the mode / subcommand.
|
||||
elif [[ -z $mode ]]; then
|
||||
mode="$1"
|
||||
# Add any other arguments to the 'args' array.
|
||||
else
|
||||
args+=("$1")
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
# If we made it here, then none of the subcommands handled the args.
|
||||
usage && exit 1
|
||||
# Handle mode.
|
||||
if [[ $mode == "disable" ]]; then
|
||||
disable_service && exit $?
|
||||
elif [[ $mode == "enable" ]]; then
|
||||
enable_service && exit $?
|
||||
elif [[ $mode == "install" ]]; then
|
||||
install_service "${args[@]}" && exit $?
|
||||
elif [[ $mode == "start" ]]; then
|
||||
start_service && exit $?
|
||||
elif [[ $mode == "status" ]]; then
|
||||
get_status && exit $?
|
||||
elif [[ $mode == "stop" ]]; then
|
||||
stop_service && exit $?
|
||||
elif [[ $mode == "restart" ]]; then
|
||||
restart_service && exit $?
|
||||
else
|
||||
# If we made it here, then none of the subcommands handled the args.
|
||||
usage && exit 1
|
||||
fi
|
||||
|
||||
112
env/.local/scripts/utils/shorten-url/create
vendored
Executable file
112
env/.local/scripts/utils/shorten-url/create
vendored
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# Global variables.
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]} && export THIS_FILE # Export for log function to work properly.
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
# Setup environment
|
||||
source "$SCRIPTS/utils/shorten-url/env"
|
||||
|
||||
# Local variables.
|
||||
declare -a tags
|
||||
url=""
|
||||
shortCode=""
|
||||
expire=""
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Create a shortened url, returns / echo's the generated url.
|
||||
|
||||
USAGE:
|
||||
$THIS <flags> <url>
|
||||
|
||||
FLAGS:
|
||||
-c | --code: Set a custom short-code for the link.
|
||||
-e | --expire <time>: Set the expiration for the link.
|
||||
-t | --tag <tag>: Add tag(s) to the link (can be passed multiple times).
|
||||
-h | --help: Show this help page.
|
||||
|
||||
EXMAPLES:
|
||||
|
||||
Generate a link and set the expiration for 30 days from now:
|
||||
$ $THIS --expire 30 days https://example.com
|
||||
|
||||
Generate a link with multiple tags:
|
||||
$ $THIS --tag consult --tag test https://example.com
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
generate_json() {
|
||||
local tagsJson
|
||||
tagsJson=$(printf '%s\n' "${tags[@]}" | jq -R . | jq -s .)
|
||||
log "Generating json data..."
|
||||
if [[ -n $expire ]]; then
|
||||
expire="$(date --iso-8601=seconds -d "+ $expire")"
|
||||
log "Set valid until date: $expire"
|
||||
# NB: 'validUntil' can not be set to an empty string, or it immediately expires the link.
|
||||
jq -n --arg longUrl "$url" --arg shortCode "$shortCode" --argjson tags "$tagsJson" \
|
||||
--arg validUntil "$expire" \
|
||||
'{longUrl: $longUrl, shortCode: $shortCode, tags: $tags, findIfExists: true, validUntil: $validUntil}'
|
||||
else
|
||||
jq -n --arg longUrl "$url" --arg shortCode "$shortCode" --argjson tags "$tagsJson" \
|
||||
'{longUrl: $longUrl, customSlug: $shortCode, tags: $tags, findIfExists: true}'
|
||||
fi
|
||||
}
|
||||
|
||||
create_url() {
|
||||
local json
|
||||
|
||||
[[ -z $url ]] &&
|
||||
log --error "Url not supplied." &&
|
||||
exit 1
|
||||
|
||||
json="$(generate_json)"
|
||||
|
||||
log "Creating url: '$url' with json: $json"
|
||||
|
||||
curl "$BASE_URL/short-urls" \
|
||||
--request 'POST' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--header 'accept: application/json' \
|
||||
--header "X-Api-Key: $API_KEY" \
|
||||
--no-progress-meter \
|
||||
--data "$json" | jq '.shortUrl'
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
# Setup logging file and label.
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
log "Creating url with args: $*"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
elif [[ $1 == "-c" ]] || [[ $1 == "--code" ]]; then
|
||||
shift
|
||||
shortCode="$1"
|
||||
elif [[ $1 == "-t" ]] || [[ $1 == "--tag" ]]; then
|
||||
shift
|
||||
tags+=("$1")
|
||||
elif [[ $1 == "-e" ]] || [[ $1 == "--expire" ]]; then
|
||||
shift
|
||||
expire="$1 $2"
|
||||
shift
|
||||
else
|
||||
url="$1"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
create_url
|
||||
7
env/.local/scripts/utils/shorten-url/env
vendored
Executable file
7
env/.local/scripts/utils/shorten-url/env
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
API_KEY=$(/bin/gopass show --password Keys/shlink/api-key)
|
||||
BASE_URL="https://l.housh.dev/rest/v3"
|
||||
|
||||
export API_KEY
|
||||
export BASE_URL
|
||||
64
env/.local/scripts/utils/shorten-url/logs
vendored
Executable file
64
env/.local/scripts/utils/shorten-url/logs
vendored
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||
THIS_FILE=${BASH_SOURCE[0]} && export THIS_FILE
|
||||
LOG_LABEL=$(basename "$THIS_FILE")
|
||||
THIS=${THIS:-$LOG_LABEL}
|
||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||
|
||||
rm_flag="0"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
View or remove the logs.
|
||||
|
||||
USAGE:
|
||||
$THIS <flags> <command>
|
||||
|
||||
FLAGS:
|
||||
-h | --help: Show this help page.
|
||||
|
||||
COMMAND:
|
||||
show: Show the logs (default).
|
||||
rm | remove: Remove the log file.
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
################################################################################
|
||||
# MAIN
|
||||
################################################################################
|
||||
|
||||
source "$SCRIPTS/hypr/logging"
|
||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||
|
||||
[[ -z ${LOG_DIR:-""} ]] &&
|
||||
log --error "Log directory not set." &&
|
||||
exit 1
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
if [[ $1 == "rm" ]] || [[ $1 == "remove" ]]; then
|
||||
rm_flag="1"
|
||||
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||
usage && exit 0
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
file="$LOG_DIR/$LOG_FILE"
|
||||
|
||||
[[ ! -f "$file" ]] &&
|
||||
echo "No log file at: '$file'" &&
|
||||
exit 0
|
||||
|
||||
if [[ $rm_flag == "1" ]]; then
|
||||
log --echo "Removing logs..."
|
||||
rm -f "$file"
|
||||
else
|
||||
log "Showing logs"
|
||||
bat "$file"
|
||||
fi
|
||||
4
env/.prettierrc
vendored
Normal file
4
env/.prettierrc
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"proseWrap": "always"
|
||||
"printWidth": 100
|
||||
}
|
||||
2
env/.prettierrc.yaml
vendored
2
env/.prettierrc.yaml
vendored
@@ -1,2 +0,0 @@
|
||||
proseWrap: always
|
||||
printWidth: 120
|
||||
3
env/.tmux.conf
vendored
3
env/.tmux.conf
vendored
@@ -14,7 +14,7 @@ TMUX_FZF_OPTIONS="-p -w 60% -h 80% -m"
|
||||
set-option -sa terminal-overrides ",xterm*:Tc"
|
||||
|
||||
# Change the default $TERM to tmux-256color
|
||||
set -g default-terminal "xterm-256color"
|
||||
set -g default-terminal "tmux-256color"
|
||||
|
||||
# Change windows to start with an index of 1 instead of 0
|
||||
set -g base-index 1
|
||||
@@ -120,7 +120,6 @@ set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_blue}] #{=/-32/...:#{s|$USER
|
||||
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]#{?window_zoomed_flag,│,}"
|
||||
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_yellow}]#{?window_zoomed_flag, zoom ,}"
|
||||
|
||||
|
||||
# bootstrap tpm
|
||||
if "test ! -d ~/.tmux/plugins/tpm" \
|
||||
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
|
||||
|
||||
14
env/.zshenv
vendored
14
env/.zshenv
vendored
@@ -19,9 +19,6 @@ export VISUAL=nvim
|
||||
export EDITOR_PREFIX=nvim
|
||||
export MANPAGER="bat"
|
||||
export BROWSER="brave"
|
||||
#export VIMINIT='source $MYVIMRC'
|
||||
#export MYVIMRC="$HOME/.vim/vimrc"
|
||||
#export NVIM_APPNAME="m-housh"
|
||||
|
||||
# Git
|
||||
export GITUSER="m-housh"
|
||||
@@ -36,6 +33,8 @@ export LOCAL_ENV="$XDG_DATA_HOME/zsh/env.zsh"
|
||||
export MYZSHRC="$ZDOTDIR/.zshrc"
|
||||
export SCRIPTS="$HOME/.local/scripts"
|
||||
export SKELETONDIR="$DOTFILES/skeleton"
|
||||
export REPOS="$HOME/dev"
|
||||
export WORK="$HOME/work"
|
||||
|
||||
# NPM
|
||||
export NPM_CONFIG_CACHE="$XDG_DATA_HOME/npm"
|
||||
@@ -64,14 +63,16 @@ export PSQL_HISTORY="$XDG_DATA_HOME/psql_history"
|
||||
# Hashicorp/Vault
|
||||
export VAULT_ADDR="https://vault.housh.dev"
|
||||
|
||||
# RipGrep
|
||||
export RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/ripgreprc"
|
||||
|
||||
# Rust
|
||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||
|
||||
# Tmux-Sessionator path.
|
||||
export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$HOME/.config/personal:$HOME/dev:$HOME/dev/homelab/utils:$HOME/dev/homelab/services"
|
||||
export TMUX_SESSIONATOR_PATH="$HOME:$SCRIPTS:$HOME/.config:$HOME/.config/personal:$REPOS:$REPOS/homelab/utils:$REPOS/homelab/services:$WORK/consults:$WORK"
|
||||
|
||||
# Password-store
|
||||
# export PASSWORD_STORE_DIR="$XDG_DATA_HOME/gopass/stores/root"
|
||||
export PASSWORD_STORE_GENERATED_LENGTH=40
|
||||
export PASSWORD_STORE_ENABLE_EXTENSIONS=true
|
||||
|
||||
@@ -86,5 +87,8 @@ export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/starship.toml"
|
||||
export _ZO_DATA_DIR="$XDG_DATA_HOME"
|
||||
unset _ZO_ECHO
|
||||
|
||||
# Suppress swift backtrace warnings.
|
||||
export SWIFT_BACTRACE=enable=no
|
||||
|
||||
[ -f "$LOCAL_ENV" ] && source "$LOCAL_ENV"
|
||||
[ -f "$ZDOTDIR/personal.env" ] && source "$ZDOTDIR/personal.env"
|
||||
|
||||
12
env/etc/systemd/user/kanata.service
vendored
Normal file
12
env/etc/systemd/user/kanata.service
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Kanata Service
|
||||
Documentation=https://github.com/jtroo/kanata
|
||||
|
||||
[Service]
|
||||
Environment=PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin
|
||||
Type=simple
|
||||
ExecStart=/bin/sh -c 'exec /usr/bin/kanata --cfg /home/michael/.config/kanata/config.kbd'
|
||||
Restart=no
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
11
env/jellyfin-tui/config.gpg
vendored
Normal file
11
env/jellyfin-tui/config.gpg
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
-----BEGIN PGP MESSAGE-----
|
||||
|
||||
hF4DAAAAAAAAAAASAQdATOWmZnUO2KsVWqDMIPkJPBvEskExyaYdpYxcl4xqwyUw
|
||||
8rPCTjCdJSbB36d7ly5+UaayXBZFn2IrGXfai7+IP11G92ocj4a8xHSwKZX9mSd8
|
||||
0sABAVlTrLOO4BVWBpGnAsagfzXMGyYPi843KdnZg43b4IAx3hdR46NnjfjGjAZc
|
||||
Ggf4kC+DuTT+Y0BRH8qRLU6kizxRvi13GEnxt0sTQqhNRA+hLbkXYWlZ3fLnf6YD
|
||||
CIpMYowZmqwd6KH3ofFeNr+E5+HAaygU/61VH2pkZRzwwltiEZ4aQ+eWULELs6BF
|
||||
z7nIB49nOZi2m7boSVVnfmknD6Z/QwZSmqakySZRlNNC19IqEoDl02H5cgHCNbQV
|
||||
cTnyHQ==
|
||||
=LRvL
|
||||
-----END PGP MESSAGE-----
|
||||
12
env/qcal/config.json.gpg
vendored
Normal file
12
env/qcal/config.json.gpg
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
-----BEGIN PGP MESSAGE-----
|
||||
|
||||
hF4DAAAAAAAAAAASAQdAuiXPHaZd/bWttw/D3LtIXio0V9z5aKrqAKDCHofqDmow
|
||||
F90ZOG8wwm3wsmoTSswSifiUUE8AK96ATgphvlxIf/bH+X9pVUPlgZRCPYR7hteI
|
||||
0sBbAWWIYpJA43P5ndpuIUGiGwthRyxQLwWRVFkfZ5v5HLsf0FMVfO2f1azzape9
|
||||
i+0Dz6XoTkDzmApQO46NrOHoI83RUQ7Tbe+AElnDfJT6tj2YaajkCPnvnqO55z54
|
||||
38XOIP3t3eOt+JFugiJDblZCAI/fdzhxCAmqzyU0QZOR3Yl8B/d/8g1PQjPAObiG
|
||||
F+spskYpIXZ0U+YNne4PWThhk0tMgq2rJUovQ6kCGjCnPnRR41UWBkGciXfvOR39
|
||||
BbrBK4wsBTRmrM3Hvs41sZlYkIc6mS/PEs1H7gId8vKt3BGqTHN39+qv6aoSwbi8
|
||||
GaNSRSuuMRsQnnUXBzgilXEnWA2oYncSD8pcorPDAe/gaRNV5+/dpQJrYjbYig==
|
||||
=8rxb
|
||||
-----END PGP MESSAGE-----
|
||||
9
env/smbcredentials.gpg
vendored
Normal file
9
env/smbcredentials.gpg
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
-----BEGIN PGP MESSAGE-----
|
||||
|
||||
hF4DAAAAAAAAAAASAQdAvYM4C8bwyey5d33bXjxKnWe0dIsnk0j5KTpe3TzrLHUw
|
||||
xWF1m3TwpgyRA6LiRHukJ9McoNwRQ7xCdp6XSF+7crNBQWj64/fm1fVymBcv5EkK
|
||||
0ngBJ3I46PcNoVfjCh+1PmSzHFh3ahLU8u95FCL+IbvIrD0DdzntdNAthFSaiHuH
|
||||
DrXiHhGkxuRj0UHi95DF3xi6ODrvC56xTg1jWKzzB+/LuZ6GKSPYd3u/iYmPn76y
|
||||
wiFck8SezOvP0o71tcLa56SQgzSBiDTHL3A=
|
||||
=8OSr
|
||||
-----END PGP MESSAGE-----
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user