mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-15 14:42:37 +00:00
Compare commits
90 Commits
79da2db401
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
0a59fef11c
|
|||
|
fdf1ba6fb0
|
|||
|
17d83c347d
|
|||
|
c4faef634a
|
|||
|
2795a86441
|
|||
|
03244bd272
|
|||
|
37b97b00f5
|
|||
|
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
|
4
.prettierrc
Normal file
4
.prettierrc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"proseWrap": "always"
|
||||||
|
"printWidth": 100
|
||||||
|
}
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
proseWrap: always
|
|
||||||
printWidth: 120
|
|
||||||
53
TODO.md
53
TODO.md
@@ -1,18 +1,59 @@
|
|||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
A list of in-progress and completed todo's.
|
||||||
|
|
||||||
## Arch Todos
|
## Arch Todos
|
||||||
|
|
||||||
|
- [ ] Update README, it's way out of date.
|
||||||
- [x] Separate scripts that are used for configurations / store them somewhere aside
|
- [x] Separate scripts that are used for configurations / store them somewhere aside
|
||||||
from `~/.local/bin`
|
from `~/.local/bin`
|
||||||
|
- [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
|
- [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
|
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
|
why (current thoughts are it has to do with creating the
|
||||||
clipboard_history.json file and not letting clipse do it automatically).
|
clipboard_history.json file and not letting clipse do it automatically).
|
||||||
- [ ] 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
|
||||||
it seems to not work when used on a desktop (mac mini) vs. laptop.
|
- [x] `libtexprintf`
|
||||||
- [ ] Need to update kanatactl to generate udev rules, etc. (see
|
- [ ] Add pipewire-zeroconf to runs.
|
||||||
here)[https://github.com/jtroo/kanata/blob/main/docs/setup-linux.md]
|
- [ ] Setup pipewire config to allow streaming output to homepod's.
|
||||||
- [x] Add neomutt configuration files into the repo (or probably a private repo)
|
- [See arch.wiki](https://wiki.archlinux.org/title/PipeWire)
|
||||||
- [ ] Need to confirm bootstrap does things properly with git submodules.
|
|
||||||
|
### 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,
|
- [ ] 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.
|
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.
|
||||||
|
- [x] Need to update kanatactl to generate udev rules, etc. (see
|
||||||
|
here)[https://github.com/jtroo/kanata/blob/main/docs/setup-linux.md]
|
||||||
|
- [ ] 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
|
if [ -z "$DEV_ENV" ]; then
|
||||||
echo "env var DEV_ENV needs to be present"
|
echo "env var DEV_ENV needs to be present"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if i just did DEV_ENV=$(pwd) ./run then this is needed for the rest of the
|
# 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=""
|
args=""
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
if [[ "$1" =~ dry ]]; then
|
if [[ "$1" =~ dry ]]; then
|
||||||
args="--dry-run"
|
args="--dry-run"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Args to bootstrap scripts: $args"
|
echo "Args to bootstrap scripts: $args"
|
||||||
echo "Installing packages may require your password multiple times."
|
echo "Installing packages may require your password multiple times."
|
||||||
|
|
||||||
echo "Running packages" && $DEV_ENV/run "$args"
|
|
||||||
echo "Installing configuration" && $DEV_ENV/dev-env "$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 "Installing webapps" && $DEV_ENV/webapp "$args"
|
||||||
echo "Starting system services" && $DEV_ENV/system "$args"
|
|
||||||
|
|||||||
7
dev-env
7
dev-env
@@ -119,11 +119,12 @@ update_dirs $DEV_ENV/env/.local $HOME/.local
|
|||||||
|
|
||||||
# SCRIPTS
|
# SCRIPTS
|
||||||
mkdir -p ~/.local/scripts/{hypr,utils} >/dev/null 2>&1
|
mkdir -p ~/.local/scripts/{hypr,utils} >/dev/null 2>&1
|
||||||
mkdir -p ~/.local/scripts/utils/{kanatactl,hpa} >/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
|
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/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/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/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
|
copy_files $DEV_ENV/env/.local/scripts $HOME/.local/scripts
|
||||||
|
|
||||||
# SYSTEMD
|
# SYSTEMD
|
||||||
@@ -153,8 +154,8 @@ copy_files $DEV_ENV/env/wallpapers $HOME/wallpapers
|
|||||||
mkdir $HOME/Pictures >/dev/null 2>&1
|
mkdir $HOME/Pictures >/dev/null 2>&1
|
||||||
mkdir -p $XDG_DATA_HOME/clipse/tmp_files
|
mkdir -p $XDG_DATA_HOME/clipse/tmp_files
|
||||||
copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env
|
copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env
|
||||||
copy $DEV_ENV/env/.markdownlint.jsonc $HOME/.makrdownlint.jsonc
|
copy $DEV_ENV/env/.markdownlint.jsonc $HOME/.markdownlint.jsonc
|
||||||
copy $DEV_ENV/env/.prettierrc.yaml $HOME/.prettierrc.yaml
|
copy $DEV_ENV/env/.prettierrc $HOME/.prettierrc
|
||||||
|
|
||||||
mkdir -p $XDG_DATA_HOME/applications/icons
|
mkdir -p $XDG_DATA_HOME/applications/icons
|
||||||
copy_files $DEV_ENV/env/.local/share/applications $XDG_DATA_HOME/applications
|
copy_files $DEV_ENV/env/.local/share/applications $XDG_DATA_HOME/applications
|
||||||
|
|||||||
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:-$(dirname "${BASH_SOURCE[0]}")}
|
||||||
|
|
||||||
|
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
|
confirm-close-surface = false
|
||||||
|
|
||||||
font-family = "Fira Code"
|
font-family = "Fira Code"
|
||||||
font-size = 13
|
font-size = 18
|
||||||
font-thicken = false
|
font-thicken = false
|
||||||
|
|
||||||
window-save-state = always
|
window-save-state = always
|
||||||
|
|||||||
4
env/.config/git/config
vendored
4
env/.config/git/config
vendored
@@ -30,6 +30,7 @@
|
|||||||
default = simple
|
default = simple
|
||||||
autoSetupRemote = true
|
autoSetupRemote = true
|
||||||
followTags = true
|
followTags = true
|
||||||
|
recurseSubmodules = on-demand
|
||||||
|
|
||||||
[fetch]
|
[fetch]
|
||||||
prune = true
|
prune = true
|
||||||
@@ -65,3 +66,6 @@
|
|||||||
autoSquash = true
|
autoSquash = true
|
||||||
autoStash = true
|
autoStash = true
|
||||||
updateRefs = true
|
updateRefs = true
|
||||||
|
|
||||||
|
[submodule]
|
||||||
|
recurse = true
|
||||||
|
|||||||
7
env/.config/hpa/config.toml
vendored
7
env/.config/hpa/config.toml
vendored
@@ -44,8 +44,8 @@ useVaultArgs = true
|
|||||||
# instead of the provided / default playbook.
|
# instead of the provided / default playbook.
|
||||||
|
|
||||||
[playbook]
|
[playbook]
|
||||||
directory = '~/.local/share/hpa/playbook'
|
directory = '/root/.local/share/hpa/playbook'
|
||||||
inventory = '~/.local/share/hpa/playbook/inventory.ini'
|
inventory = '/root/.local/share/hpa/playbook/inventory.ini'
|
||||||
version = 'main'
|
version = 'main'
|
||||||
|
|
||||||
# NOTE:
|
# NOTE:
|
||||||
@@ -53,7 +53,8 @@ version = 'main'
|
|||||||
# a remote git repository.
|
# a remote git repository.
|
||||||
[template]
|
[template]
|
||||||
# The directory path on your local system to the template files.
|
# The directory path on your local system to the template files.
|
||||||
directory = '~/.local/share/hpa/template'
|
directory = '/root/.local/share/hpa/template'
|
||||||
|
vars = 'repo_vars'
|
||||||
|
|
||||||
# The url to a git repository that contains your template files.
|
# The url to a git repository that contains your template files.
|
||||||
# url = 'https://git.example.com/consult-template.git'
|
# url = 'https://git.example.com/consult-template.git'
|
||||||
|
|||||||
10
env/.config/hypr/hyprautostart.conf
vendored
10
env/.config/hypr/hyprautostart.conf
vendored
@@ -6,12 +6,10 @@
|
|||||||
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
# Autostart necessary processes (like notifications daemons, status bars, etc.)
|
||||||
# Or execute your favorite apps at launch like this:
|
# 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 = pidof hypridle | uwsm app -- hypridle
|
||||||
exec-once = uwsm app -- elephant
|
exec-once = pidof hyprlauncher | uwsm app -- hyprlauncher -d
|
||||||
exec-once = uwsm app -- swaync
|
exec-once = pidof swaync | uwsm app -- swaync
|
||||||
# exec-once = uwsm app -- walker --gapplication-service &
|
exec-once = pidof waybar | uwsm app -- waybar
|
||||||
exec-once = uwsm app -- waybar
|
|
||||||
exec-once = uwsm app -- clipse -listen
|
exec-once = uwsm app -- clipse -listen
|
||||||
#exec-once = protonmail-bridge-core -n
|
|
||||||
|
|
||||||
|
|||||||
8
env/.config/hypr/hyprinput.conf
vendored
8
env/.config/hypr/hyprinput.conf
vendored
@@ -10,7 +10,7 @@ input {
|
|||||||
kb_options = ctrl:nocaps
|
kb_options = ctrl:nocaps
|
||||||
kb_rules =
|
kb_rules =
|
||||||
|
|
||||||
repeat_rate = 35
|
repeat_rate = 50
|
||||||
repeat_delay = 200
|
repeat_delay = 200
|
||||||
|
|
||||||
follow_mouse = 2
|
follow_mouse = 2
|
||||||
@@ -24,9 +24,9 @@ input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# https://wiki.hyprland.org/Configuring/Variables/#gestures
|
# https://wiki.hyprland.org/Configuring/Variables/#gestures
|
||||||
gestures {
|
# gestures {
|
||||||
workspace_swipe = false
|
# workspace_swipe = false
|
||||||
}
|
# }
|
||||||
|
|
||||||
# Example per-device config
|
# Example per-device config
|
||||||
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
|
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
|
||||||
|
|||||||
13
env/.config/hypr/hyprkeybinds.conf
vendored
13
env/.config/hypr/hyprkeybinds.conf
vendored
@@ -14,9 +14,9 @@ $terminal = uwsm app -- ghostty
|
|||||||
$browser = uwsm app -- brave
|
$browser = uwsm app -- brave
|
||||||
$fileManager = $terminal -e yazi
|
$fileManager = $terminal -e yazi
|
||||||
$fileBrowser = uwsm app -- nautilus
|
$fileBrowser = uwsm app -- nautilus
|
||||||
$menu = uwsm app -- walker
|
$menu = hyprlauncher
|
||||||
$scripts = ~/.local/scripts/hypr
|
$scripts = ~/.local/scripts/hypr
|
||||||
$pwa = $scripts/launch-webapp
|
$pwa = $scripts/webapp launch
|
||||||
$tmuxSessionator = ~/.local/scripts/tmux-sessionator
|
$tmuxSessionator = ~/.local/scripts/tmux-sessionator
|
||||||
$clipboardHistory = com.ghostty.clipse $terminal --class=com.ghostty.clipse -e clipse
|
$clipboardHistory = com.ghostty.clipse $terminal --class=com.ghostty.clipse -e clipse
|
||||||
$uninstallDesktop = $terminal --class=com.ghostty.float -e $scripts/uninstall-desktop-app
|
$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 SHIFT, A, [A]i - new window, exec, $pwa "https://ollama.housh.dev"
|
||||||
bindd = $mainMod, B, New [b]rowser, exec, $browser
|
bindd = $mainMod, B, New [b]rowser, exec, $browser
|
||||||
bindd = $mainMod SHIFT, B, New private [b]rowser, exec, $browser --incognito
|
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 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 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, 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
|
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 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, H, Focus window - left, movefocus, l # move window focus using vim keys
|
||||||
bindd = $mainMod SHIFT, H, Workspace - back, workspace, -1
|
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, 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, 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, L, Focus window - right, movefocus, r # move window focus using vim keys
|
||||||
bindd = $mainMod SHIFT, L, Workspace - forward, workspace, +1
|
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 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, 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, 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 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
|
bindd = $mainMod, S, Toggle [s]pecial workspace, togglespecialworkspace, magic # use $windowMod S to send window to the special workspace
|
||||||
|
|||||||
1
env/.config/hypr/hyprland.conf
vendored
1
env/.config/hypr/hyprland.conf
vendored
@@ -9,6 +9,7 @@
|
|||||||
source = ~/.config/hypr/hyprenv.conf
|
source = ~/.config/hypr/hyprenv.conf
|
||||||
source = ~/.config/hypr/hyprmonitors.conf
|
source = ~/.config/hypr/hyprmonitors.conf
|
||||||
source = ~/.config/hypr/hyprwindows.conf
|
source = ~/.config/hypr/hyprwindows.conf
|
||||||
|
source = ~/.config/hypr/hyprworkspaces.conf
|
||||||
source = ~/.config/hypr/hyprkeybinds.conf
|
source = ~/.config/hypr/hyprkeybinds.conf
|
||||||
source = ~/.config/hypr/hyprinput.conf
|
source = ~/.config/hypr/hyprinput.conf
|
||||||
source = ~/.config/hypr/hyprautostart.conf
|
source = ~/.config/hypr/hyprautostart.conf
|
||||||
|
|||||||
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 --
|
||||||
2
env/.config/hypr/hyprmonitors.conf
vendored
2
env/.config/hypr/hyprmonitors.conf
vendored
@@ -4,7 +4,5 @@
|
|||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||||
monitor= ,preferred,auto,auto
|
monitor= ,preferred,auto,auto
|
||||||
#monitor = HDMI-A-1, preferred, 0x0, auto
|
|
||||||
#monitor = HDMI-A-1, preferred, 0x0, 1.66667
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
9
env/.config/hypr/hyprpaper.conf
vendored
9
env/.config/hypr/hyprpaper.conf
vendored
@@ -1,3 +1,6 @@
|
|||||||
preload = /home/michael/wallpapers/wall1.png
|
wallpaper {
|
||||||
wallpaper = ,/home/michael/wallpapers/wall1.png
|
monitor =
|
||||||
splash = true
|
path = /home/michael/wallpapers/wall1.png
|
||||||
|
fit_mode = cover
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
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)
|
||||||
|
|
||||||
89
env/.config/hypr/hyprwindows.conf
vendored
89
env/.config/hypr/hyprwindows.conf
vendored
@@ -1,48 +1,47 @@
|
|||||||
##############################
|
###############
|
||||||
### WINDOWS AND WORKSPACES ###
|
### WINDOWS ###
|
||||||
##############################
|
###############
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
# 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, tag:floating-window
|
# windowrule = float, class:^(com.ghostty.weather)$
|
||||||
windowrule = center, tag:floating-window
|
# windowrule = center, class:^(com.ghostty.weather)$
|
||||||
windowrule = size 60% 60%, tag:floating-window
|
# windowrule = size 90% 80%, class:^(com.ghostty.weather)$
|
||||||
|
#
|
||||||
# Weather tui
|
# # Force windows to be a floating window
|
||||||
windowrule = float, class:^(com.ghostty.weather)$
|
# windowrule = tag +floating-window, class:^(blueberry.py|org.gnome.Nautilus|com.ghostty.float)$
|
||||||
windowrule = center, class:^(com.ghostty.weather)$
|
# windowrule = tag +floating-window, class:^(com.ghostty.windowctl)$
|
||||||
windowrule = size 90% 80%, class:^(com.ghostty.weather)$
|
# windowrule = tag +floating-window, class:^(com.ghostty.utils-launcher)$
|
||||||
|
# windowrule = tag +floating-window, class:^(com.ghostty.homelab-launcher)$
|
||||||
# Force windows to be a floating window
|
#
|
||||||
windowrule = tag +floating-window, class:^(blueberry.py|org.gnome.Nautilus|com.ghostty.float)$
|
# # Force to stay focused when visible.
|
||||||
windowrule = tag +floating-window, class:^(com.ghostty.windowctl)$
|
# windowrule = stayfocused, class:(blueberry.py)
|
||||||
windowrule = tag +floating-window, class:^(com.ghostty.utils-launcher)$
|
# windowrule = stayfocused, class:Pinentry.gtk
|
||||||
windowrule = tag +floating-window, class:^(com.ghostty.homelab-launcher)$
|
# windowrule = stayfocused, class:com.ghostty.float
|
||||||
|
# windowrule = stayfocused, class:com.ghostty.windowctl
|
||||||
# Force to stay focused when visible.
|
# windowrule = stayfocused, class:^(com.ghostty.utils-launcher)$
|
||||||
windowrule = stayfocused, class:(blueberry.py)
|
#
|
||||||
windowrule = stayfocused, class:Pinentry.gtk
|
# # Clipboard history tui in floating window.
|
||||||
windowrule = stayfocused, class:com.ghostty.float
|
# windowrule = tag +floating-window, class:.*clipse.*
|
||||||
windowrule = stayfocused, class:com.ghostty.windowctl
|
# windowrule = stayfocused, class:.*clipse.*
|
||||||
windowrule = stayfocused, class:^(com.ghostty.utils-launcher)$
|
#
|
||||||
|
# # Ignore maximize requests from apps. You'll probably like this.
|
||||||
# Clipboard history tui in floating window.
|
# windowrule = suppressevent maximize, class:.*
|
||||||
windowrule = tag +floating-window, class:.*clipse.*
|
#
|
||||||
windowrule = stayfocused, class:.*clipse.*
|
# # Just a dash of opacity by default.
|
||||||
|
# windowrule = opacity 0.97 0.92, class:.*
|
||||||
# Ignore maximize requests from apps. You'll probably like this.
|
# # No opacity on youtube.
|
||||||
windowrule = suppressevent maximize, class:.*
|
# windowrule = opacity 1.0, class:.*youtube.com.*
|
||||||
|
#
|
||||||
# Just a dash of opacity by default.
|
# # Fix some dragging issues with XWayland
|
||||||
windowrule = opacity 0.97 0.92, class:.*
|
# windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
|
||||||
# No opacity on youtube.
|
#
|
||||||
windowrule = opacity 1.0, class:.*youtube.com.*
|
# # 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)$
|
||||||
# Fix some dragging issues with XWayland
|
# windowrulev2 = float,class:^(showmethekey-gtk)$ # make window floating
|
||||||
windowrule = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
|
# windowrulev2 = pin,class:^(showmethekey-gtk)$ # pin window
|
||||||
|
|
||||||
workspace = special:hidden, invisible
|
|
||||||
workspace = special:pass, class:.*pass.proton.me.*
|
|
||||||
workspace = special:dispatch, class:.*pro.housecallpro.com.*
|
|
||||||
|
|||||||
25
env/.config/hypr/hyprworkspaces.conf
vendored
25
env/.config/hypr/hyprworkspaces.conf
vendored
@@ -1,14 +1,15 @@
|
|||||||
|
##################
|
||||||
|
### WORKSPACES ###
|
||||||
|
##################
|
||||||
|
|
||||||
# Set work spaces 1-5 to be on external monitor
|
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||||
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
|
$scripts = ~/.local/scripts/hypr
|
||||||
workspace = 6, monitor:0
|
$pwa = $scripts/webapp launch
|
||||||
workspace = 7, monitor:0
|
$housecallPro = $pwa "https://pro.housecallpro.com/app/calendar_new"
|
||||||
workspace = 8, monitor:0
|
|
||||||
workspace = 9, monitor:0
|
workspace = special:hidden, invisible
|
||||||
workspace = 10, monitor:0
|
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
|
||||||
|
|||||||
2
env/.config/kanata/voyager.kbd
vendored
2
env/.config/kanata/voyager.kbd
vendored
@@ -27,7 +27,7 @@
|
|||||||
;; Variables
|
;; Variables
|
||||||
(defvar
|
(defvar
|
||||||
tap-higher 400
|
tap-higher 400
|
||||||
tap-time 200
|
tap-time 150
|
||||||
tap-time-plus 300
|
tap-time-plus 300
|
||||||
hold-time-plus 300
|
hold-time-plus 300
|
||||||
hold-time 200
|
hold-time 200
|
||||||
|
|||||||
2
env/.config/nvim
vendored
2
env/.config/nvim
vendored
Submodule env/.config/nvim updated: 8f34505d2d...da24092050
12
env/.config/starship/starship.toml
vendored
12
env/.config/starship/starship.toml
vendored
@@ -7,7 +7,9 @@ format = """
|
|||||||
$os\
|
$os\
|
||||||
$username\
|
$username\
|
||||||
$hostname\
|
$hostname\
|
||||||
[](bg:color_pink fg:color_orange)\
|
[](bg:color_lavender fg:color_orange)\
|
||||||
|
${custom.devpod}\
|
||||||
|
[](bg:color_pink fg:color_lavender)\
|
||||||
$directory\
|
$directory\
|
||||||
[](fg:color_pink bg:color_bg1)\
|
[](fg:color_pink bg:color_bg1)\
|
||||||
$git_branch\
|
$git_branch\
|
||||||
@@ -33,6 +35,14 @@ color_maroon = '#eba0ac'
|
|||||||
color_pink = '#f5c2e7'
|
color_pink = '#f5c2e7'
|
||||||
color_text = '#585b70'
|
color_text = '#585b70'
|
||||||
|
|
||||||
|
[custom.devpod]
|
||||||
|
description = "Displays the active Devpod workspace"
|
||||||
|
command = "echo $(echo $DEVPOD_WORKSPACE_ID | sed 's/.*://')"
|
||||||
|
when = "[[ -n $DEVPOD_WORKSPACE_ID ]]"
|
||||||
|
style = "bold bg:color_lavender fg:color_text"
|
||||||
|
format = "[ 📦 $output ]($style)"
|
||||||
|
disabled = false
|
||||||
|
|
||||||
[os]
|
[os]
|
||||||
disabled = false
|
disabled = false
|
||||||
style = "bold bg:color_orange fg:color_fg0"
|
style = "bold bg:color_orange fg:color_fg0"
|
||||||
|
|||||||
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-center": ["clock"],
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
|
"idle_inhibitor",
|
||||||
"tray",
|
"tray",
|
||||||
"cpu",
|
"cpu",
|
||||||
"memory",
|
"memory",
|
||||||
@@ -76,4 +77,12 @@
|
|||||||
// "format-full": "",
|
// "format-full": "",
|
||||||
"format-icons": ["", "", "", "", ""],
|
"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,
|
#cpu,
|
||||||
#memory,
|
#memory,
|
||||||
#custom-lock,
|
#custom-lock,
|
||||||
#custom-power {
|
#custom-power,
|
||||||
|
#idle_inhibitor {
|
||||||
background-color: @background;
|
background-color: @background;
|
||||||
padding: 0.5rem 1rem;
|
padding: 0.5rem 1rem;
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
@@ -69,12 +70,18 @@
|
|||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#pulseaudio {
|
#pulseaudio {
|
||||||
color: @red;
|
color: @red;
|
||||||
border-radius: 10px 0px 0px 10px;
|
border-radius: 10px 0px 0px 10px;
|
||||||
margin-left: 1rem;
|
margin-left: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#idle_inhibitor {
|
||||||
|
border-radius: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
#tray {
|
#tray {
|
||||||
color: @blue;
|
color: @blue;
|
||||||
border-radius: 0px 10px 10px 0px;
|
border-radius: 0px 10px 10px 0px;
|
||||||
|
|||||||
9
env/.config/zsh/.zshrc
vendored
9
env/.config/zsh/.zshrc
vendored
@@ -175,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 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 reload='exec zsh -l' # reload the shell, useful when making changes.
|
||||||
alias s='swift' # shorthand to access swift commands
|
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 sb='swift build' # swift build
|
||||||
|
alias syu='yay -Syu' # Update packages.
|
||||||
alias t='tmux' # access tmux quickly
|
alias t='tmux' # access tmux quickly
|
||||||
alias tka='tmux kill-server' # kill tmux server and all sessions.
|
alias tka='tmux kill-server' # kill tmux server and all sessions.
|
||||||
alias ts='$SCRIPTS/tmux-sessionator' # create new tmux session, fuzzy finding common locations.
|
alias ts='$SCRIPTS/tmux-sessionator' # create new tmux session, fuzzy finding common locations.
|
||||||
@@ -206,6 +208,7 @@ source <(fzf --zsh)
|
|||||||
_source_if "$ZDOTDIR/.zshrc-local"
|
_source_if "$ZDOTDIR/.zshrc-local"
|
||||||
_source_if "$LOCAL_ENV"
|
_source_if "$LOCAL_ENV"
|
||||||
_source_if "$SCRIPTS/catppuccin-colors"
|
_source_if "$SCRIPTS/catppuccin-colors"
|
||||||
|
_source_if "$XDG_DATA_HOME/swiftly/env.sh"
|
||||||
|
|
||||||
# pnpm
|
# pnpm
|
||||||
export PNPM_HOME="$XDG_DATA_HOME/pnpm"
|
export PNPM_HOME="$XDG_DATA_HOME/pnpm"
|
||||||
@@ -236,3 +239,7 @@ use-gpg-agent-for-ssh
|
|||||||
|
|
||||||
command -v direnv >/dev/null 2>&1 && eval "$(direnv hook zsh)"
|
command -v direnv >/dev/null 2>&1 && eval "$(direnv hook zsh)"
|
||||||
command -v zoxide >/dev/null 2>&1 && eval "$(zoxide init --cmd cd zsh)"
|
command -v zoxide >/dev/null 2>&1 && eval "$(zoxide init --cmd cd zsh)"
|
||||||
|
|
||||||
|
if [[ -n "$DEVPOD_WORKSPACE_ID" ]]; then
|
||||||
|
export TERM=xterm-256color
|
||||||
|
fi
|
||||||
|
|||||||
10
env/.config/zsh/functions/dp
vendored
10
env/.config/zsh/functions/dp
vendored
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
function dp() {
|
function dp() {
|
||||||
[ -z "$1" ] && echo "Must supply temperature" && return 1
|
[ -z "$1" ] && echo "Must supply temperature" && return 1
|
||||||
[ -z "$2" ] && echo "Must supply relative humidity" && return 1
|
[ -z "$2" ] && echo "Must supply relative humidity" && return 1
|
||||||
|
|
||||||
local temperature=$1
|
local temperature=$1
|
||||||
local humidity=$2
|
local humidity=$2
|
||||||
|
|
||||||
/opt/homebrew/bin/psychrometrics dew-point --dry-bulb "$temperature" --relative-humidity "$humidity"
|
psychrometrics dew-point --dry-bulb "$temperature" --relative-humidity "$humidity"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
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
|
# https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html
|
||||||
enable-ssh-support
|
enable-ssh-support
|
||||||
ttyname $GPG_TTY
|
ttyname $GPG_TTY
|
||||||
default-cache-ttl 60
|
default-cache-ttl 120
|
||||||
max-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[@]}"
|
||||||
36
env/.local/scripts/hpa
vendored
36
env/.local/scripts/hpa
vendored
@@ -10,34 +10,40 @@ set -o pipefail
|
|||||||
# Make sure to run 'hpa-init' first on this machine to setup
|
# Make sure to run 'hpa-init' first on this machine to setup
|
||||||
# dependencies, if you have not done so already.
|
# dependencies, if you have not done so already.
|
||||||
#
|
#
|
||||||
# This will mount my home directory inside the container, so
|
|
||||||
# it should somewhat mirror like commands are run on the host os.
|
|
||||||
#
|
|
||||||
# To attach to a shell inside the container run:
|
# To attach to a shell inside the container run:
|
||||||
# `hpa bash`
|
# `hpa bash`
|
||||||
#
|
#
|
||||||
# To run ansible vault commands inside the container run:
|
# To run ansible vault commands inside the container run:
|
||||||
# `hpa ansible-vault ...`
|
# `hpa ansible-vault ...`
|
||||||
#
|
#
|
||||||
#
|
|
||||||
|
|
||||||
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||||
. "$SCRIPTS/utils/hpa/hpa.env"
|
. "$SCRIPTS/utils/hpa/hpa.env"
|
||||||
|
|
||||||
############################## MAIN ##############################
|
############################## MAIN ##############################
|
||||||
|
|
||||||
last_pull="0"
|
# Don't pull images if they're prefixed with 'localhost'.
|
||||||
if [[ -f "$HPA_CONFIG_DIR/.lastpull" ]]; then
|
if echo "$HPA_DOCKER_IMAGE" | grep -vq "localhost"; 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
|
# Check if we should pull the image prior to running.
|
||||||
. "$SCRIPTS/hpa-pull" "$HPA_AUTO_PULL_OPTS"
|
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
|
fi
|
||||||
|
|
||||||
|
echo "ARGS: $@"
|
||||||
|
|
||||||
podman run --rm --interactive --tty \
|
podman run --rm --interactive --tty \
|
||||||
--volume "$HOME":/root \
|
--volume "$HPA_CONFIG_DIR":/root/.config/hpa:ro \
|
||||||
--secret "$HPA_VAULT_SECRET_KEY" \
|
--volume "$HPA_DATA_DIR":/root/.local/share/hpa:ro \
|
||||||
"$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG" "$@"
|
--volume "$HPA_CONSULTS_DIR":/consults \
|
||||||
|
--volume "$PWD":/root/project \
|
||||||
|
--secret "$HPA_VAULT_SECRET_KEY" \
|
||||||
|
"$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG" "$@"
|
||||||
|
|||||||
5
env/.local/scripts/hpa-create
vendored
5
env/.local/scripts/hpa-create
vendored
@@ -4,7 +4,8 @@ title="Creating project..."
|
|||||||
script="${SCRIPTS:-$HOME/.local/scripts}/utils/hpa/hpa-create"
|
script="${SCRIPTS:-$HOME/.local/scripts}/utils/hpa/hpa-create"
|
||||||
first_arg=${1:-""}
|
first_arg=${1:-""}
|
||||||
if [[ $first_arg == "-h" ]] || [[ $first_arg == "--help" ]]; then
|
if [[ $first_arg == "-h" ]] || [[ $first_arg == "--help" ]]; then
|
||||||
. "$script" $*
|
. "$script" $*
|
||||||
else
|
else
|
||||||
gum spin --show-output --title "$title" -- bash -c "$script $*" | tr -d '\r' | head -1
|
# bash -c "$script $*" | tr -d '\r' | head -1
|
||||||
|
gum spin --show-output --title "$title" -- bash -c "$script $*" | tr -d '\r' | head -1
|
||||||
fi
|
fi
|
||||||
|
|||||||
61
env/.local/scripts/hpa-init
vendored
61
env/.local/scripts/hpa-init
vendored
@@ -14,7 +14,7 @@ LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
|||||||
. "$SCRIPTS/utils/hpa/hpa.env"
|
. "$SCRIPTS/utils/hpa/hpa.env"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Setup dependencies for running hpa script in docker. This only needs to be
|
Setup dependencies for running hpa script in docker. This only needs to be
|
||||||
ran once on a new machine.
|
ran once on a new machine.
|
||||||
@@ -44,30 +44,30 @@ EOF
|
|||||||
|
|
||||||
# Logging utility function, use in place of echo.
|
# Logging utility function, use in place of echo.
|
||||||
log() {
|
log() {
|
||||||
logging log --source "$THIS_FILE" "$@"
|
logging log --source "$THIS_FILE" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
generate-completion() {
|
generate-completion() {
|
||||||
local output_dir output type
|
local output_dir output type
|
||||||
type=${1:-"zsh"}
|
type=${1:-"zsh"}
|
||||||
output=${2:-$HOME/.zsh/completions/_hpa}
|
output=${2:-$HOME/.zsh/completions/_hpa}
|
||||||
output_dir=$(dirname "$output")
|
output_dir=$(dirname "$output")
|
||||||
|
|
||||||
log "Generating completion: type: '$type', to: $output"
|
log "Generating completion: type: '$type', to: $output"
|
||||||
|
|
||||||
[[ ! -d "$output_dir" ]] && mkdir -p "$output_dir"
|
[[ ! -d "$output_dir" ]] && mkdir -p "$output_dir"
|
||||||
(
|
(
|
||||||
podman run --rm -it "$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG" \
|
podman run --rm -it "$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG" \
|
||||||
--generate-completion-script "$type" |
|
--generate-completion-script "$type" |
|
||||||
tr -d '\r'
|
tr -d '\r'
|
||||||
) >"$output"
|
) >"$output"
|
||||||
}
|
}
|
||||||
|
|
||||||
generate-secret() {
|
generate-secret() {
|
||||||
log "Generating vault secret for key: '$HPA_VAULT_SECRET_KEY'"
|
log "Generating vault secret for key: '$HPA_VAULT_SECRET_KEY'"
|
||||||
local secret
|
local secret
|
||||||
secret="$(pass -c ansible/vault-pass)"
|
secret="$(pass -c ansible/vault-pass)"
|
||||||
printf "%s" "$secret" | podman secret create "$HPA_VAULT_SECRET_KEY" -
|
printf "%s" "$secret" | podman secret create "$HPA_VAULT_SECRET_KEY" -
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -76,22 +76,23 @@ generate-secret() {
|
|||||||
|
|
||||||
first_arg=${1:-""}
|
first_arg=${1:-""}
|
||||||
if [[ $first_arg == "-h" ]] || [[ $first_arg == "--help" ]]; then
|
if [[ $first_arg == "-h" ]] || [[ $first_arg == "--help" ]]; then
|
||||||
usage && exit 0
|
usage && exit 0
|
||||||
else
|
else
|
||||||
# Setup logging file and label.
|
# Setup logging file and label.
|
||||||
source "$SCRIPTS/hypr/logging"
|
source "$SCRIPTS/hypr/logging"
|
||||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||||
|
|
||||||
log "Starting init..."
|
log "Starting init..."
|
||||||
|
|
||||||
generate-completion "$@"
|
generate-completion "$@"
|
||||||
generate-secret
|
generate-secret
|
||||||
|
|
||||||
log "Generating directories, if they don't exist."
|
log "Generating directories, if they don't exist."
|
||||||
mkdir -p "$HPA_CONSULTS_DIR" &>/dev/null
|
mkdir -p "$HPA_CONSULTS_DIR" &>/dev/null
|
||||||
mkdir "$HPA_DATA_DIR" &>/dev/null
|
mkdir "$HPA_DATA_DIR" &>/dev/null
|
||||||
|
|
||||||
log "Cloning required template and playbook, if they don't exist"
|
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_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_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
|
fi
|
||||||
|
|||||||
76
env/.local/scripts/hpa-pull
vendored
76
env/.local/scripts/hpa-pull
vendored
@@ -13,7 +13,7 @@ LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
|||||||
. "$SCRIPTS/utils/hpa/hpa.env"
|
. "$SCRIPTS/utils/hpa/hpa.env"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Pulls / updates template, playbook, docker image, etc.
|
Pulls / updates template, playbook, docker image, etc.
|
||||||
|
|
||||||
@@ -34,35 +34,38 @@ EOF
|
|||||||
|
|
||||||
# Logging utility function, use in place of echo.
|
# Logging utility function, use in place of echo.
|
||||||
log() {
|
log() {
|
||||||
logging log --source "$THIS_FILE" "$@"
|
logging log --source "$THIS_FILE" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
pull-repo() {
|
pull-repo() {
|
||||||
local dir=${1:-""}
|
local dir=${1:-""}
|
||||||
[[ -z "$dir" ]] &&
|
[[ -z "$dir" ]] &&
|
||||||
log --error "Directory not supplied to pull git repo." &&
|
log --error "Directory not supplied to pull git repo." &&
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
pushd "$dir" &>/dev/null || exit 1
|
pushd "$dir" &>/dev/null || exit 1
|
||||||
(
|
(
|
||||||
git pull
|
git pull
|
||||||
)
|
)
|
||||||
popd &>/dev/null
|
popd &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
pull-docker() {
|
pull-docker() {
|
||||||
log --echo "Pulling docker image: '$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG'"
|
log --echo "Pulling docker image: '$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG'"
|
||||||
podman pull "$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG"
|
podman pull "$HPA_DOCKER_IMAGE:$HPA_DOCKER_TAG"
|
||||||
}
|
}
|
||||||
|
|
||||||
pull-playbook() {
|
pull-playbook() {
|
||||||
log --echo "Pulling playbook: '$HPA_PLAYBOOK_DIR'"
|
log --echo "Pulling playbook: '$HPA_PLAYBOOK_DIR'"
|
||||||
pull-repo "$HPA_PLAYBOOK_DIR"
|
pull-repo "$HPA_PLAYBOOK_DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
pull-template() {
|
pull-template() {
|
||||||
log --echo "Pulling template: '$HPA_CONSULT_TEMPLATE_DIR'"
|
log --echo "Pulling template: '$HPA_CONSULT_TEMPLATE_DIR'"
|
||||||
pull-repo "$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"
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -78,31 +81,32 @@ playbook_flag="0"
|
|||||||
template_flag="0"
|
template_flag="0"
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
if [[ $1 == "-a" ]] || [[ $1 == "--all" ]]; then
|
if [[ $1 == "-a" ]] || [[ $1 == "--all" ]]; then
|
||||||
all_flag="1"
|
all_flag="1"
|
||||||
break
|
break
|
||||||
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||||
usage && exit 0
|
usage && exit 0
|
||||||
elif [[ $1 == "-d" ]] || [[ $1 == "--docker" ]]; then
|
elif [[ $1 == "-d" ]] || [[ $1 == "--docker" ]]; then
|
||||||
all_flag="0"
|
all_flag="0"
|
||||||
docker_flag="1"
|
docker_flag="1"
|
||||||
elif [[ $1 == "-p" ]] || [[ $1 == "--playbook" ]]; then
|
elif [[ $1 == "-p" ]] || [[ $1 == "--playbook" ]]; then
|
||||||
all_flag="0"
|
all_flag="0"
|
||||||
playbook_flag="1"
|
playbook_flag="1"
|
||||||
elif [[ $1 == "-t" ]] || [[ $1 == "--template" ]]; then
|
elif [[ $1 == "-t" ]] || [[ $1 == "--template" ]]; then
|
||||||
all_flag="0"
|
all_flag="0"
|
||||||
template_flag="1"
|
template_flag="1"
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ $all_flag == "1" ]]; then
|
if [[ $all_flag == "1" ]]; then
|
||||||
docker_flag="1"
|
docker_flag="1"
|
||||||
playbook_flag="1"
|
playbook_flag="1"
|
||||||
template_flag="1"
|
template_flag="1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ $docker_flag == "1" ]] && pull-docker
|
[[ $docker_flag == "1" ]] && pull-docker
|
||||||
[[ $playbook_flag == "1" ]] && pull-playbook
|
[[ $playbook_flag == "1" ]] && pull-playbook
|
||||||
[[ $template_flag == "1" ]] && pull-template
|
[[ $template_flag == "1" ]] && pull-template
|
||||||
date +%s >"$HPA_CONFIG_DIR/.lastpull"
|
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"}
|
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Launch or focus / close a window based on pattern contained within the window
|
Launch or focus / close a window based on pattern contained within the window
|
||||||
class name. (Default is to focus the window).
|
class name. (Default is to focus the window).
|
||||||
@@ -61,57 +61,57 @@ special_flag="0"
|
|||||||
special=""
|
special=""
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
if [[ $1 == "-c" ]] || [[ $1 == "--or-close" ]]; then
|
if [[ $1 == "-c" ]] || [[ $1 == "--or-close" ]]; then
|
||||||
close_flag="1"
|
close_flag="1"
|
||||||
action="closewindow"
|
action="closewindow"
|
||||||
elif [[ $1 == "-f" ]] || [[ $1 == "--or-focus" ]]; then
|
elif [[ $1 == "-f" ]] || [[ $1 == "--or-focus" ]]; then
|
||||||
focus_flag="1"
|
focus_flag="1"
|
||||||
action="focuswindow"
|
action="focuswindow"
|
||||||
elif [[ $1 == "-s" ]] || [[ $1 == "--special" ]]; then
|
elif [[ $1 == "-s" ]] || [[ $1 == "--special" ]]; then
|
||||||
shift
|
shift
|
||||||
special_flag="1"
|
special_flag="1"
|
||||||
special=$1
|
special=$1
|
||||||
elif [[ $1 == "-o" ]] || [[ $1 == "--focus-active-only" ]]; then
|
elif [[ $1 == "-o" ]] || [[ $1 == "--focus-active-only" ]]; then
|
||||||
focus_flag="1"
|
focus_flag="1"
|
||||||
focus_active_only_flag="1"
|
focus_active_only_flag="1"
|
||||||
action="focuswindow"
|
action="focuswindow"
|
||||||
elif [[ $1 == "-x" ]] || [[ $1 == "--close-active-only" ]]; then
|
elif [[ $1 == "-x" ]] || [[ $1 == "--close-active-only" ]]; then
|
||||||
close_flag="1"
|
close_flag="1"
|
||||||
close_active_only_flag="1"
|
close_active_only_flag="1"
|
||||||
action="closewindow"
|
action="closewindow"
|
||||||
elif [[ $1 == "-n" ]] || [[ $1 == "--new" ]]; then
|
elif [[ $1 == "-n" ]] || [[ $1 == "--new" ]]; then
|
||||||
new_instance_flag="1"
|
new_instance_flag="1"
|
||||||
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
elif [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||||
usage && exit 0
|
usage && exit 0
|
||||||
elif [[ -z $pattern ]]; then
|
elif [[ -z $pattern ]]; then
|
||||||
pattern=$1
|
pattern=$1
|
||||||
else
|
else
|
||||||
launch_cmd+=("$1")
|
launch_cmd+=("$1")
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
logging log --source "$THIS_FILE" "$@"
|
logging log --source "$THIS_FILE" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Redirects all output of hyprctl dispatch commands.
|
# Redirects all output of hyprctl dispatch commands.
|
||||||
hypr_dispatch() {
|
hypr_dispatch() {
|
||||||
hyprctl dispatch "$@" >/dev/null 2>&1
|
hyprctl dispatch "$@" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle_special() {
|
toggle_special() {
|
||||||
if [[ -z $special ]]; then
|
if [[ -z $special ]]; then
|
||||||
log --error " No name supplied for special workspace."
|
log --error " No name supplied for special workspace."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
hypr_dispatch togglespecialworkspace $special
|
hypr_dispatch togglespecialworkspace $special
|
||||||
}
|
}
|
||||||
|
|
||||||
launch_application() {
|
launch_application() {
|
||||||
log "Launching..."
|
log "Launching..."
|
||||||
log "'${launch_cmd[@]}'"
|
log "'${launch_cmd[*]}'"
|
||||||
eval exec ${launch_cmd[@]}
|
eval exec "${launch_cmd[*]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -123,11 +123,11 @@ source "$SCRIPTS/hypr/logging"
|
|||||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||||
|
|
||||||
if [[ -z $pattern ]]; then
|
if [[ -z $pattern ]]; then
|
||||||
log --error "Must supply a pattern to match the window class."
|
log --error "Must supply a pattern to match the window class."
|
||||||
usage && exit 1
|
usage && exit 1
|
||||||
elif [[ -z $launch_cmd ]]; then
|
elif [[ -z $launch_cmd ]]; then
|
||||||
log --error "Must supply a launch command to match the window class."
|
log --error "Must supply a launch command to match the window class."
|
||||||
usage && exit 1
|
usage && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Pattern: $pattern"
|
log "Pattern: $pattern"
|
||||||
@@ -135,13 +135,13 @@ addresses=$(hyprctl clients -j | jq ".[] | select(.class | contains(\"$pattern\"
|
|||||||
|
|
||||||
# If no addresses, then launch the application.
|
# If no addresses, then launch the application.
|
||||||
if [[ -z $addresses ]] || [[ $new_instance_flag == "1" ]]; then
|
if [[ -z $addresses ]] || [[ $new_instance_flag == "1" ]]; then
|
||||||
log "No addresses found or new instance flag set."
|
log "No addresses found or new instance flag set."
|
||||||
# Toggle special workspace if applicable.
|
# Toggle special workspace if applicable.
|
||||||
if [[ $special_flag == "1" ]]; then
|
if [[ $special_flag == "1" ]]; then
|
||||||
log "Toggling special workspace."
|
log "Toggling special workspace."
|
||||||
toggle_special
|
toggle_special
|
||||||
fi
|
fi
|
||||||
launch_application && exit 0
|
launch_application && exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
active_window_workspace=$(hyprctl activewindow -j | jq -r '.workspace.name')
|
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
|
# we just toggle the special workspace. This keeps "special" apps alive, but closes and / opens
|
||||||
# the special workspace when invoked.
|
# the special workspace when invoked.
|
||||||
if [[ $special_flag == "1" ]] && [[ $active_window_workspace =~ $special ]]; then
|
if [[ $special_flag == "1" ]] && [[ $active_window_workspace =~ $special ]]; then
|
||||||
toggle_special && exit 0
|
toggle_special && exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if both close and focus flags were passed, so we don't do the
|
# Check if both close and focus flags were passed, so we don't do the
|
||||||
# wrong thing.
|
# wrong thing.
|
||||||
if [[ $focus_flag == "1" ]] && [[ $close_flag == "1" ]]; then
|
if [[ $focus_flag == "1" ]] && [[ $close_flag == "1" ]]; then
|
||||||
log --error "Both focus and close flag were passed."
|
log --error "Both focus and close flag were passed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for address in ${addresses[@]}; do
|
for address in ${addresses[@]}; do
|
||||||
# Clean the address of quotes.
|
# Clean the address of quotes.
|
||||||
address=${address//\"/}
|
address=${address//\"/}
|
||||||
log "Handling address: '$address'"
|
log "Handling address: '$address'"
|
||||||
|
|
||||||
if [[ $focus_active_only_flag == "1" ]] || [[ $close_active_only_flag == "1" ]]; then
|
if [[ $focus_active_only_flag == "1" ]] || [[ $close_active_only_flag == "1" ]]; then
|
||||||
# get the workspace name for the address.
|
# get the workspace name for the address.
|
||||||
workspace=$(hyprctl clients -j | jq -r ".[] | select(.address == \"$address\") | .workspace.name")
|
workspace=$(hyprctl clients -j | jq -r ".[] | select(.address == \"$address\") | .workspace.name")
|
||||||
|
|
||||||
# check that the window is on the active workspace.
|
# check that the window is on the active workspace.
|
||||||
if [[ $active_window_workspace == $workspace ]]; then
|
if [[ $active_window_workspace == $workspace ]]; then
|
||||||
log "Performing action: '$action', on window: '$address'"
|
log "Performing action: '$action', on window: '$address'"
|
||||||
hypr_dispatch $action "address:$address"
|
hypr_dispatch $action "address:$address"
|
||||||
# early out if focusing a window.
|
# early out if focusing a window.
|
||||||
[[ $focus_active_only_flag ]] && exit 0
|
[[ $focus_active_only_flag ]] && exit 0
|
||||||
else
|
else
|
||||||
# the window is not on the active workspace, so skip it.
|
# the window is not on the active workspace, so skip it.
|
||||||
log "Skipping window: $address"
|
log "Skipping window: $address"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# We don't have the focus_active_only_flag or close_active_only_flag set, so we perform
|
# We don't have the focus_active_only_flag or close_active_only_flag set, so we perform
|
||||||
# the action on the window.
|
# the action on the window.
|
||||||
log "Performing action: '$action', on window: '$address'"
|
log "Performing action: '$action', on window: '$address'"
|
||||||
hypr_dispatch $action "address:$address"
|
hypr_dispatch $action "address:$address"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# If we made it here and focus_active_only_flag was set, then we did not
|
# 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.
|
# find a window on the active workspace, so we launch a new window.
|
||||||
if [[ $focus_active_only_flag == "1" ]]; then
|
if [[ $focus_active_only_flag == "1" ]]; then
|
||||||
launch_application
|
launch_application
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
# Adapted from https://github.com/basecamp/omarchy/tree/master?tab=readme-ov-file
|
# Adapted from https://github.com/basecamp/omarchy/tree/master?tab=readme-ov-file
|
||||||
|
|
||||||
THIS_FILE=${BASH_SOURCE[0]}
|
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() {
|
function usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@@ -237,7 +239,7 @@ EOF
|
|||||||
|
|
||||||
# Setup logging file and label
|
# Setup logging file and label
|
||||||
source "$SCRIPTS/hypr/logging"
|
source "$SCRIPTS/hypr/logging"
|
||||||
setup-logging "$THIS.log" "$THIS"
|
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||||
export LOG_ENABLE_DRY_RUN="$dry_run"
|
export LOG_ENABLE_DRY_RUN="$dry_run"
|
||||||
|
|
||||||
if [[ -z "$XDG_DATA_HOME" ]]; then
|
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.
|
# Check that an exec command is set, or default to the 'launch-webapp' script.
|
||||||
if [[ -z $exec_cmd ]]; then
|
if [[ -z $exec_cmd ]]; then
|
||||||
exec_cmd="$SCRIPTS/hypr/launch-webapp $app_url"
|
exec_cmd="$SCRIPTS/hypr/webapp launch $app_url"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "\e[032mCreating web app:\e[0m $desktop_file"
|
log "\e[032mCreating web app:\e[0m $desktop_file"
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
SCRIPTS="${SCRIPTS:-$HOME/.local/scripts}"
|
SCRIPTS="${SCRIPTS:-$HOME/.local/scripts}"
|
||||||
THIS_FILE=${BASH_SOURCE[0]}
|
THIS_FILE=${BASH_SOURCE[0]}
|
||||||
LOG_LABEL=$(basename "$THIS_FILE")
|
LOG_LABEL=$(basename "$THIS_FILE")
|
||||||
THIS=$(basename "$THIS_FILE")
|
THIS=${THIS:-$(basename "$THIS_FILE")}
|
||||||
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
@@ -29,7 +29,7 @@ NOTES:
|
|||||||
|
|
||||||
Any extra arguments after '--' get passed directly to the browser invocation.
|
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
|
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
|
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 "--"
|
# Any left over args after "--"
|
||||||
app_args="$@"
|
app_args="$@"
|
||||||
|
|
||||||
log "URL: $url"
|
log "Launching URL: $url"
|
||||||
log "Launch args: ${launch_args[@]}"
|
log " Launch args: ${launch_args[@]}"
|
||||||
log "App args: ${app_args}"
|
log " App args: ${app_args}"
|
||||||
|
|
||||||
$SCRIPTS/hypr/launch "${launch_args[@]}" "$(pattern)" \
|
$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"
|
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"
|
KBD=${KBD:-""} # Keyboard config to use, either "voyager" or "macbook"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Manages kanata qmk keyboard program, which needs to be built locally. Currently the linux builds
|
Manages kanata qmk keyboard program, which needs to be built locally. Also manages the kanata systemd service.
|
||||||
are only for x86. Also manages the kanata systemd service.
|
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
|
|
||||||
@@ -30,8 +29,6 @@ FLAGS:
|
|||||||
COMMANDS:
|
COMMANDS:
|
||||||
config: Commands for the kanata keyboard configuration file(s).
|
config: Commands for the kanata keyboard configuration file(s).
|
||||||
service: Commands for the kanata systemd service.
|
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.
|
logs: View the log file.
|
||||||
|
|
||||||
Run "$THIS <command> --help" for more information about a command.
|
Run "$THIS <command> --help" for more information about a command.
|
||||||
@@ -41,17 +38,7 @@ EOF
|
|||||||
|
|
||||||
# Logging utility function, use in place of echo.
|
# Logging utility function, use in place of echo.
|
||||||
log() {
|
log() {
|
||||||
logging log --source "$THIS_FILE" "$@"
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -63,29 +50,23 @@ source "$SCRIPTS/hypr/logging"
|
|||||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||||
usage && exit 0
|
usage && exit 0
|
||||||
elif [[ $1 == "bootstrap" ]]; then
|
elif [[ $1 == "config" ]]; then
|
||||||
bootstrap && exit 0
|
shift
|
||||||
elif [[ $1 == "config" ]]; then
|
THIS="$THIS config" $SCRIPTS/utils/kanatactl/config "$@"
|
||||||
shift
|
exit $?
|
||||||
THIS="$THIS config" $SCRIPTS/utils/kanatactl/config "$@"
|
elif [[ $1 == "service" ]]; then
|
||||||
exit $?
|
shift
|
||||||
elif [[ $1 == "service" ]]; then
|
THIS="$THIS service" $SCRIPTS/utils/kanatactl/service "$@"
|
||||||
shift
|
exit $?
|
||||||
THIS="$THIS service" $SCRIPTS/utils/kanatactl/service "$@"
|
elif [[ $1 == "logs" ]]; then
|
||||||
exit $?
|
bat ${LOG_DIR:-/tmp/logs}/$LOG_FILE && exit 0
|
||||||
elif [[ $1 == "pkg" ]]; then
|
elif [[ $1 == "update" ]]; then
|
||||||
shift
|
install_or_update "Updating" && exit 0
|
||||||
THIS="$THIS pkg" $SCRIPTS/utils/kanatactl/pkg "$@"
|
else
|
||||||
exit $?
|
break
|
||||||
elif [[ $1 == "logs" ]]; then
|
fi
|
||||||
bat ${LOG_DIR:-/tmp/logs}/$LOG_FILE && exit 0
|
|
||||||
elif [[ $1 == "update" ]]; then
|
|
||||||
install_or_update "Updating" && exit 0
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# If we've made it here, then we didn't handle the command.
|
# 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
|
||||||
127
env/.local/scripts/utils/hpa/hpa-create
vendored
127
env/.local/scripts/utils/hpa/hpa-create
vendored
@@ -17,15 +17,17 @@ LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
|||||||
# Load environment / shared variables.
|
# Load environment / shared variables.
|
||||||
. "$SCRIPTS/utils/hpa/hpa.env"
|
. "$SCRIPTS/utils/hpa/hpa.env"
|
||||||
|
|
||||||
declare no_git_flag no_push_flag date_opt
|
declare airflow_flag no_git_flag no_push_flag date_opt
|
||||||
|
airflow_flag="0"
|
||||||
no_git_flag="0"
|
no_git_flag="0"
|
||||||
no_push_flag="0"
|
no_push_flag="0"
|
||||||
date_opt=$(date '+%Y.%m.%d')
|
date_opt=$(date '+%Y.%m.%d')
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
A utility script to generate a new home performance assessment project.
|
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
|
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
|
be piped / used to automatically cd into the directory after creation to
|
||||||
@@ -41,13 +43,14 @@ USAGE:
|
|||||||
$ $THIS <flags> <customer>
|
$ $THIS <flags> <customer>
|
||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
|
-a | --airflow: Generate using the airflow assessment project template.
|
||||||
-d | --date: Override the date the project was started.
|
-d | --date: Override the date the project was started.
|
||||||
-g | --no-git: Do not initialize a git repository for the project.
|
-g | --no-git: Do not initialize a git repository for the project.
|
||||||
-h | --help: Show this help page.
|
-h | --help: Show this help page.
|
||||||
-p | --no-push: Do not push project to remote repository.
|
-p | --no-push: Do not push project to remote repository.
|
||||||
|
|
||||||
ENVIRONMENT:
|
ENVIRONMENT:
|
||||||
CONSULTS_DIR: Sets the location of new porjects
|
CONSULTS_DIR: Sets the location of new projects
|
||||||
(default: ~/work/consults)
|
(default: ~/work/consults)
|
||||||
|
|
||||||
CONSULT_ORIGIN_BASE_URL: Sets the base url for the project git origin.
|
CONSULT_ORIGIN_BASE_URL: Sets the base url for the project git origin.
|
||||||
@@ -58,59 +61,73 @@ EOF
|
|||||||
|
|
||||||
# Logging utility function, use in place of echo.
|
# Logging utility function, use in place of echo.
|
||||||
log() {
|
log() {
|
||||||
logging log --source "$THIS_FILE" "$@"
|
logging log --source "$THIS_FILE" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
local customer container_dir
|
local customer container_dir script suffix
|
||||||
customer=${1:-""}
|
customer=${1:-""}
|
||||||
|
|
||||||
[[ -z $customer ]] &&
|
[[ -z $customer ]] &&
|
||||||
log --error "Must supply a customer name for the project" &&
|
log --error "Must supply a customer name for the project" &&
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
[[ ! -f $SCRIPTS/hpa ]] &&
|
log "Generating project for: '$customer'"
|
||||||
log --error "Unable to find the 'hpa' script." &&
|
|
||||||
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
|
||||||
|
|
||||||
container_dir=$(
|
[[ ! -f $SCRIPTS/hpa ]] &&
|
||||||
"$SCRIPTS/hpa" create --quiet "/consults/$date_opt.$customer"
|
log --error "Unable to find the script: '$script'." &&
|
||||||
)
|
exit 1
|
||||||
echo "$HPA_CONSULTS_DIR/$(basename "$container_dir")"
|
|
||||||
|
log "Using script: '$script'"
|
||||||
|
|
||||||
|
container_dir=$(
|
||||||
|
"$script" create --quiet "/consults/$date_opt.$customer.$suffix"
|
||||||
|
)
|
||||||
|
echo "$HPA_CONSULTS_DIR/$(basename "$container_dir")"
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize-git() {
|
initialize-git() {
|
||||||
local dir
|
local dir
|
||||||
read -r dir
|
read -r dir
|
||||||
|
|
||||||
dir=$(echo "$dir" | tr -d '\r' | head -1)
|
dir=$(echo "$dir" | tr -d '\r' | head -1)
|
||||||
|
|
||||||
if [[ $no_git_flag == "0" ]]; then
|
if [[ $no_git_flag == "0" ]]; then
|
||||||
|
|
||||||
[[ ! -d $dir ]] &&
|
[[ ! -d $dir ]] &&
|
||||||
log --error "Could not initialize git directory not found: '$dir'" &&
|
log --error "Could not initialize git directory not found: '$dir'" &&
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
log "Initializing git repository"
|
log "Initializing git repository"
|
||||||
|
|
||||||
pushd "$dir" &>/dev/null || exit 1
|
pushd "$dir" &>/dev/null || exit 1
|
||||||
(
|
(
|
||||||
git init
|
git init
|
||||||
git add .
|
git lfs install
|
||||||
git commit --all --message="Initial commit"
|
git lfs track '*.png'
|
||||||
git remote add origin "$HPA_CONSULT_ORIGIN_BASE_URL/$(basename "$dir")"
|
git lfs track '*.pdf'
|
||||||
if [[ $no_push_flag == "0" ]]; then
|
git add .
|
||||||
git push --set-upstream origin main
|
git commit --all --message="Initial commit"
|
||||||
fi
|
git remote add origin "$HPA_CONSULT_ORIGIN_BASE_URL/$(basename "$dir")"
|
||||||
) &>/dev/null
|
if [[ $no_push_flag == "0" ]]; then
|
||||||
popd &>/dev/null
|
git push --set-upstream origin main
|
||||||
else
|
fi
|
||||||
log "Skipping git initialization"
|
) &>/dev/null
|
||||||
fi
|
popd &>/dev/null
|
||||||
|
else
|
||||||
|
log "Skipping git initialization"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "$dir"
|
echo "$dir"
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -124,19 +141,21 @@ setup-logging "$LOG_FILE" "$LOG_LABEL"
|
|||||||
declare customer output
|
declare customer output
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||||
usage && exit 0
|
usage && exit 0
|
||||||
elif [[ $1 == "-d" ]] || [[ $1 == "--date" ]]; then
|
elif [[ $1 == "-a" ]] || [[ $1 == "--airflow" ]]; then
|
||||||
shift
|
airflow_flag="1"
|
||||||
date_opt="$1"
|
elif [[ $1 == "-d" ]] || [[ $1 == "--date" ]]; then
|
||||||
elif [[ $1 == "-g" ]] || [[ $1 == "--no-git" ]]; then
|
shift
|
||||||
no_git_flag="1"
|
date_opt="$1"
|
||||||
elif [[ $1 == "-p" ]] || [[ $1 == "--no-push" ]]; then
|
elif [[ $1 == "-g" ]] || [[ $1 == "--no-git" ]]; then
|
||||||
no_push_flag="1"
|
no_git_flag="1"
|
||||||
else
|
elif [[ $1 == "-p" ]] || [[ $1 == "--no-push" ]]; then
|
||||||
customer=$1
|
no_push_flag="1"
|
||||||
fi
|
else
|
||||||
shift
|
customer=$1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
output=$(create "$customer" | initialize-git)
|
output=$(create "$customer" | initialize-git)
|
||||||
|
|||||||
10
env/.local/scripts/utils/hpa/hpa.env
vendored
10
env/.local/scripts/utils/hpa/hpa.env
vendored
@@ -12,7 +12,7 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
|
|||||||
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
||||||
|
|
||||||
# Docker vars.
|
# Docker vars.
|
||||||
HPA_DOCKER_IMAGE="git.housh.dev/michael/swift-hpa"
|
HPA_DOCKER_IMAGE=${HPA_DOCKER_IMAGE:-"git.housh.dev/michael/swift-hpa"}
|
||||||
HPA_DOCKER_TAG=${HPA_DOCKER_TAG:-"latest"}
|
HPA_DOCKER_TAG=${HPA_DOCKER_TAG:-"latest"}
|
||||||
|
|
||||||
# Auto pull options to be ran before running the hpa docker
|
# Auto pull options to be ran before running the hpa docker
|
||||||
@@ -33,6 +33,11 @@ HPA_CONSULT_ORIGIN_BASE_URL=${CONSULT_ORIGIN_BASE_URL:-"ssh://git@git.housh.dev:
|
|||||||
HPA_CONSULT_TEMPLATE_DIR=${HPA_DATA_DIR}/template
|
HPA_CONSULT_TEMPLATE_DIR=${HPA_DATA_DIR}/template
|
||||||
HPA_CONSULT_TEMPLATE_URL="ssh://git@git.housh.dev:2222/hhe/consult-template.git"
|
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
|
||||||
export HPA_AUTO_PULL_INTERVAL
|
export HPA_AUTO_PULL_INTERVAL
|
||||||
export HPA_AUTO_PULL_OPTS
|
export HPA_AUTO_PULL_OPTS
|
||||||
@@ -47,3 +52,6 @@ export HPA_DOCKER_TAG
|
|||||||
export HPA_PLAYBOOK_URL
|
export HPA_PLAYBOOK_URL
|
||||||
export HPA_PLAYBOOK_DIR
|
export HPA_PLAYBOOK_DIR
|
||||||
export HPA_VAULT_SECRET_KEY
|
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"}
|
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||||
DEV_ENV=${DEV_ENV:-""}
|
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() {
|
usage() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Manages the kanata systemd service.
|
Manages the kanata systemd service.
|
||||||
|
|
||||||
USAGE:
|
USAGE:
|
||||||
@@ -21,6 +28,9 @@ USAGE:
|
|||||||
|
|
||||||
FLAGS:
|
FLAGS:
|
||||||
-h | --help: Show this help page.
|
-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:
|
COMMANDS:
|
||||||
enable: Enable the kanata service.
|
enable: Enable the kanata service.
|
||||||
@@ -40,52 +50,90 @@ EOF
|
|||||||
|
|
||||||
# Logging utility function, use in place of echo.
|
# Logging utility function, use in place of echo.
|
||||||
log() {
|
log() {
|
||||||
logging log --source "$THIS_FILE" "$@"
|
logging log --source "$THIS_FILE" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_service() {
|
enable_service() {
|
||||||
log "Enabling kanata service..."
|
log "Enabling kanata service..."
|
||||||
sudo systemctl enable kanata.service
|
if [[ $user_flag == "1" ]]; then
|
||||||
|
systemctl --user enable --now kanata.service
|
||||||
|
else
|
||||||
|
sudo systemctl enable --now kanata.service
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
get_status() {
|
get_status() {
|
||||||
log "Getting kanata service status..."
|
log "Getting kanata service status..."
|
||||||
systemctl status kanata.service
|
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() {
|
install_service() {
|
||||||
if [[ -z $DEV_ENV ]]; then
|
local service_dir="user"
|
||||||
log --error "DEV_ENV is not set properly." && exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure the configuration is copied / setup otherwise the keyboard may not work.
|
if [[ -z $DEV_ENV ]]; then
|
||||||
"$SCRIPTS/kanatactl" config install "$@"
|
log --error "DEV_ENV is not set properly." && exit 1
|
||||||
|
fi
|
||||||
|
log "Starting install service..."
|
||||||
|
|
||||||
log "Installing kanata service..."
|
# Ensure the configuration is copied / setup otherwise the keyboard may not work.
|
||||||
[[ -f /etc/systemd/system/kanata.service ]] && sudo rm -rf /etc/systemd/system/kanata.service
|
"$SCRIPTS/kanatactl" config install "$@"
|
||||||
sudo cp "$DEV_ENV/env/etc/systemd/system/kanata.service" /etc/systemd/system
|
|
||||||
sudo systemctl daemon-reload
|
# 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() {
|
start_service() {
|
||||||
log "Starting kanata service..."
|
log "Starting kanata service..."
|
||||||
systemctl start kanata.service
|
systemctl start kanata.service
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_service() {
|
stop_service() {
|
||||||
log "Stopping kanata service..."
|
log "Stopping kanata service..."
|
||||||
sudo systemctl stop kanata.service
|
sudo systemctl stop kanata.service
|
||||||
}
|
}
|
||||||
|
|
||||||
disable_service() {
|
disable_service() {
|
||||||
log "Disabling kanata service..."
|
log "Disabling kanata service..."
|
||||||
stop_service
|
stop_service
|
||||||
sudo systemctl disable kanata.service
|
sudo systemctl disable kanata.service
|
||||||
}
|
}
|
||||||
|
|
||||||
restart_service() {
|
restart_service() {
|
||||||
log "Restarting kanata service..."
|
log "Restarting kanata service..."
|
||||||
sudo systemctl restart kanata.service
|
sudo systemctl restart kanata.service
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -96,26 +144,42 @@ restart_service() {
|
|||||||
source "$SCRIPTS/hypr/logging"
|
source "$SCRIPTS/hypr/logging"
|
||||||
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||||
|
|
||||||
|
# Parse flags / arguments.
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
if [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||||
usage && exit 0
|
usage && exit 0
|
||||||
elif [[ $1 == "disable" ]]; then
|
elif [[ $1 == "--user" ]]; then
|
||||||
disable_service && exit $?
|
user_flag="1"
|
||||||
elif [[ $1 == "enable" ]]; then
|
elif [[ $1 == "--system" ]]; then
|
||||||
enable_service && exit $?
|
system_flag="1"
|
||||||
elif [[ $1 == "install" ]]; then
|
elif [[ $1 == "--prompt" ]]; then
|
||||||
shift
|
prompt_flag="1"
|
||||||
install_service "$@" && exit $?
|
# Set first non-flag to the mode / subcommand.
|
||||||
elif [[ $1 == "start" ]]; then
|
elif [[ -z $mode ]]; then
|
||||||
start_service && exit $?
|
mode="$1"
|
||||||
elif [[ $1 == "status" ]]; then
|
# Add any other arguments to the 'args' array.
|
||||||
get_status && exit $?
|
else
|
||||||
elif [[ $1 == "stop" ]]; then
|
args+=("$1")
|
||||||
stop_service && exit $?
|
fi
|
||||||
elif [[ $1 == "restart" ]]; then
|
shift
|
||||||
restart_service && exit $?
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# If we made it here, then none of the subcommands handled the args.
|
# Handle mode.
|
||||||
usage && exit 1
|
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
|
|
||||||
1
env/.tmux.conf
vendored
1
env/.tmux.conf
vendored
@@ -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_overlay_0},none]#{?window_zoomed_flag,│,}"
|
||||||
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_yellow}]#{?window_zoomed_flag, zoom ,}"
|
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_yellow}]#{?window_zoomed_flag, zoom ,}"
|
||||||
|
|
||||||
|
|
||||||
# bootstrap tpm
|
# bootstrap tpm
|
||||||
if "test ! -d ~/.tmux/plugins/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'"
|
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
|
||||||
|
|||||||
3
env/.zshenv
vendored
3
env/.zshenv
vendored
@@ -87,5 +87,8 @@ export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/starship.toml"
|
|||||||
export _ZO_DATA_DIR="$XDG_DATA_HOME"
|
export _ZO_DATA_DIR="$XDG_DATA_HOME"
|
||||||
unset _ZO_ECHO
|
unset _ZO_ECHO
|
||||||
|
|
||||||
|
# Suppress swift backtrace warnings.
|
||||||
|
export SWIFT_BACTRACE=enable=no
|
||||||
|
|
||||||
[ -f "$LOCAL_ENV" ] && source "$LOCAL_ENV"
|
[ -f "$LOCAL_ENV" ] && source "$LOCAL_ENV"
|
||||||
[ -f "$ZDOTDIR/personal.env" ] && source "$ZDOTDIR/personal.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-----
|
||||||
2
mail
2
mail
Submodule mail updated: 013f3c7c18...28ff91ffe5
56
repos
Executable file
56
repos
Executable file
@@ -0,0 +1,56 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
DEST="$HOME/dev"
|
||||||
|
dry_run_flag="0"
|
||||||
|
|
||||||
|
log() {
|
||||||
|
if [[ $dry_run_flag == "1" ]]; then
|
||||||
|
echo "[DRY RUN]: $*"
|
||||||
|
else
|
||||||
|
echo "$*"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
clone() {
|
||||||
|
local src=${1:-""}
|
||||||
|
local dest=${2:-$DEST}
|
||||||
|
log "Cloning '$src' in '$dest'"
|
||||||
|
if [[ $dry_run_flag == "0" ]]; then
|
||||||
|
pushd "$dest" || exit 1 &>/dev/null
|
||||||
|
(
|
||||||
|
git clone "$src"
|
||||||
|
)
|
||||||
|
popd &>/dev/null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install-psychrometrics() {
|
||||||
|
log "Installing psychrometrics cli."
|
||||||
|
if [[ $dry_run_flag == "0" ]]; then
|
||||||
|
local src="$DEST/psychrometrics-cli"
|
||||||
|
pushd "$src" || exit 1 &>/dev/null
|
||||||
|
(
|
||||||
|
./install-linux.sh
|
||||||
|
)
|
||||||
|
popd &>/dev/null
|
||||||
|
rm -rf "$src"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
##### MAIN #####
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
if [[ $1 =~ ^-d ]] || [[ $1 =~ ^--dry ]]; then
|
||||||
|
dry_run_flag="1"
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir -p "$DEST/sites" &>/dev/null
|
||||||
|
clone "git@github.com:m-housh/mhoush.com.git" "$DEST/sites"
|
||||||
|
clone "git@github.com:swift-psychrometrics/psychrometrics-cli.git" && install-psychrometrics
|
||||||
109
run
109
run
@@ -2,81 +2,58 @@
|
|||||||
|
|
||||||
# Adapted from https://github.com/ThePrimeagen/dev/blob/master/run
|
# Adapted from https://github.com/ThePrimeagen/dev/blob/master/run
|
||||||
#
|
#
|
||||||
# Runs scripts in the `./runs` directory, which will install or uninstall
|
# Installs packages declared in the 'runs' directory, will run scripts matching the
|
||||||
# packages. It either runs a single script given an argument (filename in runs)
|
# file name in the 'runs/before' and 'runs/after', respectively, to handle setting up or
|
||||||
# or all scripts in the runs directory.
|
# tearing down based on the run mode.
|
||||||
#
|
#
|
||||||
|
set -e
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
if [ -z "$DEV_ENV" ]; then
|
THIS_FILE=${BASH_SOURCE[0]}
|
||||||
echo "env var DEV_ENV needs to be present"
|
LOG_LABEL=$(basename $THIS_FILE)
|
||||||
exit 1
|
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||||
fi
|
|
||||||
|
|
||||||
# if i just did DEV_ENV=$(pwd) ./run then this is needed for the rest of the
|
declare dry_run grepstr mode
|
||||||
# scripts
|
|
||||||
export DEV_ENV="$DEV_ENV"
|
|
||||||
|
|
||||||
grep=""
|
|
||||||
dry_run="0"
|
|
||||||
uninstall="0"
|
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
|
||||||
echo "ARG: \"$1\""
|
|
||||||
|
|
||||||
# Handle a --dry or --dry-run argument
|
|
||||||
if [[ "$1" =~ ^--dry ]]; then
|
|
||||||
dry_run="1"
|
|
||||||
# Handle an --uninstall argument
|
|
||||||
elif [[ "$1" =~ ^--u ]]; then
|
|
||||||
uninstall="1"
|
|
||||||
# Handle an --install argument (default)
|
|
||||||
elif [[ ! "$1" =~ ^--i ]]; then
|
|
||||||
grep="$1"
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
if [[ $dry_run == "1" ]]; then
|
logging log --source "$THIS_FILE" --echo "$@"
|
||||||
echo "[DRY_RUN]: $1"
|
} && export -f log
|
||||||
else
|
|
||||||
echo "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
run() {
|
|
||||||
local script=$1
|
|
||||||
local flag=$2
|
|
||||||
log "running script: $script $flag"
|
|
||||||
|
|
||||||
local actual_flags="-S --noconfirm"
|
|
||||||
|
|
||||||
if [[ $flag == "--uninstall" ]]; then
|
|
||||||
actual_flags="-Rns"
|
|
||||||
fi
|
|
||||||
log "ok, here's the actual script:: $s $actual_flags"
|
|
||||||
|
|
||||||
if [[ $dry_run == "0" ]]; then
|
|
||||||
$script $actual_flags
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
############################## MAIN ##############################
|
############################## MAIN ##############################
|
||||||
|
|
||||||
log "RUN: env: $env -- grep: $grep"
|
# Setup logging file and label.
|
||||||
|
source "$SCRIPTS/hypr/logging"
|
||||||
|
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||||
|
|
||||||
runs_dir=$(find $DEV_ENV/runs -mindepth 1 -maxdepth 1 -executable)
|
[ -z "$DEV_ENV" ] &&
|
||||||
|
log --error "env var DEV_ENV needs to be present" &&
|
||||||
|
exit 1
|
||||||
|
|
||||||
for s in $runs_dir; do
|
grepstr=""
|
||||||
if basename $s | grep -vq "$grep"; then
|
dry_run="0"
|
||||||
log "grep \"$grep\" filtered out $s"
|
mode="install"
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $uninstall == "1" ]]; then
|
while [[ $# -gt 0 ]]; do
|
||||||
run $s --uninstall
|
if [[ "$1" =~ ^--dry ]]; then
|
||||||
else
|
dry_run="1"
|
||||||
run $s --install
|
elif [[ "$1" == "uninstall" ]]; then
|
||||||
fi
|
mode="uninstall"
|
||||||
|
elif [[ ! "$1" == "install" ]]; then
|
||||||
|
grepstr="$1"
|
||||||
|
fi
|
||||||
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
export DEV_ENV="$DEV_ENV"
|
||||||
|
export LOG_ENABLE_DRY_RUN="$dry_run"
|
||||||
|
export RUN_GREP_STR="$grepstr"
|
||||||
|
export RUN_MODE="$mode"
|
||||||
|
|
||||||
|
log "RUN: -- grep: '$grepstr'"
|
||||||
|
|
||||||
|
find "$DEV_ENV/runs" \
|
||||||
|
-mindepth 1 \
|
||||||
|
-maxdepth 1 \
|
||||||
|
-type f \
|
||||||
|
-exec bash -xc "$DEV_ENV/runs/utils/run-handler {}" \;
|
||||||
|
|||||||
31
runs/after/calendar
Executable file
31
runs/after/calendar
Executable file
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
DEV_ENV=${DEV_ENV:-""}
|
||||||
|
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"}
|
||||||
|
|
||||||
|
install() {
|
||||||
|
|
||||||
|
[[ -z $DEV_ENV ]] && echo -e "\e[031m[ERROR]:\e[0m 'DEV_ENV' not set." && exit 1
|
||||||
|
|
||||||
|
# Clone and build qcal locally, as it didn't work for me when downloading from the aur.
|
||||||
|
mkdir ~/pkgbuilds &>/dev/null
|
||||||
|
git clone https://github.com/psic4t/qcal.git ~/pkgbuilds/qcal
|
||||||
|
pushd ~/pkgbuilds/qcal &>/dev/null || exit 1
|
||||||
|
(
|
||||||
|
make && sudo make install
|
||||||
|
)
|
||||||
|
popd &>/dev/null || exit 1
|
||||||
|
|
||||||
|
# Decrypt and copy configuration file for qcal.
|
||||||
|
mkdir "$XDG_CONFIG_HOME"/qcal &>/dev/null
|
||||||
|
gpg --output "$XDG_CONFIG_HOME"/qcal/config.json --decrypt "$DEV_ENV"/env/qcal/config.json.gpg
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall() {
|
||||||
|
sudo rm /usr/local/bin/qcal
|
||||||
|
rm -rf ~/pkgbuilds/qcal
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
[[ $arg == "install" ]] && install
|
||||||
|
[[ $arg == "uninstall" ]] && uninstall
|
||||||
18
runs/after/clipse
Executable file
18
runs/after/clipse
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
|
||||||
|
|
||||||
|
install() {
|
||||||
|
log " Ensure clipse data directory exists, and start clipse."
|
||||||
|
mkdir -p "$XDG_DATA_HOME/clipse" &>/dev/null
|
||||||
|
setsid uwsm app -- clipse -listen
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall() {
|
||||||
|
log " Removing clipse data directory."
|
||||||
|
rm -rf "$XDG_DATA_HOME/clipse"
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
[[ $arg == "install" ]] && install && exit $?
|
||||||
|
[[ $arg == "uninstall" ]] && uninstall && exit $?
|
||||||
23
runs/after/dev
Executable file
23
runs/after/dev
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
install() {
|
||||||
|
# TODO: Handle install / uninstall.
|
||||||
|
bob install nightly &&
|
||||||
|
bob install stable &&
|
||||||
|
bob use nightly
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall() {
|
||||||
|
echo "FIX ME!"
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
|
||||||
|
if [[ $arg == "install" ]]; then
|
||||||
|
install && exit $?
|
||||||
|
elif [[ $arg == "uninstall" ]]; then
|
||||||
|
uninstall && exit $?
|
||||||
|
else
|
||||||
|
# TODO: Using logging.
|
||||||
|
echo "Error, invalid option" && exit 1
|
||||||
|
fi
|
||||||
16
runs/after/espanso
Executable file
16
runs/after/espanso
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
install() {
|
||||||
|
log " Setting up espanso."
|
||||||
|
sudo setcap "cap_dac_override+p" "$(which espanso)"
|
||||||
|
espanso service register
|
||||||
|
systemctl --user daemon-reload
|
||||||
|
espanso service start
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
[[ $arg == "install" ]] && install && exit 0
|
||||||
16
runs/after/gopass
Executable file
16
runs/after/gopass
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
XDG_DATA_HOME=${XDG_DATA_HOME:-"$HOME"/.local/share}
|
||||||
|
|
||||||
|
install() {
|
||||||
|
[[ ! -d "$XDG_DATA_HOME/gopass/stores/root" ]] &&
|
||||||
|
gopass clone ssh://git@git.housh.dev:2222/michael/passwordstore.git
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall() {
|
||||||
|
[[ -d "$XDG_DATA_HOME/gopass" ]] && rm -rf "$XDG_DATA_HOME/gopass"
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
[[ $arg == "install" ]] && install
|
||||||
|
[[ $arg == "uninstall" ]] && uninstall
|
||||||
18
runs/after/jellyfin-tui
Executable file
18
runs/after/jellyfin-tui
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
DEV_ENV=${DEV_ENV:-""}
|
||||||
|
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"}
|
||||||
|
|
||||||
|
install() {
|
||||||
|
[[ -z $DEV_ENV ]] && echo "[ERROR]: DEV_ENV not set" && exit 1
|
||||||
|
mkdir -p "$XDG_CONFIG_HOME"/jellyfin-tui &>/dev/null
|
||||||
|
gpg --output "$XDG_CONFIG_HOME"/jellyfin-tui/config.yaml --decrypt "$DEV_ENV"/env/jellyfin-tui/config.gpg
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall() {
|
||||||
|
rm -rf ~/.config/jellyfin-tui
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
[[ $arg == "install" ]] && install
|
||||||
|
[[ $arg == "uninstall" ]] && uninstall
|
||||||
17
runs/after/localsend
Executable file
17
runs/after/localsend
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
install() {
|
||||||
|
sudo firewall-cmd --zone=public --permanent --add-port=53317/tcp
|
||||||
|
sudo firewall-cmd --zone=public --permanent --add-port=53317/udp
|
||||||
|
sudo firewall-cmd --reload
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall() {
|
||||||
|
sudo firewall-cmd --zone=public --permanent --remove-port=53317/tcp
|
||||||
|
sudo firewall-cmd --zone=public --permanent --remove-port=53317/udp
|
||||||
|
sudo firewall-cmd --reload
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
[[ $arg == "install" ]] && install
|
||||||
|
[[ $arg == "uninstall" ]] && uninstall
|
||||||
94
runs/after/system
Executable file
94
runs/after/system
Executable file
@@ -0,0 +1,94 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
# Set scripts to be in the DEV_ENV folder encase they have not been
|
||||||
|
# installed yet.
|
||||||
|
SCRIPTS="${DEV_ENV}/env/.local/scripts"
|
||||||
|
|
||||||
|
_ensure_mount() {
|
||||||
|
local line=${1:-""}
|
||||||
|
local mount=${2:-""}
|
||||||
|
if [[ -n $line ]] && [[ -d $mount ]]; then
|
||||||
|
if sudo cat /etc/fstab | grep -vq "$line"; then
|
||||||
|
log " Setting up nas mount."
|
||||||
|
# sudo mkdir -p $mount &>/dev/null
|
||||||
|
echo "$line" | sudo tee --append /etc/fstab
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo mount -a ||
|
||||||
|
log --warning "You will need to make sure this computer's ip is in the allow list, then run 'sudo mount -a'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_setup-mounts() {
|
||||||
|
|
||||||
|
sudo mkdir -p /mnt/{michael,customers} &>/dev/null
|
||||||
|
mkdir -p "$HOME/work" &>/dev/null
|
||||||
|
|
||||||
|
_ensure_mount "nas.housh.dev:/var/nfs/shared/michael_share /mnt/michael nfs defaults 0 0" /mnt/michael
|
||||||
|
_ensure_mount "//nas.housh.dev/michael_share/work $HOME/work cifs credentials=$HOME/.config/.smbcredentials,uid=$(id -u),gid=$(id -g),iocharset=utf8 0 0" "$HOME/work"
|
||||||
|
_ensure_mount "nas.housh.dev:/var/nfs/shared/Customer_Share /mnt/customers nfs defaults 0 0" /mnt/customers
|
||||||
|
}
|
||||||
|
|
||||||
|
_setup-kanata() {
|
||||||
|
log " Setting up kanata udev rules."
|
||||||
|
sudo groupadd --system uinput
|
||||||
|
sudo usermod -aG input "$USER"
|
||||||
|
sudo usermod -aG uinput "$USER"
|
||||||
|
[[ ! -f /etc/udev/rules.d/99-input.rules ]] &&
|
||||||
|
(
|
||||||
|
echo 'KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"' |
|
||||||
|
sudo tee /etc/udev/rules.d/99-input.rules
|
||||||
|
) &&
|
||||||
|
sudo udevadm control --reload-rules &&
|
||||||
|
sudo udevadm trigger &&
|
||||||
|
sudo modprobe uinput
|
||||||
|
log " Setting up kanata, using kanatactl."
|
||||||
|
SCRIPTS="$SCRIPTS" "$SCRIPTS/kanatactl" service install --prompt
|
||||||
|
}
|
||||||
|
|
||||||
|
_setup-gpg() {
|
||||||
|
log " Setting up gpg."
|
||||||
|
mkdir -p ~/{.gnupg,.ssh} &>/dev/null
|
||||||
|
chmod 700 ~/.gnupg
|
||||||
|
chmod 700 ~/.ssh
|
||||||
|
local dir=/tmp/gpg-public-key
|
||||||
|
git clone https://git.housh.dev/michael/gpg-public-key.git "$dir"
|
||||||
|
pushd "$dir" &>/dev/null || exit 1
|
||||||
|
(
|
||||||
|
source ./import
|
||||||
|
)
|
||||||
|
popd &>/dev/null || exit 1
|
||||||
|
rm -rf "$dir"
|
||||||
|
}
|
||||||
|
|
||||||
|
_setup-home-dir() {
|
||||||
|
log " Setting up home directory."
|
||||||
|
rm -rf "$HOME/Desktop" &>/dev/null
|
||||||
|
mkdir "$HOME/{containers,dev}" &>/dev/null
|
||||||
|
mkdir -p "$HOME/work" &>/dev/null
|
||||||
|
gpg --decrypt --output "$HOME/.config/.smbcredentials" "$DEV_ENV/env/smbcredentials.gpg"
|
||||||
|
chmod 600 "$HOME/.config/.smbcredentials"
|
||||||
|
}
|
||||||
|
|
||||||
|
install() {
|
||||||
|
log " Setting user shell to 'zsh'."
|
||||||
|
sudo chsh --shell "$(which zsh)"
|
||||||
|
log " Enabling systemd services."
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable --now pcscd.service
|
||||||
|
sudo systemctl enable --now firewalld.service
|
||||||
|
systemctl --user enable --now logout-task.service
|
||||||
|
systemctl --user enable --now battery-monitor.timer
|
||||||
|
systemctl --user enable --now tmux-kill-sessions.timer
|
||||||
|
_setup-kanata
|
||||||
|
_setup-mounts
|
||||||
|
_setup-gpg
|
||||||
|
_setup-home-dir
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
[[ $arg == "install" ]] && install
|
||||||
17
runs/after/zathura
Executable file
17
runs/after/zathura
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
install() {
|
||||||
|
xdg-mime default org.pwmt.zathura.desktop application/pdf
|
||||||
|
}
|
||||||
|
|
||||||
|
uninstall() {
|
||||||
|
xdg-mime default brave-browser.desktop application/pdf
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
[[ $arg == "install" ]] && install
|
||||||
|
[[ $arg == "uninstall" ]] && uninstall
|
||||||
15
runs/audio
Executable file → Normal file
15
runs/audio
Executable file → Normal file
@@ -1,8 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
pipewire
|
||||||
yay ${1:-"-S --noconfirm"} pipewire \
|
pavucontrol
|
||||||
pavucontrol \
|
wireplumber
|
||||||
wireplumber \
|
pipewire-jack
|
||||||
pipewire-jack \
|
pipewire-pulse
|
||||||
pipewire-pulse \
|
blueberry-wayland
|
||||||
blueberry-wayland
|
|
||||||
|
|||||||
4
runs/before/dev
Executable file
4
runs/before/dev
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# yay -S --noconfirm --needed rustup
|
||||||
|
# rustup default stable
|
||||||
13
runs/before/espanso
Executable file
13
runs/before/espanso
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
uninstall() {
|
||||||
|
log " Tearing down espanso."
|
||||||
|
espanso service stop
|
||||||
|
espanso service unregister
|
||||||
|
}
|
||||||
|
|
||||||
|
arg=${1:-""}
|
||||||
|
[[ $arg == "uninstall" ]] && uninstall && exit 0
|
||||||
9
runs/before/yay
Executable file
9
runs/before/yay
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if ! command -v yay >/dev/null 2>&1; then
|
||||||
|
sudo pacman -S --noconfirm --needed git base-devel
|
||||||
|
git clone https://aur.archlinux.org/yay.git ~/yay
|
||||||
|
cd ~/yay
|
||||||
|
makepkg -si
|
||||||
|
rm -rf ~/yay
|
||||||
|
fi
|
||||||
5
runs/brave
Executable file → Normal file
5
runs/brave
Executable file → Normal file
@@ -1,3 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
brave-bin
|
||||||
yay ${1:-"-S --noconfirm"} brave-bin
|
|
||||||
|
|||||||
3
runs/calendar
Normal file
3
runs/calendar
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
go
|
||||||
|
gnome-calendar
|
||||||
|
gnome-keyring
|
||||||
7
runs/clipse
Executable file → Normal file
7
runs/clipse
Executable file → Normal file
@@ -1,3 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
#
|
||||||
yay ${1:-"-S --noconfirm"} clipse
|
# Clipse manages clipboard history.
|
||||||
|
clipse
|
||||||
|
|||||||
58
runs/dev
Executable file → Normal file
58
runs/dev
Executable file → Normal file
@@ -1,36 +1,26 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
if ! command -v yay >/dev/null 2>&1; then
|
|
||||||
sudo pacman -S --noconfirm --needed git base-devel
|
|
||||||
git clone https://aur.archlinux.org/yay.git ~/yay
|
|
||||||
cd ~/yay
|
|
||||||
makepkg -si
|
|
||||||
rm -rf ~/yay
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Packages
|
# Packages
|
||||||
yay -S --noconfirm --needed \
|
bat
|
||||||
bat \
|
bob
|
||||||
bob \
|
eza
|
||||||
eza \
|
fastfetch
|
||||||
fastfetch \
|
fzf
|
||||||
fzf \
|
git-lfs
|
||||||
git-lfs \
|
github-cli
|
||||||
gum \
|
gum
|
||||||
jq \
|
jq
|
||||||
neovim \
|
libtexprintf
|
||||||
nodejs \
|
neovim
|
||||||
npm \
|
nodejs
|
||||||
pcre2 \
|
npm
|
||||||
ripgrep \
|
pcre2
|
||||||
starship \
|
ripgrep
|
||||||
tldr \
|
starship
|
||||||
tmux \
|
tldr
|
||||||
tree-sitter-cli \
|
tmux
|
||||||
zoxide
|
tree-sitter-cli
|
||||||
|
yazi
|
||||||
|
zoxide
|
||||||
# Fonts
|
# Fonts
|
||||||
yay -S --noconfirm \
|
ttf-jetbrains-mono-nerd
|
||||||
ttf-jetbrains-mono-nerd \
|
ttf-firacode
|
||||||
ttf-firacode \
|
ttf-inconsolata-ne
|
||||||
ttf-inconsolata-nerd
|
|
||||||
|
|||||||
5
runs/espanso
Executable file → Normal file
5
runs/espanso
Executable file → Normal file
@@ -1,3 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
espanso-wayland-git
|
||||||
yay ${1:-"-S --noconfirm"} espanso-wayland-git
|
|
||||||
|
|||||||
8
runs/ghostty
Executable file → Normal file
8
runs/ghostty
Executable file → Normal file
@@ -1,6 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
ghostty-git
|
||||||
# Flags get passed in from the run script, but if
|
|
||||||
# ran directly the default is going to be to install.
|
|
||||||
|
|
||||||
yay "${1:-"-S --noconfirm --needed"}" ghostty
|
|
||||||
|
|||||||
6
runs/gopass
Executable file → Normal file
6
runs/gopass
Executable file → Normal file
@@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
gopass-git
|
||||||
yay ${1:-"-S --noconfirm --needed"} gopass-git git-credential-gopass
|
git-credential-gopass
|
||||||
|
|||||||
14
runs/hyprland
Executable file → Normal file
14
runs/hyprland
Executable file → Normal file
@@ -1,4 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
hyprland
|
||||||
yay ${1:-"-S --noconfirm"} hyprland hyprpaper hyrpidle hyprlock \
|
hyprpaper
|
||||||
bc # used for some scripts.
|
hypridle
|
||||||
|
hyprlock
|
||||||
|
hyprlauncher
|
||||||
|
hyprshot
|
||||||
|
xdg-desktop-portal-hyprland-git
|
||||||
|
bc # used for some scripts.
|
||||||
|
waybar
|
||||||
|
|||||||
1
runs/jellyfin-tui
Executable file
1
runs/jellyfin-tui
Executable file
@@ -0,0 +1 @@
|
|||||||
|
jellyfin-tui
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
yay ${1:-"-S --noconfirm"} rustup
|
|
||||||
|
|
||||||
$DEV_ENV/env/.local/scripts/kanatactl bootstrap
|
|
||||||
5
runs/localsend
Executable file → Normal file
5
runs/localsend
Executable file → Normal file
@@ -1,3 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
localsend-bin
|
||||||
yay ${1:-"-S --noconfirm"} localsend-bin
|
|
||||||
|
|||||||
7
runs/nautilus
Executable file → Normal file
7
runs/nautilus
Executable file → Normal file
@@ -1,3 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
nautilus
|
||||||
yay ${1:-"-S --noconfirm"} nautilus nautilus-share gvfs-smb
|
nautilus-share
|
||||||
|
gvfs-smb
|
||||||
|
|||||||
32
runs/neomutt
Executable file → Normal file
32
runs/neomutt
Executable file → Normal file
@@ -1,17 +1,17 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
|
||||||
yay ${1:-"-S --noconfirm"} neomutt \
|
neomutt
|
||||||
abook \
|
abook
|
||||||
mutt-wizard \
|
mutt-wizard
|
||||||
goimapnotify \
|
goimapnotify
|
||||||
lynx \
|
lynx
|
||||||
notmuch \
|
notmuch
|
||||||
urlview \
|
urlview
|
||||||
cronie \
|
cronie
|
||||||
protonmail-bridge \
|
protonmail-bridge
|
||||||
isync \
|
isync
|
||||||
msmtp \
|
msmtp
|
||||||
pass \
|
pass
|
||||||
ca-certificates \
|
ca-certificates
|
||||||
gettext \
|
gettext
|
||||||
cyrus-sasl-xoauth2-git
|
cyrus-sasl-xoauth2-git
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Needs installed from AUR.
|
|
||||||
if [[ ! $(yay -Q libajantv2 2>/dev/null) ]]; then
|
|
||||||
yay -S libajantv2
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd $HOME/pkgbuilds/obs-studio-arm && makepkg -si
|
|
||||||
3
runs/pika-backup
Normal file
3
runs/pika-backup
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Packages to be installed with this run.
|
||||||
|
pika-backup
|
||||||
|
gnome-keyring
|
||||||
8
runs/podman
Executable file → Normal file
8
runs/podman
Executable file → Normal file
@@ -1,3 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run.
|
||||||
|
podman
|
||||||
yay ${1:-"-S --noconfirm"} podman podman-docker podman-compose
|
podman-docker
|
||||||
|
podman-compose
|
||||||
|
fuse-overlayfs
|
||||||
|
|||||||
25
runs/system
Executable file → Normal file
25
runs/system
Executable file → Normal file
@@ -1,12 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
# Packages to install / uninstall with this run
|
||||||
|
catppuccin-gtk-theme-mocha
|
||||||
yay ${1:-"-S --noconfirm"} catppuccin-gtk-theme-mocha \
|
cifs-utils
|
||||||
nwg-look \
|
kanata
|
||||||
wl-clipboard \
|
nwg-look
|
||||||
pam-u2f \
|
wl-clipboard
|
||||||
pcsc-tools \
|
pam-u2f
|
||||||
swaync \
|
pcsc-tools
|
||||||
yubikey-manager \
|
swaync
|
||||||
nfs-utils \
|
yubikey-manager
|
||||||
firewalld \
|
nfs-utils
|
||||||
zsh
|
firewalld
|
||||||
|
zsh
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
yay ${1:-"-S --noconfirm"} thunderbird
|
|
||||||
85
runs/utils/run-handler
Executable file
85
runs/utils/run-handler
Executable file
@@ -0,0 +1,85 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
declare file
|
||||||
|
declare -a yayflags
|
||||||
|
|
||||||
|
THIS_FILE=${BASH_SOURCE[0]}
|
||||||
|
LOG_LABEL=${LOG_LABEL:-$(basename $THIS_FILE)}
|
||||||
|
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||||
|
DEV_ENV=${DEV_ENV:-""}
|
||||||
|
|
||||||
|
MODE=${RUN_MODE:-"install"}
|
||||||
|
DRY_RUN=${LOG_ENABLE_DRY_RUN:-"0"}
|
||||||
|
GREP_STR=${RUN_GREP_STR:-""}
|
||||||
|
|
||||||
|
log() {
|
||||||
|
logging log --source "$THIS_FILE" --echo "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
run_before_or_after() {
|
||||||
|
local dir file run
|
||||||
|
dir=${1:-""}
|
||||||
|
run=${2:-""}
|
||||||
|
|
||||||
|
file=$(find "$dir" -mindepth 1 -maxdepth 1 -executable -name "$(basename "$run")" | head -1)
|
||||||
|
if [[ -n "$file" ]]; then
|
||||||
|
log " running $(basename "$dir") script: '$file'"
|
||||||
|
[[ $DRY_RUN == "0" ]] && source "$file" "$mode"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
local line pkg
|
||||||
|
|
||||||
|
log "RUN: file: $file"
|
||||||
|
|
||||||
|
if [[ -z $GREP_STR ]] || [[ $file =~ $GREP_STR ]]; then
|
||||||
|
|
||||||
|
log "${MODE}ing packages from: $file"
|
||||||
|
|
||||||
|
run_before_or_after "$DEV_ENV/runs/before" "$file"
|
||||||
|
|
||||||
|
# Loop over lines in the file and install the packages.
|
||||||
|
while IFS= read -r line; do
|
||||||
|
# Skip lines that begin with '#' (comments)
|
||||||
|
if [[ ! $line =~ ^# ]]; then
|
||||||
|
# Remove any inline comments.
|
||||||
|
pkg=${line%% \#*}
|
||||||
|
if [[ -n $pkg ]]; then
|
||||||
|
log " pkg: '$pkg'"
|
||||||
|
[[ $DRY_RUN == "0" ]] && yay "${yayflags[@]}" "$pkg"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done <"$file"
|
||||||
|
|
||||||
|
run_before_or_after "$DEV_ENV/runs/after" "$file"
|
||||||
|
else
|
||||||
|
log "Grep filtered out: '$file'"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
############################## MAIN ##############################
|
||||||
|
|
||||||
|
# Setup logging file and label.
|
||||||
|
source "$SCRIPTS/hypr/logging"
|
||||||
|
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||||
|
|
||||||
|
file=${1:-""}
|
||||||
|
yayflags=("-S" "--noconfirm" "--needed")
|
||||||
|
|
||||||
|
[[ -z "$DEV_ENV" ]] &&
|
||||||
|
log --error "env var DEV_ENV needs to be present" && exit 1
|
||||||
|
[[ ! -r $file ]] &&
|
||||||
|
log --error "File not readable." && exit 1
|
||||||
|
|
||||||
|
# Change yay flags if mode is 'uninstall'
|
||||||
|
[[ $MODE == "uninstall" ]] && yayflags=("-Rns")
|
||||||
|
|
||||||
|
# Ensure yay is installed before proceeding.
|
||||||
|
[[ $DRY_RUN == "0" ]] && . "$DEV_ENV/runs/before/yay"
|
||||||
|
|
||||||
|
main
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
yay ${1:-"-S --noconfirm"} walker elephant elephant-calc elephant-symbols
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
yay ${1:-"-S --noconfirm"} waybar
|
|
||||||
3
runs/zathura
Normal file
3
runs/zathura
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Packages to install with this run.
|
||||||
|
zathura
|
||||||
|
zathura-pdf-poppler
|
||||||
43
system
43
system
@@ -1,43 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Enable system services.
|
|
||||||
|
|
||||||
dry_run="0"
|
|
||||||
while [[ $# -gt 0 ]]; do
|
|
||||||
echo "ARG: \"$1\""
|
|
||||||
|
|
||||||
# Handle a --dry or --dry-run argument
|
|
||||||
if [[ "$1" =~ ^--dry ]]; then
|
|
||||||
dry_run="1"
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
log() {
|
|
||||||
if [[ $dry_run == "1" ]]; then
|
|
||||||
echo "[DRY_RUN]: $1"
|
|
||||||
else
|
|
||||||
echo "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
log_and_run() {
|
|
||||||
log "Running: \"$*\""
|
|
||||||
|
|
||||||
if [[ $dry_run == "0" ]]; then
|
|
||||||
eval "$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
log_and_run "sudo chsh --shell $(which zsh)"
|
|
||||||
log_and_run "systemctl --user daemon-reload"
|
|
||||||
log_and_run "systemctl --user enable --now hyprpaper.service"
|
|
||||||
log_and_run "systemctl --user enable --now hypridle.service"
|
|
||||||
log_and_run "espanso service register"
|
|
||||||
log_and_run "sudo setcap "cap_dac_override+p" $(which espanso)"
|
|
||||||
|
|
||||||
log_and_run "systemctl --user enable --now logout-task.service"
|
|
||||||
log_and_run "systemctl --user enable --now battery-monitor.timer"
|
|
||||||
log_and_run "systemctl --user enable --now tmux-kill-sessions.timer"
|
|
||||||
log_and_run "sudo systemctl enable --now pcscd.service"
|
|
||||||
log_and_run "sudo systemctl enable --now firewalld.service"
|
|
||||||
127
webapp
127
webapp
@@ -3,16 +3,26 @@
|
|||||||
# Installs or uninstalls webapps based on the spec in the './webapps' directory.
|
# Installs or uninstalls webapps based on the spec in the './webapps' directory.
|
||||||
#
|
#
|
||||||
# This is used when setting up a new machine.
|
# This is used when setting up a new machine.
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
THIS_FILE=${BASH_SOURCE[0]}
|
||||||
|
LOG_LABEL=$(basename $THIS_FILE)
|
||||||
|
SCRIPTS=${SCRIPTS:-$HOME/.local/scripts}
|
||||||
|
LOG_FILE=${LOG_FILE:-"$LOG_LABEL.log"}
|
||||||
|
|
||||||
if [ -z "$DEV_ENV" ]; then
|
if [ -z "$DEV_ENV" ]; then
|
||||||
echo "env var DEV_ENV needs to be present"
|
echo "env var DEV_ENV needs to be present"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$XDG_DATA_HOME" ]; then
|
if [ -z "$XDG_DATA_HOME" ]; then
|
||||||
echo "no xdg data home"
|
echo "no xdg data home"
|
||||||
echo "using ~/.local/share"
|
echo "using ~/.local/share"
|
||||||
XDG_DATA_HOME=~/.local/share
|
XDG_DATA_HOME=~/.local/share
|
||||||
fi
|
fi
|
||||||
|
|
||||||
grep=""
|
grep=""
|
||||||
@@ -20,83 +30,84 @@ dry_run="0"
|
|||||||
uninstall="0"
|
uninstall="0"
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
echo "ARG: \"$1\""
|
echo "ARG: \"$1\""
|
||||||
|
|
||||||
# Handle a --dry or --dry-run argument
|
# Handle a --dry or --dry-run argument
|
||||||
if [[ "$1" =~ ^--dry ]]; then
|
if [[ "$1" =~ ^--dry ]]; then
|
||||||
dry_run="1"
|
dry_run="1"
|
||||||
# Handle an --uninstall argument
|
# Handle an --uninstall argument
|
||||||
elif [[ "$1" =~ ^--u ]]; then
|
elif [[ "$1" =~ ^--u ]]; then
|
||||||
uninstall="1"
|
uninstall="1"
|
||||||
# Handle an --install argument (default)
|
# Handle an --install argument (default)
|
||||||
elif [[ ! "$1" =~ ^--i ]]; then
|
elif [[ ! "$1" =~ ^--i ]]; then
|
||||||
grep="$1"
|
grep="$1"
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
if [[ $dry_run == "1" ]]; then
|
logging log --source "$THIS_FILE" "$@"
|
||||||
echo "[DRY_RUN]: $1"
|
|
||||||
else
|
|
||||||
echo "$1"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
local file=$DEV_ENV/env/webapps/$(basename $1)
|
local file=$DEV_ENV/env/webapps/$(basename $1)
|
||||||
local script="$DEV_ENV/env/.local/scripts/hypr/install-webapp"
|
local script="$DEV_ENV/env/.local/scripts/hypr/webapp"
|
||||||
|
|
||||||
if [[ ! -x $script ]]; then
|
if [[ ! -x $script ]]; then
|
||||||
log "Failed to find install web app script."
|
log "Failed to find install web app script."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install local icons if needed
|
# Install local icons if needed
|
||||||
mkdir -p $XDG_DATA_HOME/applications/icons
|
mkdir -p $XDG_DATA_HOME/applications/icons
|
||||||
for i in $(find $DEV_ENV/env/.local/share/applications/icons -mindepth 1 -maxdepth 1 -type f); do
|
for i in $(find $DEV_ENV/env/.local/share/applications/icons -mindepth 1 -maxdepth 1 -type f); do
|
||||||
if [[ ! -f $XDG_DATA_HOME/applications/icons/$i ]] && [[ $dry_run == "0" ]]; then
|
if [[ ! -f $XDG_DATA_HOME/applications/icons/$i ]] && [[ $dry_run == "0" ]]; then
|
||||||
cp $i $XDG_DATA_HOME/applications/icons
|
cp $i $XDG_DATA_HOME/applications/icons
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
log "Installing webapp from spec: $file"
|
log "Installing webapp from spec: $file"
|
||||||
|
|
||||||
if [[ $dry_run == "0" ]]; then
|
if [[ $dry_run == "0" ]]; then
|
||||||
$script --file $file --no-interactive
|
$script install --file $file --no-interactive
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
uninstall() {
|
uninstall() {
|
||||||
local file=$DEV_ENV/env/webapps/$(basename $1)
|
local file=$DEV_ENV/env/webapps/$(basename $1)
|
||||||
local script="$DEV_ENV/env/.local/scripts/hypr/uninstall-desktop-app"
|
local script="$DEV_ENV/env/.local/scripts/hypr/uninstall-desktop-app"
|
||||||
|
|
||||||
if [[ ! -x $script ]]; then
|
if [[ ! -x $script ]]; then
|
||||||
log "Failed to find uninstall web app script."
|
log "Failed to find uninstall web app script."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Uninstalling webapp from spec: $file"
|
log "Uninstalling webapp from spec: $file"
|
||||||
|
|
||||||
if [[ $dry_run == "0" ]]; then
|
if [[ $dry_run == "0" ]]; then
|
||||||
$script --file $file
|
$script --file $file
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
############################## MAIN ##############################
|
############################## MAIN ##############################
|
||||||
|
|
||||||
|
# Setup logging file and label.
|
||||||
|
source "$SCRIPTS/hypr/logging"
|
||||||
|
setup-logging "$LOG_FILE" "$LOG_LABEL"
|
||||||
|
export LOG_ENABLE_DRY_RUN="$dry_run"
|
||||||
|
|
||||||
log "WEBAPP: -- grep: $grep"
|
log "WEBAPP: -- grep: $grep"
|
||||||
|
|
||||||
apps_dir=$(find $DEV_ENV/env/webapps -mindepth 1 -maxdepth 1 -type f)
|
apps_dir=$(find $DEV_ENV/env/webapps -mindepth 1 -maxdepth 1 -type f)
|
||||||
for s in $apps_dir; do
|
for s in $apps_dir; do
|
||||||
if basename $s | grep -vq "$grep"; then
|
if basename $s | grep -vq "$grep"; then
|
||||||
log "grep \"$grep\" filtered out $s"
|
log "grep \"$grep\" filtered out $s"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $uninstall == "1" ]]; then
|
if [[ $uninstall == "1" ]]; then
|
||||||
uninstall $s
|
uninstall $s
|
||||||
else
|
else
|
||||||
install $s
|
install $s
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user