From 6830cd6de6d874cbd045580082a908eccffb330b Mon Sep 17 00:00:00 2001 From: Brian Zalewski <59970525+ProfessorManhattan@users.noreply.github.com> Date: Mon, 7 Aug 2023 05:19:59 +0000 Subject: [PATCH] Added a bunch of bash and misc. stuff --- .vscode/settings.json | 2 +- docs/INSPIRATION.md | 1 + docs/TODO.md | 31 + home/.chezmoidata.yaml | 38 + home/.chezmoiexternal.toml.tmpl | 66 +- ...onchange_after_80-bash-completions.sh.tmpl | 16 + .../archlinux/common-dependencies | 1 + .../fedora/common-dependencies | 1 + .../secrets/HISHTORY_USER_SECRET | 7 + .../.chezmoitemplates/secrets/HOARD_API_TOKEN | 7 + home/dot_bashrc | 39 +- home/dot_config/desk/desks/tf.sh | 22 + home/dot_config/distrobox/distrobox.conf | 13 + home/dot_config/fish/config.fish | 9 + home/dot_config/git/config.tmpl | 4 +- .../dot_config/hishtory/.hishtory.config.tmpl | 22 + home/dot_config/hoard/config.yml.tmpl | 28 + home/dot_config/hoard/trove.yml | 9 + home/dot_config/jit/config.yml | 3 + home/dot_config/neofetch/config.conf | 864 ++++++++++++++++++ home/dot_config/nfty/nfty.yml | 20 + home/dot_config/nushell/config.nu | 1 + home/dot_config/nushell/env.nu | 2 + home/dot_config/oil/oshrc | 1 + home/dot_config/powershell/profile.ps1 | 5 + home/dot_config/shell/aliases.sh.tmpl | 20 +- home/dot_config/shell/exports.sh.tmpl | 12 + home/dot_config/shell/functions.sh.tmpl | 5 + .../scripts => dot_config/shell}/p10k.zsh | 0 home/dot_config/shell/private_private.sh.tmpl | 3 + home/dot_config/shell_gpt/.sgptrc.tmpl | 24 + home/dot_config/xonsh/rc.xsh | 2 + .../bin/executable_backup-app-settings | 5 - home/dot_local/bin/executable_gist.tmpl | 2 +- .../bin/executable_gitomatic-service.tmpl | 1 - home/dot_local/bin/executable_task | 11 - .../bin/mackup/executable_mackup.tmpl | 10 +- home/dot_local/bin/symlink_extract.tmpl | 3 + home/dot_local/bin/symlink_has.tmpl | 3 + home/dot_local/bin/symlink_rm.tmpl | 3 + .../bin/symlink_rsync-time-backup.tmpl | 3 + home/dot_local/bin/symlink_tmpmail.tmpl | 3 + home/dot_local/bin/symlink_wait-for-it.tmpl | 3 + home/dot_local/scripts/motd.bash | 4 + home/dot_local/scripts/pre-exec.bash | 380 ++++++++ .../share/bash-completion/bash_completion | 0 .../completions/aqua.bash.tmpl | 3 + .../completions/atuin.bash.tmpl | 3 + .../completions/bashly.bash.tmpl | 3 + .../completions/deno.bash.tmpl | 3 + .../completions/direnv.bash.tmpl | 3 + .../bash-completion/completions/fig.bash.tmpl | 3 + .../completions/fuck.bash.tmpl | 3 + .../completions/fzf-key-bindings.bash | 103 +++ .../bash-completion/completions/fzf.bash | 383 ++++++++ .../bash-completion/completions/gh.bash.tmpl | 3 + .../bash-completion/completions/gradle.bash | 382 ++++++++ .../completions/helm.bash.tmpl | 3 + .../completions/hoard.bash.tmpl | 3 + .../completions/kubectl.bash.tmpl | 3 + .../completions/ngrok.bash.tmpl | 3 + .../bash-completion/completions/npm.bash.tmpl | 3 + .../bash-completion/completions/plz.bash.tmpl | 3 + .../completions/poetry.bash.tmpl | 3 + .../completions/portal.bash.tmpl | 3 + .../completions/sake.bash.tmpl | 3 + .../completions/volta.bash.tmpl | 3 + .../share/bash-completion/completions/wp.bash | 24 + .../share/zsh-completion/atuin.zsh.tmpl | 3 + home/dot_zshrc | 33 +- home/private_dot_ssh/private_config.tmpl | 5 +- home/private_dot_ssh/system/sshd_config.tmpl | 3 +- software.yml | 326 ++++++- 73 files changed, 2985 insertions(+), 40 deletions(-) create mode 100644 home/.chezmoitemplates/secrets/HISHTORY_USER_SECRET create mode 100644 home/.chezmoitemplates/secrets/HOARD_API_TOKEN create mode 100644 home/dot_config/desk/desks/tf.sh create mode 100644 home/dot_config/distrobox/distrobox.conf create mode 100644 home/dot_config/hishtory/.hishtory.config.tmpl create mode 100644 home/dot_config/hoard/config.yml.tmpl create mode 100644 home/dot_config/hoard/trove.yml create mode 100644 home/dot_config/jit/config.yml create mode 100644 home/dot_config/neofetch/config.conf create mode 100644 home/dot_config/nfty/nfty.yml create mode 100644 home/dot_config/nushell/config.nu create mode 100644 home/dot_config/nushell/env.nu create mode 100644 home/dot_config/oil/oshrc rename home/{dot_local/scripts => dot_config/shell}/p10k.zsh (100%) create mode 100644 home/dot_config/shell_gpt/.sgptrc.tmpl create mode 100644 home/dot_config/xonsh/rc.xsh delete mode 100644 home/dot_local/bin/executable_backup-app-settings delete mode 100644 home/dot_local/bin/executable_task create mode 100644 home/dot_local/bin/symlink_extract.tmpl create mode 100644 home/dot_local/bin/symlink_has.tmpl create mode 100644 home/dot_local/bin/symlink_rm.tmpl create mode 100644 home/dot_local/bin/symlink_rsync-time-backup.tmpl create mode 100644 home/dot_local/bin/symlink_tmpmail.tmpl create mode 100644 home/dot_local/bin/symlink_wait-for-it.tmpl create mode 100644 home/dot_local/scripts/pre-exec.bash create mode 100644 home/dot_local/share/bash-completion/bash_completion create mode 100644 home/dot_local/share/bash-completion/completions/aqua.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/atuin.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/bashly.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/deno.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/direnv.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/fig.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/fuck.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/fzf-key-bindings.bash create mode 100644 home/dot_local/share/bash-completion/completions/fzf.bash create mode 100644 home/dot_local/share/bash-completion/completions/gh.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/gradle.bash create mode 100644 home/dot_local/share/bash-completion/completions/helm.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/hoard.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/kubectl.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/ngrok.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/npm.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/plz.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/poetry.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/portal.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/sake.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/volta.bash.tmpl create mode 100644 home/dot_local/share/bash-completion/completions/wp.bash create mode 100644 home/dot_local/share/zsh-completion/atuin.zsh.tmpl diff --git a/.vscode/settings.json b/.vscode/settings.json index 1f60933a..49034f06 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,7 +12,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[json]": { - "editor.defaultFormatter": "dbaeumer.vscode-eslint" + "editor.defaultFormatter": "vscode.json-language-features" }, "[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/docs/INSPIRATION.md b/docs/INSPIRATION.md index 850662a6..2d4c0cda 100644 --- a/docs/INSPIRATION.md +++ b/docs/INSPIRATION.md @@ -1,5 +1,6 @@ ## CLI +* https://github.com/sigoden/argc * https://github.com/r-darwish/idnt * https://github.com/charmbracelet/wish * https://github.com/charmbracelet/skate diff --git a/docs/TODO.md b/docs/TODO.md index 1613da78..53ac4483 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -6,8 +6,11 @@ xattr -d com.apple.quarantine rclone This page outlines various projects and tasks that we are currently working on. Creating a GitHub issue for each of these items would be overkill. +* https://containertoolbx.org/install/ +* https://github.com/todotxt/todo.txt-cli * https://github.com/PromtEngineer/localGPT * https://github.com/StanGirard/quivr +* https://github.com/containers/toolbox * [IP Fire](https://www.ipfire.org/) - Consider as alternative to pfSense on Qubes. * `git-credential-manager configure` * [`git-credential-manager` for WSL](https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/wsl.md) @@ -25,6 +28,13 @@ This page outlines various projects and tasks that we are currently working on. * https://github.com/containers/toolbox consider for p10k.zsh file * Figure out where Vector service fits in * Figure out if Squid can be used to improve web surfing speed +* https://github.com/mumoshu/variant (With Task) +* https://github.com/marshyski/quick-secure +* https://www.haskell.org/ghcup/install/#how-to-install +* https://github.com/material-shell/material-shell +* https://github.com/arxanas/git-branchless +* https://github.com/mumoshu/variant2 +* https://github.com/burnison/tasksync ## Upstream @@ -167,6 +177,7 @@ The following items may be incorporated into our Kubernetes stack: * https://github.com/gimlet-io/gimlet * https://github.com/porter-dev/porter * https://github.com/spacecloud-io/space-cloud +* https://github.com/meilisearch/meilisearch ## Bare Metal @@ -231,3 +242,23 @@ The following items have been reviewed but need to be revisited due to complexit ## Sources * [Title](https://gist.github.com/pmkay/e09034971b6f23214fd9f95a3e6d1c44) + +## Bash + +* https://github.com/shellfire-dev/shellfire +* https://github.com/joehillen/sysz +* https://github.com/eth-p/bat-extras +* https://github.com/ddworken/hishtory +* https://github.com/sloria/doitlive +* https://github.com/ncarlier/webhookd +* https://github.com/0xacx/chatGPT-shell-cli +* https://github.com/hectorm/hblock https://github.com/tanrax/maza-ad-blocking +* https://github.com/rossmacarthur/sheldon + +## Bookmarks + +* https://cheatsheets.zip/ + +## Windows + +* https://github.com/DDoSolitary/LxRunOffline \ No newline at end of file diff --git a/home/.chezmoidata.yaml b/home/.chezmoidata.yaml index dd335c3f..50ca7550 100644 --- a/home/.chezmoidata.yaml +++ b/home/.chezmoidata.yaml @@ -170,6 +170,7 @@ softwareGroups: - shell-gpt Android: &Android - apktool + - repo - scrcpy Android-Desktop: &Android-Desktop - android-studio @@ -256,11 +257,14 @@ softwareGroups: - bat - bottom - broot + - carapace - cheat - chezmoi + - clipboard - curl - curlie - delta + - desk - direnv - docker-langserver - dog @@ -274,12 +278,16 @@ softwareGroups: - firefox-profile - fkill - fzf + - ghcup - git - glances - glow - gnu + - goto - gping - gum + - hishtory + - hoard - htmlq # htmlq is used by the the Firefox script - hyperfine - jq @@ -289,9 +297,11 @@ softwareGroups: - nb - neovim - netcat + - nfty - nmap - nnn - node + - nushell - oh-my-posh - pass - postfix @@ -315,6 +325,8 @@ softwareGroups: - tree - vim - volta + - xpanes + - xxh - watchexec - watchman - wget @@ -324,8 +336,11 @@ softwareGroups: - zoxide - zsh - zx + - zenity CLI-Extras: &CLI-Extras + - ack - axel + - bashly - bin - bitly - brew-gem @@ -358,7 +373,9 @@ softwareGroups: - is-up - jiq - jqp + - just - litecli + - loop - marp - mods - mycli @@ -367,6 +384,7 @@ softwareGroups: - normit - pastel - peco + - percol - pidcat - pgcli - pywhat @@ -374,6 +392,8 @@ softwareGroups: - s-search - sad - search-gpt + - shml + - shx - slack-term - slides - social-analyzer @@ -389,8 +409,12 @@ softwareGroups: - tmuxinator - up - wallpaper-cli + - whereami + - wipe-modules + - xh - xz - yank + - zsh-completions Cloud: &Cloud - awscli - aws-shell @@ -467,11 +491,14 @@ softwareGroups: - taplo - textql - toml-sort + - xsv - xurls - yj - yq Database: &Database - iredis + - mariadb + - mongodb - octosql - sqlite - steampipe @@ -562,6 +589,7 @@ softwareGroups: Git: &Git - aicommits - commitizen + - forgit - gh - gist - git @@ -583,6 +611,7 @@ softwareGroups: - lazygit - multi-gitter - opencommit + - repo - starred - tig Git-Desktop: &Git-Desktop @@ -639,6 +668,7 @@ softwareGroups: - lens Linting: &Linting - ansible-lint + - cloc - dockfmt - dotenv-linter - dprint @@ -688,6 +718,7 @@ softwareGroups: - tinypng - vidmerger - wkhtmltopdf + - you-get - youtube-dl - yt-dlp Media-Desktop: &Media-Desktop @@ -885,6 +916,7 @@ softwareGroups: - sshpass - sync-ssh-keys - teleport + - tmate - wetty - wishlist Security: &Security @@ -901,6 +933,7 @@ softwareGroups: - pony - protonvpn-cli - quark-engine + - scap-security-guide - skate - ssh-vault - sshuttle @@ -924,6 +957,7 @@ softwareGroups: Server: &Server - cockpit - cups + - haproxy - netdata - samba - sftpgo @@ -948,6 +982,7 @@ softwareGroups: - gtop - htop - ipmitool + - iproute2mac - masscan - pulumi - sysbench @@ -1005,6 +1040,7 @@ softwareGroups: - nativefier Virtualization: &Virtualization - d2vm + - distrobox - kvm - libguestfs-tools - lxdc @@ -1014,6 +1050,7 @@ softwareGroups: - vagrant - vagrant-vmware-utility - vermin + - xhyve Virtualization-Desktop: &Virtualization-Desktop - docker-desktop - gnome-boxes @@ -1092,6 +1129,7 @@ softwareGroups: - semantic-release - serve - serverless + - sphinx - storybook - surge - trellis diff --git a/home/.chezmoiexternal.toml.tmpl b/home/.chezmoiexternal.toml.tmpl index 0fac5b36..aa9553c5 100644 --- a/home/.chezmoiexternal.toml.tmpl +++ b/home/.chezmoiexternal.toml.tmpl @@ -1,5 +1,5 @@ -### VIM {{- $refreshPeriod := "240h" }} +### VIM Plugins {{- $vimPlugins := .softwarePlugins.vim.plugins }} {{- range $vimPlugin := $vimPlugins }} {{- $folderName := trimSuffix ".git" (last (splitList "/" $vimPlugin)) }} @@ -92,6 +92,64 @@ refreshPeriod = "{{ $refreshPeriod }}" clone.args = ["--depth", "1"] pull.args = ["--ff-only"] +[".local/share/has"] + type = "git-repo" + url = "https://github.com/kdabir/has.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] +[".local/share/wait-for-it"] + type = "git-repo" + url = "https://github.com/vishnubob/wait-for-it.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] +[".local/share/hoard"] + type = "git-repo" + url = "https://github.com/Hyde46/hoard.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] +[".local/share/shell-safe-rm"] + type = "git-repo" + url = "https://github.com/kaelzhang/shell-safe-rm.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] +[".local/share/extract"] + type = "git-repo" + url = "https://github.com/xvoland/Extract.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] +[".local/share/up"] + type = "git-repo" + url = "https://github.com/shannonmoeller/up.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] +[".local/share/shell/sensible.bash"] + type = "file" + url = "https://raw.githubusercontent.com/mrzool/bash-sensible/master/sensible.bash" + refreshPeriod = "https://raw.githubusercontent.com/mrzool/bash-sensible/master/sensible.bash" +[".local/share/rsync-time-backup"] + type = "git-repo" + url = "https://github.com/laurent22/rsync-time-backup.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] +[".local/share/tmpmail"] + type = "git-repo" + url = "https://github.com/sdushantha/tmpmail.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] +[".local/share/concurrent"] + type = "git-repo" + url = "https://github.com/themattrix/bash-concurrent.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] #[".local/oh-my-bash"] # type = "git-repo" # url = "https://github.com/ohmybash/oh-my-bash.git" @@ -229,6 +287,12 @@ refreshPeriod = "{{ $refreshPeriod }}" clone.args = ["--depth", "1"] pull.args = ["--ff-only"] +[".local/share/kaguya"] + type = "git-repo" + url = "https://github.com/ykdojo/kaguya.git" + refreshPeriod = "{{ $refreshPeriod }}" + clone.args = ["--depth", "1"] + pull.args = ["--ff-only"] [".local/share/localgpt"] type = "git-repo" url = "https://github.com/PromtEngineer/localGPT.git" diff --git a/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.sh.tmpl b/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.sh.tmpl index 64e172be..7be920fa 100644 --- a/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.sh.tmpl +++ b/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.sh.tmpl @@ -66,6 +66,13 @@ elif [ -f "$COMPLETION_DIR/fzf.bash" ]; then rm -f "$COMPLETION_DIR/fzf-key-bindings.bash" fi +### fuck +if command -v fuck > /dev/null; then + thefuck --alias > "$COMPLETION_DIR/thefuck.bash" +elif [ -f "$COMPLETION_DIR/thefuck.bash" ]; then + rm -f "$COMPLETION_DIR/thefuck.bash" +fi + ### gh if command -v gh > /dev/null; then gh completion -s bash > "$COMPLETION_DIR/gh.bash" @@ -94,6 +101,15 @@ elif [ -f "$COMPLETION_DIR/helm.bash" ]; then rm -f "$COMPLETION_DIR/helm.bash" fi +### Hoard +if command -v hoard > /dev/null; then + hoard shell-config --shell bash > "$COMPLETION_DIR/hoard.bash" + hoard shell-config --shell zsh > "$COMPLETION_DIR/hoard.zsh" +elif [ -f "$COMPLETION_DIR/hoard.bash" ]; then + rm -f "$COMPLETION_DIR/hoard.bash" + rm -rf "$COMPLETION_DIR/hoard.zsh" +fi + ### Hyperfine if command -v hyperfine > /dev/null && command -v brew > /dev/null && [ -f "$(brew --prefix hyperfine)/etc/bash_completion.d/hyperfine.bash" ]; then cp -f "$(brew --prefix hyperfine)/etc/bash_completion.d/hyperfine.bash" "$COMPLETION_DIR/hyperfine.bash" diff --git a/home/.chezmoitemplates/archlinux/common-dependencies b/home/.chezmoitemplates/archlinux/common-dependencies index 27f0fe50..c23ea82d 100644 --- a/home/.chezmoitemplates/archlinux/common-dependencies +++ b/home/.chezmoitemplates/archlinux/common-dependencies @@ -15,6 +15,7 @@ "openssl" "pcsclite" "progress" + "readline" "sddm" "secure-delete" "tk" diff --git a/home/.chezmoitemplates/fedora/common-dependencies b/home/.chezmoitemplates/fedora/common-dependencies index c43ee6d2..98786258 100644 --- a/home/.chezmoitemplates/fedora/common-dependencies +++ b/home/.chezmoitemplates/fedora/common-dependencies @@ -18,6 +18,7 @@ "pcsc-lite" "pcsc-tools" "progress" + "readline-devel" "ruby-devel" "sddm" "xorg-x11-fonts-Type1" diff --git a/home/.chezmoitemplates/secrets/HISHTORY_USER_SECRET b/home/.chezmoitemplates/secrets/HISHTORY_USER_SECRET new file mode 100644 index 00000000..702f6e8a --- /dev/null +++ b/home/.chezmoitemplates/secrets/HISHTORY_USER_SECRET @@ -0,0 +1,7 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0U1ozN3A3L1NqMXZFQUox +LzRSZjduZU9yNnlJNnFpRGFVOEFVZ0RabDE4CjNZUG5hbUVHZVNVbDFNbW1XcmFC +R0Qvd29kTmIxZWVHQmZMOFJkVE5NanMKLS0tIHk4eGRNblM5cXJOemRWcXdIaXh3 +NXZteWJ4SHZ6TFNxVmRXSXBTWE53N1kKfU5ZQ2apeijh2ZcHaUG72cXQVDIBTIOI +/8gTU2aQfRacJAcX6DkT+yqRDEbKksOLi7LKP1LqTDYoA9D2Ykq2FHGfEJY= +-----END AGE ENCRYPTED FILE----- \ No newline at end of file diff --git a/home/.chezmoitemplates/secrets/HOARD_API_TOKEN b/home/.chezmoitemplates/secrets/HOARD_API_TOKEN new file mode 100644 index 00000000..1cb78ae1 --- /dev/null +++ b/home/.chezmoitemplates/secrets/HOARD_API_TOKEN @@ -0,0 +1,7 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBFU2JITEtUQUFFdERGRGFR +SG8yR0lWK3JvK1A4bWV6L1FvVW9pU2tVMFV3ClVGRnBBSE1lUFd6dHVSVkVCNHlV +Q3BieHlVOVZteHc0WFJHZjRtWU80cW8KLS0tICtFVmZDb09uSTZHRHVSMDdkWGpi +d3ExSlZDUmd6SHVzelkzNlVmWGxMRUUKJcTV5GOGDkg0+FArCdu5sqnMScUquzzd +gW07Xst3RijpwtkcW15HPeFB06MzPUR5b8QSppopp+RZx/BXqmpdk3guiWcOyCRd +-----END AGE ENCRYPTED FILE----- \ No newline at end of file diff --git a/home/dot_bashrc b/home/dot_bashrc index 15909b04..9448e844 100644 --- a/home/dot_bashrc +++ b/home/dot_bashrc @@ -7,6 +7,12 @@ if [[ "$(hostname)" != *'-minimal' ]]; then export LC_ALL="en_US.UTF-8" fi +### Sensible Bash +# Source: https://github.com/mrzool/bash-sensible +if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/shell/sensible.bash" ]; then + . "${XDG_DATA_HOME:-$HOME/.local/share}/shell/sensible.bash" +fi + # Detect support for advanced terminal features if [ "$0" = 'bash' ] || [ "$0" = '/bin/bash' ]; then export BASH_SUPPORT=true @@ -43,6 +49,15 @@ if [ "$BASH_SUPPORT" = 'true' ]; then fi fi +### Pre-exec +# Source: https://github.com/rcaloras/bash-preexec +if [ -f "$HOME/.local/scripts/pre-exec.sh" ]; then + export __bp_enable_subshells="true" + . "$HOME/.local/scripts/pre-exec.sh" + preexec() { echo "just typed $1"; } + precmd() { echo "printing the prompt"; } +fi + ### History export HISTFILE="$XDG_STATE_HOME/bash/history" if [ -d "$HISTFILE" ]; then @@ -94,6 +109,11 @@ if [ "$BASH_SUPPORT" = 'true' ]; then eval "$(atuin init bash)" fi + ### Carapace + if command -v carapace > /dev/null; then + source <(carapace _carapace) + fi + ### Cod if command -v cod > /dev/null; then . <(cod init $$ bash) @@ -114,6 +134,17 @@ if [ "$BASH_SUPPORT" = 'true' ]; then . <(emplace init bash) fi + ### hiSHtory + if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/hishtory/config.sh" ]; then + export PATH="$PATH:${XDG_CONFIG_HOME:-$HOME/.config}/hishtory" + . "${XDG_CONFIG_HOME:-$HOME/.config}/hishtory/config.sh" + fi + + ### Hoard + if command -v hoard > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/hoard/src/shell/hoard.bash" ]; then + . "${XDG_DATA_HOME:-$HOME/.local/share}/hoard/src/shell/hoard.bash" + fi + ### iTerm2 if [ -f "$HOME/.local/scripts/iterm2.bash" ]; then . "$HOME/.local/scripts/iterm2.bash" @@ -175,9 +206,9 @@ if [ "$BASH_SUPPORT" = 'true' ]; then . "$SDKMAN_DIR/bin/sdkman-init.sh" fi - ### The Fuck - if command -v thefuck > /dev/null; then - eval "$(thefuck --alias)" + ### Up + if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh" ]; then + . "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh" fi ### Vault @@ -187,7 +218,7 @@ if [ "$BASH_SUPPORT" = 'true' ]; then ### zoxide if command -v zoxide > /dev/null; then - eval "$(zoxide init --cmd z bash)" > /dev/null + eval "$(zoxide init bash)" > /dev/null else alias z='cd' fi diff --git a/home/dot_config/desk/desks/tf.sh b/home/dot_config/desk/desks/tf.sh new file mode 100644 index 00000000..7bb57c2f --- /dev/null +++ b/home/dot_config/desk/desks/tf.sh @@ -0,0 +1,22 @@ +# tf.sh +# +# Description: desk for doing work on a terraform-based repository +# + +cd ~/terraform-repo + +# Set up AWS env variables: +set_aws_env() { + export AWS_ACCESS_KEY_ID="$1" + export AWS_SECRET_ACCESS_KEY="$2" +} + +# Run `terraform plan` with proper AWS var config +plan() { + terraform plan -module-depth=-1 \ + -var "access_key=${AWS_ACCESS_KEY_ID}" \ + -var "secret_key=${AWS_SECRET_ACCESS_KEY}" +} + +# Run `terraform apply` with proper AWS var config +alias apply='terraform apply' \ No newline at end of file diff --git a/home/dot_config/distrobox/distrobox.conf b/home/dot_config/distrobox/distrobox.conf new file mode 100644 index 00000000..3c463fd3 --- /dev/null +++ b/home/dot_config/distrobox/distrobox.conf @@ -0,0 +1,13 @@ +container_always_pull="1" +container_generate_entry=0 +container_manager="docker" +container_image_default="registry.opensuse.org/opensuse/toolbox:latest" +container_name_default="distrobox" +container_user_custom_home="$HOME/.local/share/distrobox" +# container_init_hook="~/.local/distrobox/a_custom_default_init_hook.sh" +# container_pre_init_hook="~/a_custom_default_pre_init_hook.sh" +# container_manager_additional_flags="--env-file /path/to/file --custom-flag" +# container_additional_volumes="/example:/example1 /example2:/example3:ro" +# non_interactive="1" +skip_workdir="0" +# PATH="$PATH:/path/to/custom/podman" \ No newline at end of file diff --git a/home/dot_config/fish/config.fish b/home/dot_config/fish/config.fish index 73bbeda0..3ca0d3d1 100644 --- a/home/dot_config/fish/config.fish +++ b/home/dot_config/fish/config.fish @@ -7,3 +7,12 @@ end if test -d (brew --prefix)"/share/fish/vendor_completions.d" set -gx fish_complete_path $fish_complete_path (brew --prefix)/share/fish/vendor_completions.d end + +### Carapace +# Source: https://rsteube.github.io/carapace-bin/setup.html +mkdir -p ~/.config/fish/completions +carapace --list | awk '{print $1}' | xargs -I{} touch ~/.config/fish/completions/{}.fish # disable auto-loaded completions (#185) +carapace _carapace | source + +### Up +source ~/.local/share/up/up.fish \ No newline at end of file diff --git a/home/dot_config/git/config.tmpl b/home/dot_config/git/config.tmpl index ec34cbc9..bf50c932 100644 --- a/home/dot_config/git/config.tmpl +++ b/home/dot_config/git/config.tmpl @@ -63,9 +63,9 @@ helper = cache --timeout=3600 credentialStore = {{ if eq .host.distro.id "darwin" }}keychain{{ else }}{{ if eq .host.distro.id "windows" }}wincredman{{ else }}secretservice{{ end }}{{ end }} [credential "https://github.com"] - helper = !gh auth git-credential + helper = !{{ output "which" "gh" }} auth git-credential [credential "https://gist.github.com"] - helper = !gh auth git-credential + helper = !{{ output "which" "gh" }} auth git-credential [delta] features = Betelgeuse [delta "Betelgeuse"] diff --git a/home/dot_config/hishtory/.hishtory.config.tmpl b/home/dot_config/hishtory/.hishtory.config.tmpl new file mode 100644 index 00000000..55784b27 --- /dev/null +++ b/home/dot_config/hishtory/.hishtory.config.tmpl @@ -0,0 +1,22 @@ +{ + "user_secret": "{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "HISHTORY_USER_SECRET")) }}{{ includeTemplate "secrets/HISHTORY_USER_SECRET" | decrypt | trim }}{{ else }}{{ env "HISHTORY_USER_SECRET" }}{{ end }}", + "is_enabled": true, + "last_saved_history_line": "", + "have_missed_uploads": false, + "missed_upload_timestamp": 0, + "have_completed_initial_import": true, + "enable_control_r_search": true, + "displayed_columns": [ + "Hostname", + "CWD", + "Timestamp", + "Runtime", + "Exit Code", + "Command", + "Git Remote" + ], + "custom_columns":[{"column_name":"Git Remote","column_command":"(git remote -v 2\u003e/dev/null | grep origin 1\u003e/dev/null ) \u0026\u0026 git remote get-url origin || true"}], + "is_offline": false, + "filter_duplicate_commands": true, + "timestamp_format": "Jan 2 2006 15:04:05 MST" +} \ No newline at end of file diff --git a/home/dot_config/hoard/config.yml.tmpl b/home/dot_config/hoard/config.yml.tmpl new file mode 100644 index 00000000..b6011871 --- /dev/null +++ b/home/dot_config/hoard/config.yml.tmpl @@ -0,0 +1,28 @@ +--- +version: 1.4.0 +default_namespace: default +config_home_path: {{ .host.home }}/.config/hoard +trove_path: {{ .host.home }}/.config/hoard/trove.yml +query_prefix: " >" +primary_color: + - 242 + - 229 + - 188 +secondary_color: + - 181 + - 118 + - 20 +tertiary_color: + - 50 + - 48 + - 47 +command_color: + - 180 + - 118 + - 20 +parameter_token: "#" +parameter_ending_token: "!" +read_from_current_directory: true +sync_server_url: "https://troveserver.herokuapp.com/" +api_token: {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "HOARD_API_TOKEN")) }}{{ includeTemplate "secrets/HOARD_API_TOKEN" | decrypt | trim }}{{ else }}{{ env "HOARD_API_TOKEN" }}{{ end }} +gpt_api_key: {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "OPENAI_API_KEY")) }}{{ includeTemplate "secrets/OPENAI_API_KEY" | decrypt | trim }}{{ else }}{{ env "OPENAI_API_KEY" }}{{ end }} \ No newline at end of file diff --git a/home/dot_config/hoard/trove.yml b/home/dot_config/hoard/trove.yml new file mode 100644 index 00000000..efcbc8ad --- /dev/null +++ b/home/dot_config/hoard/trove.yml @@ -0,0 +1,9 @@ +--- +version: 1.4.0 +commands: + - name: pimps_flayers + namespace: default + tags: + - test + command: "echo \"Sup pimps and flayers\"" + description: Echoes a test command. \ No newline at end of file diff --git a/home/dot_config/jit/config.yml b/home/dot_config/jit/config.yml new file mode 100644 index 00000000..0e62e9a0 --- /dev/null +++ b/home/dot_config/jit/config.yml @@ -0,0 +1,3 @@ +packages: + - loop + - percol \ No newline at end of file diff --git a/home/dot_config/neofetch/config.conf b/home/dot_config/neofetch/config.conf new file mode 100644 index 00000000..16da9b00 --- /dev/null +++ b/home/dot_config/neofetch/config.conf @@ -0,0 +1,864 @@ +# See this wiki page for more info: +# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info +print_info() { + info title + info underline + + info "OS" distro + info "Host" model + info "Kernel" kernel + info "Uptime" uptime + # info "Packages" packages + info "Shell" shell + info "Resolution" resolution + info "DE" de + info "WM" wm + info "WM Theme" wm_theme + info "Theme" theme + info "Icons" icons + info "Terminal" term + info "Terminal Font" term_font + info "CPU" cpu + info "GPU" gpu + info "Memory" memory + + # info "GPU Driver" gpu_driver # Linux/macOS only + # info "CPU Usage" cpu_usage + # info "Disk" disk + # info "Battery" battery + # info "Font" font + # info "Song" song + # [[ "$player" ]] && prin "Music Player" "$player" + info "Local IP" local_ip + info "Public IP" public_ip + # info "Users" users + # info "Locale" locale # This only works on glibc systems. + + info cols +} + +# Title + + +# Hide/Show Fully qualified domain name. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --title_fqdn +title_fqdn="off" + + +# Kernel + + +# Shorten the output of the kernel function. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --kernel_shorthand +# Supports: Everything except *BSDs (except PacBSD and PC-BSD) +# +# Example: +# on: '4.8.9-1-ARCH' +# off: 'Linux 4.8.9-1-ARCH' +kernel_shorthand="on" + + +# Distro + + +# Shorten the output of the distro function +# +# Default: 'off' +# Values: 'on', 'tiny', 'off' +# Flag: --distro_shorthand +# Supports: Everything except Windows and Haiku +distro_shorthand="off" + +# Show/Hide OS Architecture. +# Show 'x86_64', 'x86' and etc in 'Distro:' output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --os_arch +# +# Example: +# on: 'Arch Linux x86_64' +# off: 'Arch Linux' +os_arch="on" + + +# Uptime + + +# Shorten the output of the uptime function +# +# Default: 'on' +# Values: 'on', 'tiny', 'off' +# Flag: --uptime_shorthand +# +# Example: +# on: '2 days, 10 hours, 3 mins' +# tiny: '2d 10h 3m' +# off: '2 days, 10 hours, 3 minutes' +uptime_shorthand="on" + + +# Memory + + +# Show memory pecentage in output. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --memory_percent +# +# Example: +# on: '1801MiB / 7881MiB (22%)' +# off: '1801MiB / 7881MiB' +memory_percent="off" + +# Change memory output unit. +# +# Default: 'mib' +# Values: 'kib', 'mib', 'gib' +# Flag: --memory_unit +# +# Example: +# kib '1020928KiB / 7117824KiB' +# mib '1042MiB / 6951MiB' +# gib: ' 0.98GiB / 6.79GiB' +memory_unit="mib" + + +# Packages + + +# Show/Hide Package Manager names. +# +# Default: 'tiny' +# Values: 'on', 'tiny' 'off' +# Flag: --package_managers +# +# Example: +# on: '998 (pacman), 8 (flatpak), 4 (snap)' +# tiny: '908 (pacman, flatpak, snap)' +# off: '908' +package_managers="on" + + +# Shell + + +# Show the path to $SHELL +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --shell_path +# +# Example: +# on: '/bin/bash' +# off: 'bash' +shell_path="off" + +# Show $SHELL version +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --shell_version +# +# Example: +# on: 'bash 4.4.5' +# off: 'bash' +shell_version="on" + + +# CPU + + +# CPU speed type +# +# Default: 'bios_limit' +# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. +# Flag: --speed_type +# Supports: Linux with 'cpufreq' +# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. +speed_type="bios_limit" + +# CPU speed shorthand +# +# Default: 'off' +# Values: 'on', 'off'. +# Flag: --speed_shorthand +# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz +# +# Example: +# on: 'i7-6500U (4) @ 3.1GHz' +# off: 'i7-6500U (4) @ 3.100GHz' +speed_shorthand="off" + +# Enable/Disable CPU brand in output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_brand +# +# Example: +# on: 'Intel i7-6500U' +# off: 'i7-6500U (4)' +cpu_brand="on" + +# CPU Speed +# Hide/Show CPU speed. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_speed +# +# Example: +# on: 'Intel i7-6500U (4) @ 3.1GHz' +# off: 'Intel i7-6500U (4)' +cpu_speed="on" + +# CPU Cores +# Display CPU cores in output +# +# Default: 'logical' +# Values: 'logical', 'physical', 'off' +# Flag: --cpu_cores +# Support: 'physical' doesn't work on BSD. +# +# Example: +# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) +# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) +# off: 'Intel i7-6500U @ 3.1GHz' +cpu_cores="logical" + +# CPU Temperature +# Hide/Show CPU temperature. +# Note the temperature is added to the regular CPU function. +# +# Default: 'off' +# Values: 'C', 'F', 'off' +# Flag: --cpu_temp +# Supports: Linux, BSD +# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable +# coretemp kernel module. This only supports newer Intel processors. +# +# Example: +# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2°C]' +# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0°F]' +# off: 'Intel i7-6500U (4) @ 3.1GHz' +cpu_temp="off" + + +# GPU + + +# Enable/Disable GPU Brand +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gpu_brand +# +# Example: +# on: 'AMD HD 7950' +# off: 'HD 7950' +gpu_brand="on" + +# Which GPU to display +# +# Default: 'all' +# Values: 'all', 'dedicated', 'integrated' +# Flag: --gpu_type +# Supports: Linux +# +# Example: +# all: +# GPU1: AMD HD 7950 +# GPU2: Intel Integrated Graphics +# +# dedicated: +# GPU1: AMD HD 7950 +# +# integrated: +# GPU1: Intel Integrated Graphics +gpu_type="all" + + +# Resolution + + +# Display refresh rate next to each monitor +# Default: 'off' +# Values: 'on', 'off' +# Flag: --refresh_rate +# Supports: Doesn't work on Windows. +# +# Example: +# on: '1920x1080 @ 60Hz' +# off: '1920x1080' +refresh_rate="off" + + +# Gtk Theme / Icons / Font + + +# Shorten output of GTK Theme / Icons / Font +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --gtk_shorthand +# +# Example: +# on: 'Numix, Adwaita' +# off: 'Numix [GTK2], Adwaita [GTK3]' +gtk_shorthand="off" + + +# Enable/Disable gtk2 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk2 +# +# Example: +# on: 'Numix [GTK2], Adwaita [GTK3]' +# off: 'Adwaita [GTK3]' +gtk2="on" + +# Enable/Disable gtk3 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk3 +# +# Example: +# on: 'Numix [GTK2], Adwaita [GTK3]' +# off: 'Numix [GTK2]' +gtk3="on" + + +# IP Address + + +# Website to ping for the public IP +# +# Default: 'http://ident.me' +# Values: 'url' +# Flag: --ip_host +public_ip_host="http://ident.me" + +# Public IP timeout. +# +# Default: '2' +# Values: 'int' +# Flag: --ip_timeout +public_ip_timeout=2 + + +# Desktop Environment + + +# Show Desktop Environment version +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --de_version +de_version="on" + + +# Disk + + +# Which disks to display. +# The values can be any /dev/sdXX, mount point or directory. +# NOTE: By default we only show the disk info for '/'. +# +# Default: '/' +# Values: '/', '/dev/sdXX', '/path/to/drive'. +# Flag: --disk_show +# +# Example: +# disk_show=('/' '/dev/sdb1'): +# 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 823G / 893G (93%)' +# +# disk_show=('/'): +# 'Disk (/): 74G / 118G (66%)' +# +disk_show=('/') + +# Disk subtitle. +# What to append to the Disk subtitle. +# +# Default: 'mount' +# Values: 'mount', 'name', 'dir', 'none' +# Flag: --disk_subtitle +# +# Example: +# name: 'Disk (/dev/sda1): 74G / 118G (66%)' +# 'Disk (/dev/sdb2): 74G / 118G (66%)' +# +# mount: 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Local Disk): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 74G / 118G (66%)' +# +# dir: 'Disk (/): 74G / 118G (66%)' +# 'Disk (Local Disk): 74G / 118G (66%)' +# 'Disk (Videos): 74G / 118G (66%)' +# +# none: 'Disk: 74G / 118G (66%)' +# 'Disk: 74G / 118G (66%)' +# 'Disk: 74G / 118G (66%)' +disk_subtitle="mount" + +# Disk percent. +# Show/Hide disk percent. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --disk_percent +# +# Example: +# on: 'Disk (/): 74G / 118G (66%)' +# off: 'Disk (/): 74G / 118G' +disk_percent="on" + + +# Song + + +# Manually specify a music player. +# +# Default: 'auto' +# Values: 'auto', 'player-name' +# Flag: --music_player +# +# Available values for 'player-name': +# +# amarok +# audacious +# banshee +# bluemindo +# clementine +# cmus +# deadbeef +# deepin-music +# dragon +# elisa +# exaile +# gnome-music +# gmusicbrowser +# gogglesmm +# guayadeque +# io.elementary.music +# iTunes +# juk +# lollypop +# mocp +# mopidy +# mpd +# muine +# netease-cloud-music +# olivia +# playerctl +# pogo +# pragha +# qmmp +# quodlibet +# rhythmbox +# sayonara +# smplayer +# spotify +# strawberry +# tauonmb +# tomahawk +# vlc +# xmms2d +# xnoise +# yarock +music_player="auto" + +# Format to display song information. +# +# Default: '%artist% - %album% - %title%' +# Values: '%artist%', '%album%', '%title%' +# Flag: --song_format +# +# Example: +# default: 'Song: Jet - Get Born - Sgt Major' +song_format="%artist% - %album% - %title%" + +# Print the Artist, Album and Title on separate lines +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --song_shorthand +# +# Example: +# on: 'Artist: The Fratellis' +# 'Album: Costello Music' +# 'Song: Chelsea Dagger' +# +# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' +song_shorthand="off" + +# 'mpc' arguments (specify a host, password etc). +# +# Default: '' +# Example: mpc_args=(-h HOST -P PASSWORD) +mpc_args=() + + +# Text Colors + + +# Text Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --colors +# +# Each number represents a different part of the text in +# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' +# +# Example: +# colors=(distro) - Text is colored based on Distro colors. +# colors=(4 6 1 8 8 6) - Text is colored in the order above. +colors=(distro) + + +# Text Options + + +# Toggle bold text +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bold +bold="on" + +# Enable/Disable Underline +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --underline +underline_enabled="on" + +# Underline character +# +# Default: '-' +# Values: 'string' +# Flag: --underline_char +underline_char="-" + + +# Info Separator +# Replace the default separator with the specified string. +# +# Default: ':' +# Flag: --separator +# +# Example: +# separator="->": 'Shell-> bash' +# separator=" =": 'WM = dwm' +separator=":" + + +# Color Blocks + + +# Color block range +# The range of colors to print. +# +# Default: '0', '15' +# Values: 'num' +# Flag: --block_range +# +# Example: +# +# Display colors 0-7 in the blocks. (8 colors) +# neofetch --block_range 0 7 +# +# Display colors 0-15 in the blocks. (16 colors) +# neofetch --block_range 0 15 +block_range=(0 15) + +# Toggle color blocks +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --color_blocks +color_blocks="on" + +# Color block width in spaces +# +# Default: '3' +# Values: 'num' +# Flag: --block_width +block_width=3 + +# Color block height in lines +# +# Default: '1' +# Values: 'num' +# Flag: --block_height +block_height=1 + +# Color Alignment +# +# Default: 'auto' +# Values: 'auto', 'num' +# Flag: --col_offset +# +# Number specifies how far from the left side of the terminal (in spaces) to +# begin printing the columns, in case you want to e.g. center them under your +# text. +# Example: +# col_offset="auto" - Default behavior of neofetch +# col_offset=7 - Leave 7 spaces then print the colors +col_offset="auto" + +# Progress Bars + + +# Bar characters +# +# Default: '-', '=' +# Values: 'string', 'string' +# Flag: --bar_char +# +# Example: +# neofetch --bar_char 'elapsed' 'total' +# neofetch --bar_char '-' '=' +bar_char_elapsed="-" +bar_char_total="=" + +# Toggle Bar border +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bar_border +bar_border="on" + +# Progress bar length in spaces +# Number of chars long to make the progress bars. +# +# Default: '15' +# Values: 'num' +# Flag: --bar_length +bar_length=15 + +# Progress bar colors +# When set to distro, uses your distro's logo colors. +# +# Default: 'distro', 'distro' +# Values: 'distro', 'num' +# Flag: --bar_colors +# +# Example: +# neofetch --bar_colors 3 4 +# neofetch --bar_colors distro 5 +bar_color_elapsed="distro" +bar_color_total="distro" + + +# Info display +# Display a bar with the info. +# +# Default: 'off' +# Values: 'bar', 'infobar', 'barinfo', 'off' +# Flags: --cpu_display +# --memory_display +# --battery_display +# --disk_display +# +# Example: +# bar: '[---=======]' +# infobar: 'info [---=======]' +# barinfo: '[---=======] info' +# off: 'info' +cpu_display="off" +memory_display="off" +battery_display="off" +disk_display="off" + + +# Backend Settings + + +# Image backend. +# +# Default: 'ascii' +# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', +# 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' +# Flag: --backend +image_backend="ascii" + +# Image Source +# +# Which image or ascii file to display. +# +# Default: 'auto' +# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' +# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' +# Flag: --source +# +# NOTE: 'auto' will pick the best image source for whatever image backend is used. +# In ascii mode, distro ascii art will be used and in an image mode, your +# wallpaper will be used. +image_source="auto" + + +# Ascii Options + + +# Ascii distro +# Which distro's ascii art to display. +# +# Default: 'auto' +# Values: 'auto', 'distro_name' +# Flag: --ascii_distro +# NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", +# "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, +# ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, +# Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, +# BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, +# Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, +# Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, +# DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, +# EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, +# FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, +# gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, +# Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, +# Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, +# LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, +# Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, +# Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, +# NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, +# OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, +# Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, +# popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, +# Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, +# Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, +# Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, +# SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, +# openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, +# Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, +# Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, +# and IRIX have ascii logos +# NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. +# Use '{distro name}_old' to use the old logos. +# NOTE: Ubuntu has flavor variants. +# Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, +# Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. +# NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, +# CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, +# Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, +# Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, +# Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, +# postmarketOS, and Void have a smaller logo variant. +# Use '{distro name}_small' to use the small variants. +ascii_distro="auto" + +# Ascii Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --ascii_colors +# +# Example: +# ascii_colors=(distro) - Ascii is colored based on Distro colors. +# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. +ascii_colors=(distro) + +# Bold ascii logo +# Whether or not to bold the ascii logo. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --ascii_bold +ascii_bold="on" + + +# Image Options + + +# Image loop +# Setting this to on will make neofetch redraw the image constantly until +# Ctrl+C is pressed. This fixes display issues in some terminal emulators. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --loop +image_loop="off" + +# Thumbnail directory +# +# Default: '~/.cache/thumbnails/neofetch' +# Values: 'dir' +thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" + +# Crop mode +# +# Default: 'normal' +# Values: 'normal', 'fit', 'fill' +# Flag: --crop_mode +# +# See this wiki page to learn about the fit and fill options. +# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F +crop_mode="normal" + +# Crop offset +# Note: Only affects 'normal' crop mode. +# +# Default: 'center' +# Values: 'northwest', 'north', 'northeast', 'west', 'center' +# 'east', 'southwest', 'south', 'southeast' +# Flag: --crop_offset +crop_offset="center" + +# Image size +# The image is half the terminal width by default. +# +# Default: 'auto' +# Values: 'auto', '00px', '00%', 'none' +# Flags: --image_size +# --size +image_size="auto" + +# Gap between image and text +# +# Default: '3' +# Values: 'num', '-num' +# Flag: --gap +gap=3 + +# Image offsets +# Only works with the w3m backend. +# +# Default: '0' +# Values: 'px' +# Flags: --xoffset +# --yoffset +yoffset=0 +xoffset=0 + +# Image background color +# Only works with the w3m backend. +# +# Default: '' +# Values: 'color', 'blue' +# Flag: --bg_color +background_color= + + +# Misc Options + +# Stdout mode +# Turn off all colors and disables image backend (ASCII/Image). +# Useful for piping into another command. +# Default: 'off' +# Values: 'on', 'off' +stdout="off" \ No newline at end of file diff --git a/home/dot_config/nfty/nfty.yml b/home/dot_config/nfty/nfty.yml new file mode 100644 index 00000000..3cefc1ec --- /dev/null +++ b/home/dot_config/nfty/nfty.yml @@ -0,0 +1,20 @@ +--- +# backends: +# - pushover +pushover: + user_key: hunter2 +pushbullet: + access_token: hunter2 +simplepush: + key: hunter2 +slack: + token: slacktoken + recipient: "#slackchannel" +xmpp: + jid: "user@gmail.com" + password: "xxxx" + mtype: "chat" + recipient: "me@jit.si" +cellphone: + backend: pushover + user_key: hunter2 \ No newline at end of file diff --git a/home/dot_config/nushell/config.nu b/home/dot_config/nushell/config.nu new file mode 100644 index 00000000..a6657ed4 --- /dev/null +++ b/home/dot_config/nushell/config.nu @@ -0,0 +1 @@ +source ~/.cache/carapace/init.nu \ No newline at end of file diff --git a/home/dot_config/nushell/env.nu b/home/dot_config/nushell/env.nu new file mode 100644 index 00000000..3445e82f --- /dev/null +++ b/home/dot_config/nushell/env.nu @@ -0,0 +1,2 @@ +mkdir ~/.cache/carapace +carapace _carapace nushell | save --force ~/.cache/carapace/init.nu \ No newline at end of file diff --git a/home/dot_config/oil/oshrc b/home/dot_config/oil/oshrc new file mode 100644 index 00000000..d629fc39 --- /dev/null +++ b/home/dot_config/oil/oshrc @@ -0,0 +1 @@ +source <(carapace _carapace) \ No newline at end of file diff --git a/home/dot_config/powershell/profile.ps1 b/home/dot_config/powershell/profile.ps1 index e996694b..c120318a 100644 --- a/home/dot_config/powershell/profile.ps1 +++ b/home/dot_config/powershell/profile.ps1 @@ -24,6 +24,11 @@ foreach ($module in $modules) { Import-Module $module -Force } +### Carapace +Set-PSReadLineOption -Colors @{ "Selection" = "`e[7m" } +Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete +carapace _carapace | Out-String | Invoke-Expression + ### Homebrew Add-Content -Path $PROFILE.CurrentUserAllHosts -Value '$(/usr/local/bin/brew shellenv) | Invoke-Expression' diff --git a/home/dot_config/shell/aliases.sh.tmpl b/home/dot_config/shell/aliases.sh.tmpl index e1424890..067aa190 100644 --- a/home/dot_config/shell/aliases.sh.tmpl +++ b/home/dot_config/shell/aliases.sh.tmpl @@ -26,7 +26,8 @@ alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' alias diff='diff --color=auto' -alias ip='ip --color=auto' +# iproute2mac not working with this alias +# alias ip='ip --color=auto' alias pacman='pacman --color=auto' ### TOP - order based on preference of "top" application (last item will always be chosen if installed, e.g. glances) @@ -179,6 +180,9 @@ alias plist-xml='plutil -convert xml1' # Recoverpy alias recoverpy='python3 -m recoverpy' +# Performance Test +alias perftest='mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/perftest" && curl -sL yabs.sh | bash -s -- -w "${XDG_DATA_HOME:-$HOME/.local/share}/perftest/$(date +%Y%m%d_%H%M%S)"' + # Show open ports alias ports='sudo netstat -tulanp' @@ -258,3 +262,17 @@ alias yarn='yarn --use-yarnrc "$XDG_CONFIG_HOME/yarn/config"' # Running this will update GPG to point to the current YubiKey alias yubi-stub='gpg-connect-agent "scd serialno" "learn --force" /bye' + +### cd aliases + +alias applications="cd $HOME/Applications" +alias cloud="cd $HOME/Cloud" +alias config="cd $HOME/.config" +alias desktop="cd $HOME/Desktop" +alias downloads="cd $HOME/Downloads" +alias library="cd $HOME/Library" +alias local="cd $HOME/.local" +alias movies="cd $HOME/Movies" +alias music="cd $HOME/Music" +alias pictures="cd $HOME/Pictures" +alias public="cd $HOME/Public" \ No newline at end of file diff --git a/home/dot_config/shell/exports.sh.tmpl b/home/dot_config/shell/exports.sh.tmpl index 2c0ed14b..60ec239e 100644 --- a/home/dot_config/shell/exports.sh.tmpl +++ b/home/dot_config/shell/exports.sh.tmpl @@ -160,6 +160,13 @@ if command -v fzf > /dev/null; then export CHEAT_USE_FZF=true fi +### Concurrent +export CONCURRENT_LOG_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/concurrent" + +### Desk +export DESK_DIR="$XDG_CONFIG_HOME/desk" +export DESK_DESKS_DIR="$XDG_CONFIG_HOME/desk/desks" + ### Deta export DETA_INSTALL="$XDG_DATA_HOME/deta" export PATH="$PATH:$DETA_INSTALL/bin" @@ -230,6 +237,11 @@ fi ### Gradle export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle" +### Hishtory +export HISHTORY_PATH="$XDG_CONFIG_HOME/hishtory" +export HSTR_CONFIG=hicolor +export HSTR_TIOCSTI=y + ### Homebrew export HOMEBREW_BUNDLE_FILE="$XDG_CONFIG_HOME/Brewfile" export HOMEBREW_CASK_OPTS="--appdir=/Applications --display-times" diff --git a/home/dot_config/shell/functions.sh.tmpl b/home/dot_config/shell/functions.sh.tmpl index 523d123c..781cb6a3 100644 --- a/home/dot_config/shell/functions.sh.tmpl +++ b/home/dot_config/shell/functions.sh.tmpl @@ -4,6 +4,11 @@ # @description # This script is included by `~/.bashrc` and `~/.zshrc` to provide various commands and functions. +### Bash Concurrent +if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/concurrent/concurrent.lib.sh" ]; then + . "${XDG_DATA_HOME:-$HOME/.local/share}/concurrent/concurrent.lib.sh" +fi + # Install WebDriverAgent on iOS device appiumwebdriver() { # read -r "Enter the UDID of the device you wish to install WebDriverAgent on: " UDID_INPUT diff --git a/home/dot_local/scripts/p10k.zsh b/home/dot_config/shell/p10k.zsh similarity index 100% rename from home/dot_local/scripts/p10k.zsh rename to home/dot_config/shell/p10k.zsh diff --git a/home/dot_config/shell/private_private.sh.tmpl b/home/dot_config/shell/private_private.sh.tmpl index c2e3a03e..e5bad37a 100644 --- a/home/dot_config/shell/private_private.sh.tmpl +++ b/home/dot_config/shell/private_private.sh.tmpl @@ -51,6 +51,9 @@ export GITLAB_RUNNER_TOKEN="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoite ### Heroku export HEROKU_API_KEY="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "HEROKU_API_KEY")) }}{{ includeTemplate "secrets/HEROKU_API_KEY" | decrypt | trim }}{{ else }}{{ env "HEROKU_API_KEY" }}{{ end }}" +### Hishtory +export HISHTORY_USER_SECRET="{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "HISHTORY_USER_SECRET")) }}{{ includeTemplate "secrets/HISHTORY_USER_SECRET" | decrypt | trim }}{{ else }}{{ env "HISHTORY_USER_SECRET" }}{{ end }}" + ### Install Doctor # TODO: Replace HEADLESS_INSTALL with {{ .host.headless }} data source once headless install detection is implemented # export HEADLESS_INSTALL={{ .host.headless }} diff --git a/home/dot_config/shell_gpt/.sgptrc.tmpl b/home/dot_config/shell_gpt/.sgptrc.tmpl new file mode 100644 index 00000000..a6441a5a --- /dev/null +++ b/home/dot_config/shell_gpt/.sgptrc.tmpl @@ -0,0 +1,24 @@ +# API key, also it is possible to define OPENAI_API_KEY env. +OPENAI_API_KEY={{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "OPENAI_API_KEY")) }}{{ includeTemplate "secrets/OPENAI_API_KEY" | decrypt | trim }}{{ else }}{{ env "OPENAI_API_KEY" }}{{ end }} +# OpenAI host, useful if you would like to use proxy. +OPENAI_API_HOST=https://api.openai.com +# Max amount of cached message per chat session. +CHAT_CACHE_LENGTH=100 +# Chat cache folder. +CHAT_CACHE_PATH=/tmp/shell_gpt/chat_cache +# Request cache length (amount). +CACHE_LENGTH=100 +# Request cache folder. +CACHE_PATH=/tmp/shell_gpt/cache +# Request timeout in seconds. +REQUEST_TIMEOUT=60 +# Default OpenAI model to use. +DEFAULT_MODEL=gpt-3.5-turbo +# Default color for OpenAI completions. +DEFAULT_COLOR=magenta +# Force use system role messages (not recommended). +SYSTEM_ROLES=false +# When in --shell mode, default to "Y" for no input. +DEFAULT_EXECUTE_SHELL_CMD=false +# Disable streaming of responses +DISABLE_STREAMING=false \ No newline at end of file diff --git a/home/dot_config/xonsh/rc.xsh b/home/dot_config/xonsh/rc.xsh new file mode 100644 index 00000000..10b86c08 --- /dev/null +++ b/home/dot_config/xonsh/rc.xsh @@ -0,0 +1,2 @@ +COMPLETIONS_CONFIRM=True +exec($(carapace _carapace)) \ No newline at end of file diff --git a/home/dot_local/bin/executable_backup-app-settings b/home/dot_local/bin/executable_backup-app-settings deleted file mode 100644 index 58fdae44..00000000 --- a/home/dot_local/bin/executable_backup-app-settings +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -for DESKTOP_APP of BraveSoftware Ferdium "Google Assistant" Mailspring "Standard Notes" TeamViewer zoom.us; do - true -done \ No newline at end of file diff --git a/home/dot_local/bin/executable_gist.tmpl b/home/dot_local/bin/executable_gist.tmpl index 3d616e88..b8e6aa0a 100644 --- a/home/dot_local/bin/executable_gist.tmpl +++ b/home/dot_local/bin/executable_gist.tmpl @@ -1,5 +1,5 @@ #!/usr/bin/env bash -echo "{{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "NPM_TOKEN")) }}{{ includeTemplate "secrets/NPM_TOKEN" | decrypt | trim }}{{ else if (env "NPM_TOKEN") }}{{ env "NPM_TOKEN" }}{{ else }}${GITHUB_GIST_TOKEN}{{ end }}" > ~/.gist +echo "{{ if and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "GITHUB_GIST_TOKEN")) }}{{ includeTemplate "secrets/GITHUB_GIST_TOKEN" | decrypt | trim }}{{ else }}{{ env "GITHUB_GIST_TOKEN" }}{{ end }}" > ~/.gist gist $* rm -f ~/.gist diff --git a/home/dot_local/bin/executable_gitomatic-service.tmpl b/home/dot_local/bin/executable_gitomatic-service.tmpl index 18928388..8b45537d 100644 --- a/home/dot_local/bin/executable_gitomatic-service.tmpl +++ b/home/dot_local/bin/executable_gitomatic-service.tmpl @@ -1,5 +1,4 @@ #!/usr/bin/env bash - # @file .local/bin/gitomatic-service # @brief Helper script to run gitomatic to monitor git repositories # @description diff --git a/home/dot_local/bin/executable_task b/home/dot_local/bin/executable_task deleted file mode 100644 index 56f632ae..00000000 --- a/home/dot_local/bin/executable_task +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -if command -v task > /dev/null && [ -n "$PATH_TASK" ]; then - if [ -f Taskfile.yml ]; then - $PATH_TASK $* - else - $PATH_TASK --taskfile "${XDG_DATA_HOME:-$HOME/.local/share}/shared-common/common/Taskfile.yml" $@ - fi -else - echo 'task is not installed or PATH_TASK is not defined.' && exit 1 -fi diff --git a/home/dot_local/bin/mackup/executable_mackup.tmpl b/home/dot_local/bin/mackup/executable_mackup.tmpl index 477b7b0f..1a8477c8 100644 --- a/home/dot_local/bin/mackup/executable_mackup.tmpl +++ b/home/dot_local/bin/mackup/executable_mackup.tmpl @@ -17,17 +17,23 @@ {{ includeTemplate "universal/profile" }} {{ includeTemplate "universal/logg" }} +### Create symlinks pointing to stored configurations ln -s "$HOME/.config/mackup/.mackup/" ~/.mackup ln -s "$HOME/.config/mackup/.mackup.cfg" ~/.mackup.cfg + +### Run original mackup executable if command -v brew > /dev/null && brew list | grep mackup > /dev/null; then - $(brew --prefix)/bin/mackup "$@" || echo '' + $(brew --prefix)/bin/mackup $* || echo '' elif (command -v pip3 > /dev/null && pip3 list | grep mackup > /dev/null) || \ (command -v pip > dev/null && pip3 list | grep mackup > /dev/null) || \ (command -v pipx > dev/null && pipx list | grep mackup > /dev/null); then - ~/.local/bin/mackup "$@" || echo '' + ~/.local/bin/mackup $* || echo '' else logg warn 'Homebrew/Python pip is not found. Install `mackup` using one of these methods' fi + +### Remove temporary configuration files rm -f ~/.mackup rm -f ~/.mackup.cfg + {{ end }} diff --git a/home/dot_local/bin/symlink_extract.tmpl b/home/dot_local/bin/symlink_extract.tmpl new file mode 100644 index 00000000..0648abef --- /dev/null +++ b/home/dot_local/bin/symlink_extract.tmpl @@ -0,0 +1,3 @@ +{{- if stat (joinPath .chezmoi.homeDir ".local" "share" "extract" "extract.sh") -}} +{{ .chezmoi.homeDir }}/.local/share/extract/extract.sh +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/bin/symlink_has.tmpl b/home/dot_local/bin/symlink_has.tmpl new file mode 100644 index 00000000..9ade8589 --- /dev/null +++ b/home/dot_local/bin/symlink_has.tmpl @@ -0,0 +1,3 @@ +{{- if stat (joinPath .chezmoi.homeDir ".local" "share" "shell-safe-rm" "bin" "rm.sh") -}} +{{ .chezmoi.homeDir }}/.local/share/shell-safe-rm/bin/rm.sh +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/bin/symlink_rm.tmpl b/home/dot_local/bin/symlink_rm.tmpl new file mode 100644 index 00000000..9ade8589 --- /dev/null +++ b/home/dot_local/bin/symlink_rm.tmpl @@ -0,0 +1,3 @@ +{{- if stat (joinPath .chezmoi.homeDir ".local" "share" "shell-safe-rm" "bin" "rm.sh") -}} +{{ .chezmoi.homeDir }}/.local/share/shell-safe-rm/bin/rm.sh +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/bin/symlink_rsync-time-backup.tmpl b/home/dot_local/bin/symlink_rsync-time-backup.tmpl new file mode 100644 index 00000000..80dc3f6b --- /dev/null +++ b/home/dot_local/bin/symlink_rsync-time-backup.tmpl @@ -0,0 +1,3 @@ +{{- if stat (joinPath .chezmoi.homeDir ".local" "share" "rsync-time-backup" "rsync-time-backup.sh") -}} +{{ .chezmoi.homeDir }}.local/share/rsync-time-backup/rsync-time-backup.sh +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/bin/symlink_tmpmail.tmpl b/home/dot_local/bin/symlink_tmpmail.tmpl new file mode 100644 index 00000000..87f95aa0 --- /dev/null +++ b/home/dot_local/bin/symlink_tmpmail.tmpl @@ -0,0 +1,3 @@ +{{- if stat (joinPath .chezmoi.homeDir ".local" "share" "tmpmail" "tmpmail") -}} +{{ .chezmoi.homeDir }}/.local/share/tmpmail/tmpmail +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/bin/symlink_wait-for-it.tmpl b/home/dot_local/bin/symlink_wait-for-it.tmpl new file mode 100644 index 00000000..9cb39086 --- /dev/null +++ b/home/dot_local/bin/symlink_wait-for-it.tmpl @@ -0,0 +1,3 @@ +{{- if stat (joinPath .chezmoi.homeDir ".local" "share" "wait-for-it" "wait-for-it.sh") -}} +{{ .chezmoi.homeDir }}/.local/share/wait-for-it/wait-for-it.sh +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/scripts/motd.bash b/home/dot_local/scripts/motd.bash index cb64cee0..46a5c474 100644 --- a/home/dot_local/scripts/motd.bash +++ b/home/dot_local/scripts/motd.bash @@ -213,6 +213,10 @@ print_banner() { fi mkdir -p "$HOME/.cache" touch "$HOME/.cache/hey-banner-printed" + else + if command -v neofetch > /dev/null; then + neofetch + fi fi printf " \\033[1;37mHostname:\\033[0m %s\\n" "$(hostname)" diff --git a/home/dot_local/scripts/pre-exec.bash b/home/dot_local/scripts/pre-exec.bash new file mode 100644 index 00000000..9dc35404 --- /dev/null +++ b/home/dot_local/scripts/pre-exec.bash @@ -0,0 +1,380 @@ +# bash-preexec.sh -- Bash support for ZSH-like 'preexec' and 'precmd' functions. +# https://github.com/rcaloras/bash-preexec +# +# +# 'preexec' functions are executed before each interactive command is +# executed, with the interactive command as its argument. The 'precmd' +# function is executed before each prompt is displayed. +# +# Author: Ryan Caloras (ryan@bashhub.com) +# Forked from Original Author: Glyph Lefkowitz +# +# V0.5.0 +# + +# General Usage: +# +# 1. Source this file at the end of your bash profile so as not to interfere +# with anything else that's using PROMPT_COMMAND. +# +# 2. Add any precmd or preexec functions by appending them to their arrays: +# e.g. +# precmd_functions+=(my_precmd_function) +# precmd_functions+=(some_other_precmd_function) +# +# preexec_functions+=(my_preexec_function) +# +# 3. Consider changing anything using the DEBUG trap or PROMPT_COMMAND +# to use preexec and precmd instead. Preexisting usages will be +# preserved, but doing so manually may be less surprising. +# +# Note: This module requires two Bash features which you must not otherwise be +# using: the "DEBUG" trap, and the "PROMPT_COMMAND" variable. If you override +# either of these after bash-preexec has been installed it will most likely break. + +# Tell shellcheck what kind of file this is. +# shellcheck shell=bash + +# Make sure this is bash that's running and return otherwise. +# Use POSIX syntax for this line: +if [ -z "${BASH_VERSION-}" ]; then + return 1; +fi + +# We only support Bash 3.1+. +# Note: BASH_VERSINFO is first available in Bash-2.0. +if [[ -z "${BASH_VERSINFO-}" ]] || (( BASH_VERSINFO[0] < 3 || (BASH_VERSINFO[0] == 3 && BASH_VERSINFO[1] < 1) )); then + return 1 +fi + +# Avoid duplicate inclusion +if [[ -n "${bash_preexec_imported:-}" ]]; then + return 0 +fi +bash_preexec_imported="defined" + +# WARNING: This variable is no longer used and should not be relied upon. +# Use ${bash_preexec_imported} instead. +# shellcheck disable=SC2034 +__bp_imported="${bash_preexec_imported}" + +# Should be available to each precmd and preexec +# functions, should they want it. $? and $_ are available as $? and $_, but +# $PIPESTATUS is available only in a copy, $BP_PIPESTATUS. +# TODO: Figure out how to restore PIPESTATUS before each precmd or preexec +# function. +__bp_last_ret_value="$?" +BP_PIPESTATUS=("${PIPESTATUS[@]}") +__bp_last_argument_prev_command="$_" + +__bp_inside_precmd=0 +__bp_inside_preexec=0 + +# Initial PROMPT_COMMAND string that is removed from PROMPT_COMMAND post __bp_install +__bp_install_string=$'__bp_trap_string="$(trap -p DEBUG)"\ntrap - DEBUG\n__bp_install' + +# Fails if any of the given variables are readonly +# Reference https://stackoverflow.com/a/4441178 +__bp_require_not_readonly() { + local var + for var; do + if ! ( unset "$var" 2> /dev/null ); then + echo "bash-preexec requires write access to ${var}" >&2 + return 1 + fi + done +} + +# Remove ignorespace and or replace ignoreboth from HISTCONTROL +# so we can accurately invoke preexec with a command from our +# history even if it starts with a space. +__bp_adjust_histcontrol() { + local histcontrol + histcontrol="${HISTCONTROL:-}" + histcontrol="${histcontrol//ignorespace}" + # Replace ignoreboth with ignoredups + if [[ "$histcontrol" == *"ignoreboth"* ]]; then + histcontrol="ignoredups:${histcontrol//ignoreboth}" + fi; + export HISTCONTROL="$histcontrol" +} + +# This variable describes whether we are currently in "interactive mode"; +# i.e. whether this shell has just executed a prompt and is waiting for user +# input. It documents whether the current command invoked by the trace hook is +# run interactively by the user; it's set immediately after the prompt hook, +# and unset as soon as the trace hook is run. +__bp_preexec_interactive_mode="" + +# These arrays are used to add functions to be run before, or after, prompts. +declare -a precmd_functions +declare -a preexec_functions + +# Trims leading and trailing whitespace from $2 and writes it to the variable +# name passed as $1 +__bp_trim_whitespace() { + local var=${1:?} text=${2:-} + text="${text#"${text%%[![:space:]]*}"}" # remove leading whitespace characters + text="${text%"${text##*[![:space:]]}"}" # remove trailing whitespace characters + printf -v "$var" '%s' "$text" +} + + +# Trims whitespace and removes any leading or trailing semicolons from $2 and +# writes the resulting string to the variable name passed as $1. Used for +# manipulating substrings in PROMPT_COMMAND +__bp_sanitize_string() { + local var=${1:?} text=${2:-} sanitized + __bp_trim_whitespace sanitized "$text" + sanitized=${sanitized%;} + sanitized=${sanitized#;} + __bp_trim_whitespace sanitized "$sanitized" + printf -v "$var" '%s' "$sanitized" +} + +# This function is installed as part of the PROMPT_COMMAND; +# It sets a variable to indicate that the prompt was just displayed, +# to allow the DEBUG trap to know that the next command is likely interactive. +__bp_interactive_mode() { + __bp_preexec_interactive_mode="on"; +} + + +# This function is installed as part of the PROMPT_COMMAND. +# It will invoke any functions defined in the precmd_functions array. +__bp_precmd_invoke_cmd() { + # Save the returned value from our last command, and from each process in + # its pipeline. Note: this MUST be the first thing done in this function. + # BP_PIPESTATUS may be unused, ignore + # shellcheck disable=SC2034 + + __bp_last_ret_value="$?" BP_PIPESTATUS=("${PIPESTATUS[@]}") + + # Don't invoke precmds if we are inside an execution of an "original + # prompt command" by another precmd execution loop. This avoids infinite + # recursion. + if (( __bp_inside_precmd > 0 )); then + return + fi + local __bp_inside_precmd=1 + + # Invoke every function defined in our function array. + local precmd_function + for precmd_function in "${precmd_functions[@]}"; do + + # Only execute this function if it actually exists. + # Test existence of functions with: declare -[Ff] + if type -t "$precmd_function" 1>/dev/null; then + __bp_set_ret_value "$__bp_last_ret_value" "$__bp_last_argument_prev_command" + # Quote our function invocation to prevent issues with IFS + "$precmd_function" + fi + done + + __bp_set_ret_value "$__bp_last_ret_value" +} + +# Sets a return value in $?. We may want to get access to the $? variable in our +# precmd functions. This is available for instance in zsh. We can simulate it in bash +# by setting the value here. +__bp_set_ret_value() { + return ${1:+"$1"} +} + +__bp_in_prompt_command() { + + local prompt_command_array IFS=$'\n;' + read -rd '' -a prompt_command_array <<< "${PROMPT_COMMAND[*]:-}" + + local trimmed_arg + __bp_trim_whitespace trimmed_arg "${1:-}" + + local command trimmed_command + for command in "${prompt_command_array[@]:-}"; do + __bp_trim_whitespace trimmed_command "$command" + if [[ "$trimmed_command" == "$trimmed_arg" ]]; then + return 0 + fi + done + + return 1 +} + +# This function is installed as the DEBUG trap. It is invoked before each +# interactive prompt display. Its purpose is to inspect the current +# environment to attempt to detect if the current command is being invoked +# interactively, and invoke 'preexec' if so. +__bp_preexec_invoke_exec() { + + # Save the contents of $_ so that it can be restored later on. + # https://stackoverflow.com/questions/40944532/bash-preserve-in-a-debug-trap#40944702 + __bp_last_argument_prev_command="${1:-}" + # Don't invoke preexecs if we are inside of another preexec. + if (( __bp_inside_preexec > 0 )); then + return + fi + local __bp_inside_preexec=1 + + # Checks if the file descriptor is not standard out (i.e. '1') + # __bp_delay_install checks if we're in test. Needed for bats to run. + # Prevents preexec from being invoked for functions in PS1 + if [[ ! -t 1 && -z "${__bp_delay_install:-}" ]]; then + return + fi + + if [[ -n "${COMP_LINE:-}" ]]; then + # We're in the middle of a completer. This obviously can't be + # an interactively issued command. + return + fi + if [[ -z "${__bp_preexec_interactive_mode:-}" ]]; then + # We're doing something related to displaying the prompt. Let the + # prompt set the title instead of me. + return + else + # If we're in a subshell, then the prompt won't be re-displayed to put + # us back into interactive mode, so let's not set the variable back. + # In other words, if you have a subshell like + # (sleep 1; sleep 2) + # You want to see the 'sleep 2' as a set_command_title as well. + if [[ 0 -eq "${BASH_SUBSHELL:-}" ]]; then + __bp_preexec_interactive_mode="" + fi + fi + + if __bp_in_prompt_command "${BASH_COMMAND:-}"; then + # If we're executing something inside our prompt_command then we don't + # want to call preexec. Bash prior to 3.1 can't detect this at all :/ + __bp_preexec_interactive_mode="" + return + fi + + local this_command + this_command=$( + export LC_ALL=C + HISTTIMEFORMAT='' builtin history 1 | sed '1 s/^ *[0-9][0-9]*[* ] //' + ) + + # Sanity check to make sure we have something to invoke our function with. + if [[ -z "$this_command" ]]; then + return + fi + + # Invoke every function defined in our function array. + local preexec_function + local preexec_function_ret_value + local preexec_ret_value=0 + for preexec_function in "${preexec_functions[@]:-}"; do + + # Only execute each function if it actually exists. + # Test existence of function with: declare -[fF] + if type -t "$preexec_function" 1>/dev/null; then + __bp_set_ret_value "${__bp_last_ret_value:-}" + # Quote our function invocation to prevent issues with IFS + "$preexec_function" "$this_command" + preexec_function_ret_value="$?" + if [[ "$preexec_function_ret_value" != 0 ]]; then + preexec_ret_value="$preexec_function_ret_value" + fi + fi + done + + # Restore the last argument of the last executed command, and set the return + # value of the DEBUG trap to be the return code of the last preexec function + # to return an error. + # If `extdebug` is enabled a non-zero return value from any preexec function + # will cause the user's command not to execute. + # Run `shopt -s extdebug` to enable + __bp_set_ret_value "$preexec_ret_value" "$__bp_last_argument_prev_command" +} + +__bp_install() { + # Exit if we already have this installed. + if [[ "${PROMPT_COMMAND[*]:-}" == *"__bp_precmd_invoke_cmd"* ]]; then + return 1; + fi + + trap '__bp_preexec_invoke_exec "$_"' DEBUG + + # Preserve any prior DEBUG trap as a preexec function + local prior_trap + # we can't easily do this with variable expansion. Leaving as sed command. + # shellcheck disable=SC2001 + prior_trap=$(sed "s/[^']*'\(.*\)'[^']*/\1/" <<<"${__bp_trap_string:-}") + unset __bp_trap_string + if [[ -n "$prior_trap" ]]; then + eval '__bp_original_debug_trap() { + '"$prior_trap"' + }' + preexec_functions+=(__bp_original_debug_trap) + fi + + # Adjust our HISTCONTROL Variable if needed. + __bp_adjust_histcontrol + + # Issue #25. Setting debug trap for subshells causes sessions to exit for + # backgrounded subshell commands (e.g. (pwd)& ). Believe this is a bug in Bash. + # + # Disabling this by default. It can be enabled by setting this variable. + if [[ -n "${__bp_enable_subshells:-}" ]]; then + + # Set so debug trap will work be invoked in subshells. + set -o functrace > /dev/null 2>&1 + shopt -s extdebug > /dev/null 2>&1 + fi; + + local existing_prompt_command + # Remove setting our trap install string and sanitize the existing prompt command string + existing_prompt_command="${PROMPT_COMMAND:-}" + # Edge case of appending to PROMPT_COMMAND + existing_prompt_command="${existing_prompt_command//$__bp_install_string/:}" # no-op + existing_prompt_command="${existing_prompt_command//$'\n':$'\n'/$'\n'}" # remove known-token only + existing_prompt_command="${existing_prompt_command//$'\n':;/$'\n'}" # remove known-token only + __bp_sanitize_string existing_prompt_command "$existing_prompt_command" + if [[ "${existing_prompt_command:-:}" == ":" ]]; then + existing_prompt_command= + fi + + # Install our hooks in PROMPT_COMMAND to allow our trap to know when we've + # actually entered something. + PROMPT_COMMAND='__bp_precmd_invoke_cmd' + PROMPT_COMMAND+=${existing_prompt_command:+$'\n'$existing_prompt_command} + if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 1) )); then + PROMPT_COMMAND+=('__bp_interactive_mode') + else + # shellcheck disable=SC2179 # PROMPT_COMMAND is not an array in bash <= 5.0 + PROMPT_COMMAND+=$'\n__bp_interactive_mode' + fi + + # Add two functions to our arrays for convenience + # of definition. + precmd_functions+=(precmd) + preexec_functions+=(preexec) + + # Invoke our two functions manually that were added to $PROMPT_COMMAND + __bp_precmd_invoke_cmd + __bp_interactive_mode +} + +# Sets an installation string as part of our PROMPT_COMMAND to install +# after our session has started. This allows bash-preexec to be included +# at any point in our bash profile. +__bp_install_after_session_init() { + # bash-preexec needs to modify these variables in order to work correctly + # if it can't, just stop the installation + __bp_require_not_readonly PROMPT_COMMAND HISTCONTROL HISTTIMEFORMAT || return + + local sanitized_prompt_command + __bp_sanitize_string sanitized_prompt_command "${PROMPT_COMMAND:-}" + if [[ -n "$sanitized_prompt_command" ]]; then + # shellcheck disable=SC2178 # PROMPT_COMMAND is not an array in bash <= 5.0 + PROMPT_COMMAND=${sanitized_prompt_command}$'\n' + fi; + # shellcheck disable=SC2179 # PROMPT_COMMAND is not an array in bash <= 5.0 + PROMPT_COMMAND+=${__bp_install_string} +} + +# Run our install so long as we're not delaying it. +if [[ -z "${__bp_delay_install:-}" ]]; then + __bp_install_after_session_init +fi; \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/bash_completion b/home/dot_local/share/bash-completion/bash_completion new file mode 100644 index 00000000..e69de29b diff --git a/home/dot_local/share/bash-completion/completions/aqua.bash.tmpl b/home/dot_local/share/bash-completion/completions/aqua.bash.tmpl new file mode 100644 index 00000000..72e15c8a --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/aqua.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "aqua") -}} +{{- output "aqua" "completion" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/atuin.bash.tmpl b/home/dot_local/share/bash-completion/completions/atuin.bash.tmpl new file mode 100644 index 00000000..51f1c034 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/atuin.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "atuin") -}} +{{- output "atuin" "gen-completions" "--shell" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/bashly.bash.tmpl b/home/dot_local/share/bash-completion/completions/bashly.bash.tmpl new file mode 100644 index 00000000..c9c91a9b --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/bashly.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "bashly") -}} +{{- output "bashly" "completions" "--install" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/deno.bash.tmpl b/home/dot_local/share/bash-completion/completions/deno.bash.tmpl new file mode 100644 index 00000000..3ef0d7fe --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/deno.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "deno") -}} +{{- output "deno" "completions" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/direnv.bash.tmpl b/home/dot_local/share/bash-completion/completions/direnv.bash.tmpl new file mode 100644 index 00000000..0b544174 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/direnv.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "direnv") -}} +{{- output "direnv" "hook" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/fig.bash.tmpl b/home/dot_local/share/bash-completion/completions/fig.bash.tmpl new file mode 100644 index 00000000..ac9eaee6 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/fig.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "fig") -}} +{{- output "fig" "completion" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/fuck.bash.tmpl b/home/dot_local/share/bash-completion/completions/fuck.bash.tmpl new file mode 100644 index 00000000..ca26614c --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/fuck.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "fuck") -}} +{{- output "fuck" "--alias" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/fzf-key-bindings.bash b/home/dot_local/share/bash-completion/completions/fzf-key-bindings.bash new file mode 100644 index 00000000..539d2be6 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/fzf-key-bindings.bash @@ -0,0 +1,103 @@ +# Source: https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.bash +# ____ ____ +# / __/___ / __/ +# / /_/_ / / /_ +# / __/ / /_/ __/ +# /_/ /___/_/ key-bindings.bash +# +# - $FZF_TMUX_OPTS +# - $FZF_CTRL_T_COMMAND +# - $FZF_CTRL_T_OPTS +# - $FZF_CTRL_R_OPTS +# - $FZF_ALT_C_COMMAND +# - $FZF_ALT_C_OPTS + +# Key bindings +# ------------ +__fzf_select__() { + local cmd opts + cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ + -o -type f -print \ + -o -type d -print \ + -o -type l -print 2> /dev/null | cut -b3-"}" + opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m" + eval "$cmd" | + FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) "$@" | + while read -r item; do + printf '%q ' "$item" # escape special chars + done +} + +if [[ $- =~ i ]]; then + +__fzfcmd() { + [[ -n "${TMUX_PANE-}" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]; } && + echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf" +} + +fzf-file-widget() { + local selected="$(__fzf_select__ "$@")" + READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}" + READLINE_POINT=$(( READLINE_POINT + ${#selected} )) +} + +__fzf_cd__() { + local cmd opts dir + cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ + -o -type d -print 2> /dev/null | cut -b3-"}" + opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-} +m" + dir=$(eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd)) && printf 'builtin cd -- %q' "$dir" +} + +__fzf_history__() { + local output opts script + opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0" + script='BEGIN { getc; $/ = "\n\t"; $HISTCOUNT = $ENV{last_hist} + 1 } s/^[ *]//; print $HISTCOUNT - $. . "\t$_" if !$seen{$_}++' + output=$( + builtin fc -lnr -2147483648 | + last_hist=$(HISTTIMEFORMAT='' builtin history 1) perl -n -l0 -e "$script" | + FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) --query "$READLINE_LINE" + ) || return + READLINE_LINE=${output#*$'\t'} + if [[ -z "$READLINE_POINT" ]]; then + echo "$READLINE_LINE" + else + READLINE_POINT=0x7fffffff + fi +} + +# Required to refresh the prompt after fzf +bind -m emacs-standard '"\er": redraw-current-line' + +bind -m vi-command '"\C-z": emacs-editing-mode' +bind -m vi-insert '"\C-z": emacs-editing-mode' +bind -m emacs-standard '"\C-z": vi-editing-mode' + +if (( BASH_VERSINFO[0] < 4 )); then + # CTRL-T - Paste the selected file path into the command line + bind -m emacs-standard '"\C-t": " \C-b\C-k \C-u`__fzf_select__`\e\C-e\er\C-a\C-y\C-h\C-e\e \C-y\ey\C-x\C-x\C-f"' + bind -m vi-command '"\C-t": "\C-z\C-t\C-z"' + bind -m vi-insert '"\C-t": "\C-z\C-t\C-z"' + + # CTRL-R - Paste the selected command from history into the command line + bind -m emacs-standard '"\C-r": "\C-e \C-u\C-y\ey\C-u"$(__fzf_history__)"\e\C-e\er"' + bind -m vi-command '"\C-r": "\C-z\C-r\C-z"' + bind -m vi-insert '"\C-r": "\C-z\C-r\C-z"' +else + # CTRL-T - Paste the selected file path into the command line + bind -m emacs-standard -x '"\C-t": fzf-file-widget' + bind -m vi-command -x '"\C-t": fzf-file-widget' + bind -m vi-insert -x '"\C-t": fzf-file-widget' + + # CTRL-R - Paste the selected command from history into the command line + bind -m emacs-standard -x '"\C-r": __fzf_history__' + bind -m vi-command -x '"\C-r": __fzf_history__' + bind -m vi-insert -x '"\C-r": __fzf_history__' +fi + +# ALT-C - cd into the selected directory +bind -m emacs-standard '"\ec": " \C-b\C-k \C-u`__fzf_cd__`\e\C-e\er\C-m\C-y\C-h\e \C-y\ey\C-x\C-x\C-d"' +bind -m vi-command '"\ec": "\C-z\ec\C-z"' +bind -m vi-insert '"\ec": "\C-z\ec\C-z"' + +fi \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/fzf.bash b/home/dot_local/share/bash-completion/completions/fzf.bash new file mode 100644 index 00000000..aa0c8020 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/fzf.bash @@ -0,0 +1,383 @@ +# Source: https://github.com/junegunn/fzf/blob/master/shell/completion.bash +# ____ ____ +# / __/___ / __/ +# / /_/_ / / /_ +# / __/ / /_/ __/ +# /_/ /___/_/ completion.bash +# +# - $FZF_TMUX (default: 0) +# - $FZF_TMUX_OPTS (default: empty) +# - $FZF_COMPLETION_TRIGGER (default: '**') +# - $FZF_COMPLETION_OPTS (default: empty) + +if [[ $- =~ i ]]; then + +# To use custom commands instead of find, override _fzf_compgen_{path,dir} +if ! declare -f _fzf_compgen_path > /dev/null; then + _fzf_compgen_path() { + echo "$1" + command find -L "$1" \ + -name .git -prune -o -name .hg -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \ + -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@' + } +fi + +if ! declare -f _fzf_compgen_dir > /dev/null; then + _fzf_compgen_dir() { + command find -L "$1" \ + -name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \ + -a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@' + } +fi + +########################################################### + +# To redraw line after fzf closes (printf '\e[5n') +bind '"\e[0n": redraw-current-line' 2> /dev/null + +__fzf_comprun() { + if [[ "$(type -t _fzf_comprun 2>&1)" = function ]]; then + _fzf_comprun "$@" + elif [[ -n "${TMUX_PANE-}" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]; }; then + shift + fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- "$@" + else + shift + fzf "$@" + fi +} + +__fzf_orig_completion() { + local l comp f cmd + while read -r l; do + if [[ "$l" =~ ^(.*\ -F)\ *([^ ]*).*\ ([^ ]*)$ ]]; then + comp="${BASH_REMATCH[1]}" + f="${BASH_REMATCH[2]}" + cmd="${BASH_REMATCH[3]}" + [[ "$f" = _fzf_* ]] && continue + printf -v "_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" "%s" "${comp} %s ${cmd} #${f}" + if [[ "$l" = *" -o nospace "* ]] && [[ ! "${__fzf_nospace_commands-}" = *" $cmd "* ]]; then + __fzf_nospace_commands="${__fzf_nospace_commands-} $cmd " + fi + fi + done +} + +_fzf_opts_completion() { + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts=" + -x --extended + -e --exact + --algo + -i +i + -n --nth + --with-nth + -d --delimiter + +s --no-sort + --tac + --tiebreak + -m --multi + --no-mouse + --bind + --cycle + --no-hscroll + --jump-labels + --height + --literal + --reverse + --margin + --inline-info + --prompt + --pointer + --marker + --header + --header-lines + --ansi + --tabstop + --color + --no-bold + --history + --history-size + --preview + --preview-window + -q --query + -1 --select-1 + -0 --exit-0 + -f --filter + --print-query + --expect + --sync" + + case "${prev}" in + --tiebreak) + COMPREPLY=( $(compgen -W "length begin end index" -- "$cur") ) + return 0 + ;; + --color) + COMPREPLY=( $(compgen -W "dark light 16 bw" -- "$cur") ) + return 0 + ;; + --history) + COMPREPLY=() + return 0 + ;; + esac + + if [[ "$cur" =~ ^-|\+ ]]; then + COMPREPLY=( $(compgen -W "${opts}" -- "$cur") ) + return 0 + fi + + return 0 +} + +_fzf_handle_dynamic_completion() { + local cmd orig_var orig ret orig_cmd orig_complete + cmd="$1" + shift + orig_cmd="$1" + orig_var="_fzf_orig_completion_$cmd" + orig="${!orig_var-}" + orig="${orig##*#}" + if [[ -n "$orig" ]] && type "$orig" > /dev/null 2>&1; then + $orig "$@" + elif [[ -n "${_fzf_completion_loader-}" ]]; then + orig_complete=$(complete -p "$orig_cmd" 2> /dev/null) + _completion_loader "$@" + ret=$? + # _completion_loader may not have updated completion for the command + if [[ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]]; then + __fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null) + if [[ "${__fzf_nospace_commands-}" = *" $orig_cmd "* ]]; then + eval "${orig_complete/ -F / -o nospace -F }" + else + eval "$orig_complete" + fi + fi + return $ret + fi +} + +__fzf_generic_path_completion() { + local cur base dir leftover matches trigger cmd + cmd="${COMP_WORDS[0]}" + if [[ $cmd == \\* ]]; then + cmd="${cmd:1}" + fi + cmd="${cmd//[^A-Za-z0-9_=]/_}" + COMPREPLY=() + trigger=${FZF_COMPLETION_TRIGGER-'**'} + cur="${COMP_WORDS[COMP_CWORD]}" + if [[ "$cur" == *"$trigger" ]]; then + base=${cur:0:${#cur}-${#trigger}} + eval "base=$base" + + dir= + [[ $base = *"/"* ]] && dir="$base" + while true; do + if [[ -z "$dir" ]] || [[ -d "$dir" ]]; then + leftover=${base/#"$dir"} + leftover=${leftover/#\/} + [[ -z "$dir" ]] && dir='.' + [[ "$dir" != "/" ]] && dir="${dir/%\//}" + matches=$(eval "$1 $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-} $2" __fzf_comprun "$4" -q "$leftover" | while read -r item; do + printf "%q " "${item%$3}$3" + done) + matches=${matches% } + [[ -z "$3" ]] && [[ "${__fzf_nospace_commands-}" = *" ${COMP_WORDS[0]} "* ]] && matches="$matches " + if [[ -n "$matches" ]]; then + COMPREPLY=( "$matches" ) + else + COMPREPLY=( "$cur" ) + fi + printf '\e[5n' + return 0 + fi + dir=$(dirname "$dir") + [[ "$dir" =~ /$ ]] || dir="$dir"/ + done + else + shift + shift + shift + _fzf_handle_dynamic_completion "$cmd" "$@" + fi +} + +_fzf_complete() { + # Split arguments around -- + local args rest str_arg i sep + args=("$@") + sep= + for i in "${!args[@]}"; do + if [[ "${args[$i]}" = -- ]]; then + sep=$i + break + fi + done + if [[ -n "$sep" ]]; then + str_arg= + rest=("${args[@]:$((sep + 1)):${#args[@]}}") + args=("${args[@]:0:$sep}") + else + str_arg=$1 + args=() + shift + rest=("$@") + fi + + local cur selected trigger cmd post + post="$(caller 0 | awk '{print $2}')_post" + type -t "$post" > /dev/null 2>&1 || post=cat + + cmd="${COMP_WORDS[0]//[^A-Za-z0-9_=]/_}" + trigger=${FZF_COMPLETION_TRIGGER-'**'} + cur="${COMP_WORDS[COMP_CWORD]}" + if [[ "$cur" == *"$trigger" ]]; then + cur=${cur:0:${#cur}-${#trigger}} + + selected=$(FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-} $str_arg" __fzf_comprun "${rest[0]}" "${args[@]}" -q "$cur" | $post | tr '\n' ' ') + selected=${selected% } # Strip trailing space not to repeat "-o nospace" + if [[ -n "$selected" ]]; then + COMPREPLY=("$selected") + else + COMPREPLY=("$cur") + fi + printf '\e[5n' + return 0 + else + _fzf_handle_dynamic_completion "$cmd" "${rest[@]}" + fi +} + +_fzf_path_completion() { + __fzf_generic_path_completion _fzf_compgen_path "-m" "" "$@" +} + +# Deprecated. No file only completion. +_fzf_file_completion() { + _fzf_path_completion "$@" +} + +_fzf_dir_completion() { + __fzf_generic_path_completion _fzf_compgen_dir "" "/" "$@" +} + +_fzf_complete_kill() { + _fzf_proc_completion "$@" +} + +_fzf_proc_completion() { + _fzf_complete -m --header-lines=1 --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <( + command ps -eo user,pid,ppid,start,time,command 2> /dev/null || + command ps -eo user,pid,ppid,time,args # For BusyBox + ) +} + +_fzf_proc_completion_post() { + awk '{print $2}' +} + +_fzf_host_completion() { + _fzf_complete +m -- "$@" < <( + command cat <(command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null | command grep -i '^\s*host\(name\)\? ' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' | command grep -v '[*?%]') \ + <(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | tr -d '[' | awk '{ print $1 " " $1 }') \ + <(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') | + awk '{if (length($2) > 0) {print $2}}' | sort -u + ) +} + +_fzf_var_completion() { + _fzf_complete -m -- "$@" < <( + declare -xp | sed -En 's|^declare [^ ]+ ([^=]+).*|\1|p' + ) +} + +_fzf_alias_completion() { + _fzf_complete -m -- "$@" < <( + alias | sed -En 's|^alias ([^=]+).*|\1|p' + ) +} + +# fzf options +complete -o default -F _fzf_opts_completion fzf +# fzf-tmux is a thin fzf wrapper that has only a few more options than fzf +# itself. As a quick improvement we take fzf's completion. Adding the few extra +# fzf-tmux specific options (like `-w WIDTH`) are left as a future patch. +complete -o default -F _fzf_opts_completion fzf-tmux + +d_cmds="${FZF_COMPLETION_DIR_COMMANDS:-cd pushd rmdir}" +a_cmds=" + awk bat cat diff diff3 + emacs emacsclient ex file ftp g++ gcc gvim head hg hx java + javac ld less more mvim nvim patch perl python ruby + sed sftp sort source tail tee uniq vi view vim wc xdg-open + basename bunzip2 bzip2 chmod chown curl cp dirname du + find git grep gunzip gzip hg jar + ln ls mv open rm rsync scp + svn tar unzip zip" + +# Preserve existing completion +__fzf_orig_completion < <(complete -p $d_cmds $a_cmds 2> /dev/null) + +if type _completion_loader > /dev/null 2>&1; then + _fzf_completion_loader=1 +fi + +__fzf_defc() { + local cmd func opts orig_var orig def + cmd="$1" + func="$2" + opts="$3" + orig_var="_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" + orig="${!orig_var-}" + if [[ -n "$orig" ]]; then + printf -v def "$orig" "$func" + eval "$def" + else + complete -F "$func" $opts "$cmd" + fi +} + +# Anything +for cmd in $a_cmds; do + __fzf_defc "$cmd" _fzf_path_completion "-o default -o bashdefault" +done + +# Directory +for cmd in $d_cmds; do + __fzf_defc "$cmd" _fzf_dir_completion "-o nospace -o dirnames" +done + +unset cmd d_cmds a_cmds + +_fzf_setup_completion() { + local kind fn cmd + kind=$1 + fn=_fzf_${1}_completion + if [[ $# -lt 2 ]] || ! type -t "$fn" > /dev/null; then + echo "usage: ${FUNCNAME[0]} path|dir|var|alias|host|proc COMMANDS..." + return 1 + fi + shift + __fzf_orig_completion < <(complete -p "$@" 2> /dev/null) + for cmd in "$@"; do + case "$kind" in + dir) __fzf_defc "$cmd" "$fn" "-o nospace -o dirnames" ;; + var) __fzf_defc "$cmd" "$fn" "-o default -o nospace -v" ;; + alias) __fzf_defc "$cmd" "$fn" "-a" ;; + *) __fzf_defc "$cmd" "$fn" "-o default -o bashdefault" ;; + esac + done +} + +# Environment variables / Aliases / Hosts / Process +_fzf_setup_completion 'var' export unset printenv +_fzf_setup_completion 'alias' unalias +_fzf_setup_completion 'host' ssh telnet +_fzf_setup_completion 'proc' kill + +fi \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/gh.bash.tmpl b/home/dot_local/share/bash-completion/completions/gh.bash.tmpl new file mode 100644 index 00000000..95fe5c7e --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/gh.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "gh") -}} +{{- output "gh" "completion" "-s" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/gradle.bash b/home/dot_local/share/bash-completion/completions/gradle.bash new file mode 100644 index 00000000..63434ee6 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/gradle.bash @@ -0,0 +1,382 @@ +# Source: https://raw.githubusercontent.com/eriwen/gradle-completion/master/gradle-completion.bash +__gradle-completion-print-timestamp() { + echo "$(($(gdate +'%s * 1000 + %-N / 1000000'))) - $1" +} + +__gradle-set-project-root-dir() { + local dir=$(pwd) + project_root_dir=$(pwd) + while [[ "$dir" != '/' ]]; do + if [[ -f "$dir/settings.gradle" || -f "$dir/settings.gradle.kts" || -f "$dir/gradlew" ]]; then + project_root_dir="$dir" + return 0 + fi + dir="$(dirname "$dir")" + done + return 1 +} + +__gradle-init-cache-dir() { + cache_dir="${GRADLE_USER_HOME:-$HOME/.gradle}/completion" + mkdir -p "$cache_dir" +} + +__gradle-set-settings-file() { + # In order of precedence: --settings-file=filename, settings.gradle, settings.gradle.kts + + local default_gradle_settings_file="$project_root_dir/settings.gradle" + if [[ ! -f $default_gradle_settings_file ]]; then + default_gradle_settings_file="$project_root_dir/settings.gradle.kts" + fi + gradle_settings_file=$default_gradle_settings_file +} + +__gradle-set-build-file() { + __gradle-set-settings-file + # In order of precedence: --build-file=filename, rootProject.buildFileName, build.gradle, build.gradle.kts + + local default_gradle_build_file_name="build.gradle" + if [[ -f $gradle_settings_file ]]; then + local build_file_name=$(grep "^rootProject\.buildFileName" $gradle_settings_file | \ + sed -n -e "s/rootProject\.buildFileName = [\'\"]\(.*\)[\'\"]/\1/p") + default_gradle_build_file_name="${build_file_name:-build.gradle}" + fi + + gradle_build_file="$project_root_dir/$default_gradle_build_file_name" + if [[ ! -f $gradle_build_file ]]; then + gradle_build_file="$project_root_dir/build.gradle.kts" + fi +} + +__gradle-set-cache-name() { + # Cache name is constructed from the absolute path of the build file. + cache_name="${gradle_build_file//\//_}" +} + +__gradle-set-files-checksum() { + # Cache MD5 sum of all Gradle scripts and modified timestamps + if builtin command -v md5 > /dev/null; then + gradle_files_checksum=$(md5 -q -s "$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null)") + elif builtin command -v md5sum > /dev/null; then + gradle_files_checksum=$(cat "$cache_dir/$cache_name" | xargs ls -o 2>/dev/null | md5sum | awk '{print $1}') + else + echo "Cannot generate completions as neither md5 nor md5sum exist on \$PATH" + fi +} + +__gradle-generate-script-cache() { + # Invalidate cache after 3 weeks by default + local cache_ttl_mins=${GRADLE_CACHE_TTL_MINUTES:-30240} + local script_exclude_pattern=${GRADLE_COMPLETION_EXCLUDE_PATTERN:-"/(.git|build|integTest|samples|templates|smokeTest|testFixtures|out)/"} + + if [[ ! $(find "$cache_dir/$cache_name" -mmin "-${cache_ttl_mins}" 2>/dev/null) ]]; then + # Cache all Gradle scripts + local gradle_build_scripts=$(find "$project_root_dir" -type f -name "*.gradle" -o -name "*.gradle.kts" 2>/dev/null | egrep -v "$script_exclude_pattern") + printf "%s\n" "${gradle_build_scripts[@]}" >| "$cache_dir/$cache_name" + fi +} + +__gradle-long-options() { + local cur + _get_comp_words_by_ref -n : cur + + local args="--build-cache - Enables the Gradle build cache +--build-file - Specifies the build file +--configuration-cache - Enables the configuration cache. Gradle will try to reuse the build configuration from previous builds. [incubating] +--configuration-cache-problems - Configures how the configuration cache handles problems (fail or warn). Defaults to fail. [incubating] +--configure-on-demand - Only relevant projects are configured +--console - Type of console output to generate (plain auto rich verbose) +--continue - Continues task execution after a task failure +--continuous - Continuous mode. Automatically re-run build after changes +--daemon - Use the Gradle Daemon +--debug - Log at the debug level +--dry-run - Runs the build with all task actions disabled +--exclude-task - Specify a task to be excluded +--full-stacktrace - Print out the full (very verbose) stacktrace +--gradle-user-home - Specifies the Gradle user home directory +--gui - Launches the Gradle GUI app (Deprecated) +--help - Shows a help message +--include-build - Run the build as a composite, including the specified build +--info - Set log level to INFO +--init-script - Specifies an initialization script +--max-workers - Set the maximum number of workers that Gradle may use +--no-build-cache - Do not use the Gradle build cache +--no-configuration-cache - Disables the configuration cache. [incubating] +--no-configure-on-demand - Disables configuration on demand +--no-daemon - Do not use the Gradle Daemon +--no-parallel - Disables parallel execution to build projects +--no-rebuild - Do not rebuild project dependencies +--no-scan - Do not create a build scan +--no-search-upwards - Do not search parent directories for a settings.gradle (removed) +--no-watch-fs - Do not watch the filesystem for changes +--offline - Build without accessing network resources +--parallel - Build projects in parallel +--profile - Profile build time and create report +--priority - Set priority for Gradle worker processes (low normal) +--project-cache-dir - Specifies the project-specific cache directory +--project-dir - Specifies the start directory for Gradle +--project-prop - Sets a project property of the root project +--quiet - Log errors only +--recompile-scripts - Forces scripts to be recompiled, bypassing caching +--refresh-dependencies - Refresh the state of dependencies +--rerun-tasks - Specifies that any task optimization is ignored +--scan - Create a build scan +--settings-file - Specifies the settings file +--stacktrace - Print out the stacktrace also for user exceptions +--status - Print Gradle Daemon status +--stop - Stop all Gradle Daemons +--system-prop - Set a system property +--update-locks - Perform a partial update of the dependency lock +--version - Prints Gradle version info +--warn - Log warnings and errors only +--warning-mode - Set types of warnings to log (all summary none) +--watch-fs - Gradle watches filesystem for incremental builds +--write-locks - Persists dependency resolution for locked configurations" + + COMPREPLY=( $(compgen -W "$args" -- "$cur") ) +} + +__gradle-properties() { + local cur + _get_comp_words_by_ref -n : cur + + local args="-Dorg.gradle.cache.reserved.mb= - Reserve Gradle Daemon memory for operations +-Dorg.gradle.caching= - Set true to enable Gradle build cache +-Dorg.gradle.console= - Set type of console output to generate (plain auto rich verbose) +-Dorg.gradle.daemon.debug= - Set true to debug Gradle Daemon +-Dorg.gradle.daemon.idletimeout= - Kill Gradle Daemon after # idle millis +-Dorg.gradle.debug= - Set true to debug Gradle Client +-Dorg.gradle.jvmargs= - Set JVM arguments +-Dorg.gradle.java.home= - Set JDK home dir +-Dorg.gradle.logging.level= - Set default Gradle log level (quiet warn lifecycle info debug) +-Dorg.gradle.parallel= - Set true to enable parallel project builds (incubating) +-Dorg.gradle.priority= - Set priority for Gradle worker processes (low normal) +-Dorg.gradle.unsafe.watch-fs= - Set true to enable Gradle file watcher +-Dorg.gradle.warning.mode= - Set types of warnings to log (all summary none) +-Dorg.gradle.workers.max= - Set the number of workers Gradle is allowed to use" + COMPREPLY=( $(compgen -W "$args" -- "$cur") ) + return 0 +} + +__gradle-short-options() { + local cur + _get_comp_words_by_ref -n : cur + + local args="-? - Shows a help message +-a - Do not rebuild project dependencies +-b - Specifies the build file +-c - Specifies the settings file +-d - Log at the debug level +-g - Specifies the Gradle user home directory +-h - Shows a help message +-i - Set log level to INFO +-m - Runs the build with all task actions disabled +-p - Specifies the start directory for Gradle +-q - Log errors only +-s - Print out the stacktrace also for user exceptions +-t - Continuous mode. Automatically re-run build after changes +-u - Do not search parent directories for a settings.gradle +-v - Prints Gradle version info +-w - Log warnings and errors only +-x - Specify a task to be excluded +-D - Set a system property +-I - Specifies an initialization script +-P - Sets a project property of the root project +-S - Print out the full (very verbose) stacktrace" + COMPREPLY=( $(compgen -W "$args" -- "$cur") ) +} + +__gradle-tasks() { + local cur + _get_comp_words_by_ref -n : cur + + __gradle-init-cache-dir + __gradle-set-project-root-dir + __gradle-set-build-file + if [[ -f "$gradle_build_file" ]]; then + __gradle-set-cache-name + __gradle-generate-script-cache + __gradle-set-files-checksum + + # The cache key is md5 sum of all gradle scripts, so it's valid if it exists. + if [[ -f "$cache_dir/$cache_name.md5" ]]; then + local cached_checksum="$(cat "$cache_dir/$cache_name.md5")" + local -a cached_tasks + if [[ -z "$cur" ]]; then + cached_tasks=( $(grep -v "^:" "$cache_dir/$cached_checksum") ) + else + cached_tasks=( $(grep "^$cur" "$cache_dir/$cached_checksum") ) + fi + COMPREPLY=( $(compgen -W "${cached_tasks[*]}" -- "$cur") ) + else + __gradle-notify-tasks-cache-build + fi + + # Regenerate tasks cache in the background + if [[ "$gradle_files_checksum" != "$(cat "$cache_dir/$cache_name.md5")" || ! -f "$cache_dir/$gradle_files_checksum" || $(wc -c < $cache_dir/$gradle_files_checksum) -le 1 ]]; then + $(__gradle-generate-tasks-cache 1>&2 2>/dev/null &) + fi + else + # Default tasks available outside Gradle projects + local args="buildEnvironment - Displays all buildscript dependencies declared in root project. +components - Displays the components produced by root project. +dependencies - Displays all dependencies declared in root project. +dependencyInsight - Displays the insight into a specific dependency in root project. +dependentComponents - Displays the dependent components of components in root project. +help - Displays a help message. +init - Initializes a new Gradle build. +model - Displays the configuration model of root project. +projects - Displays the sub-projects of root project. +properties - Displays the properties of root project. +tasks - Displays the tasks runnable from root project. +wrapper - Generates Gradle wrapper files." + COMPREPLY=( $(compgen -W "$args" -- "$cur") ) + fi + + # Prevent colons from messing up completion + [[ -n "$(type -t __ltrim_colon_completions)" ]] && __ltrim_colon_completions "$cur" +} + +__gradle-options-arguments() { + local cur prev + _get_comp_words_by_ref -n : cur + _get_comp_words_by_ref -n : -p prev + + case "$prev" in + -b|--build-file|-c|--settings-file|-I|--init-script) + COMPREPLY=( $(compgen -f -A file -o filenames -X '!*.gradle*' "$cur") ) + return 0 + ;; + -g|--gradle-user-home|--include-build|--project-cache-dir|--project-dir) + COMPREPLY=( $(compgen -d "$cur") ) + return 0 + ;; + *) + __gradle-tasks + return 0 + ;; + esac +} + + +__gradle-notify-tasks-cache-build() { + # Notify user of cache rebuild + echo -e " (Building completion cache. Please wait)\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\c" + __gradle-generate-tasks-cache + # Remove "please wait" message by writing a bunch of spaces then moving back to the left + echo -e " \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\c" +} + +__gradle-generate-tasks-cache() { + __gradle-set-files-checksum + + # Use Gradle wrapper when it exists. + local gradle_cmd="gradle" + if [[ -x "$project_root_dir/gradlew" ]]; then + gradle_cmd="$project_root_dir/gradlew" + fi + + # Run gradle to retrieve possible tasks and cache. + # Reuse Gradle Daemon if IDLE but don't start a new one. + local gradle_tasks_output + if [[ ! -z "$("$gradle_cmd" --status 2>/dev/null | grep IDLE)" ]]; then + gradle_tasks_output="$("$gradle_cmd" -b "$gradle_build_file" --daemon --no-scan --console=plain -q tasks --all)" + else + gradle_tasks_output="$("$gradle_cmd" -b "$gradle_build_file" --no-daemon --no-scan --console=plain -q tasks --all)" + fi + local output_line + local task_description + local -a gradle_all_tasks=() + local -a root_tasks=() + local -a subproject_tasks=() + for output_line in ${gradle_tasks_output}; do + if [[ "$output_line" =~ ^([[:alpha:]][[:alnum:][:punct:]]*)([[:space:]]-[[:space:]]([[:print:]]*))? ]]; then + task_name="${BASH_REMATCH[1]}" + task_description="${BASH_REMATCH[3]}" + gradle_all_tasks+=( "$task_name - $task_description" ) + # Completion for subproject tasks with ':' prefix + if [[ "$task_name" =~ ^([[:alnum:][:punct:]]+):([[:alnum:]]+) ]]; then + gradle_all_tasks+=( ":$task_name - $task_description" ) + subproject_tasks+=( "${BASH_REMATCH[2]}" ) + else + root_tasks+=( "$task_name" ) + fi + fi + done + + # subproject tasks can be referenced implicitly from root project + if [[ "$GRADLE_COMPLETION_UNQUALIFIED_TASKS" == "true" ]]; then + local -a implicit_tasks=() + implicit_tasks=( $(comm -23 <(printf "%s\n" "${subproject_tasks[@]}" | sort) <(printf "%s\n" "${root_tasks[@]}" | sort)) ) + for task in $(printf "%s\n" "${implicit_tasks[@]}"); do + gradle_all_tasks+=( "$task" ) + done + fi + + printf "%s\n" "${gradle_all_tasks[@]}" >| "$cache_dir/$gradle_files_checksum" + echo "$gradle_files_checksum" >| "$cache_dir/$cache_name.md5" +} + +__gradle-completion-init() { + local cache_dir cache_name gradle_build_file gradle_files_checksum project_root_dir + + local OLDIFS="$IFS" + local IFS=$'\n' + + __gradle-init-cache-dir + __gradle-set-project-root-dir + __gradle-set-build-file + if [[ -f "$gradle_build_file" ]]; then + __gradle-set-cache-name + __gradle-generate-script-cache + __gradle-set-files-checksum + __gradle-notify-tasks-cache-build + fi + + IFS="$OLDIFS" + + return 0 +} + +_gradle() { + local cache_dir cache_name gradle_build_file gradle_files_checksum project_root_dir + local cur prev + _get_comp_words_by_ref -n : cur + _get_comp_words_by_ref -n : -p prev + + # Set bash internal field separator to '\n' + # This allows us to provide descriptions for options and tasks + local OLDIFS="$IFS" + local IFS=$'\n' + + if [[ ${cur} == --* ]]; then + __gradle-long-options + elif [[ ${cur} == -D* ]]; then + __gradle-properties + elif [[ ${cur} == -* ]]; then + __gradle-short-options + elif [[ ${prev} == -* ]]; then + __gradle-options-arguments + else + __gradle-tasks + fi + + IFS="$OLDIFS" + + # Remove description ("[:space:]" and after) if only one possibility + if [[ ${#COMPREPLY[*]} -eq 1 ]]; then + COMPREPLY=( ${COMPREPLY[0]%% *} ) + fi + + return 0 +} +complete -F _gradle gradle +complete -F _gradle gradle.bat +complete -F _gradle gradlew +complete -F _gradle gradlew.bat +complete -F _gradle ./gradlew +complete -F _gradle ./gradlew.bat + +if hash gw 2>/dev/null || alias gw >/dev/null 2>&1; then + complete -F _gradle gw +fi \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/helm.bash.tmpl b/home/dot_local/share/bash-completion/completions/helm.bash.tmpl new file mode 100644 index 00000000..6e4d4304 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/helm.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "helm") -}} +{{- output "helm" "completion" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/hoard.bash.tmpl b/home/dot_local/share/bash-completion/completions/hoard.bash.tmpl new file mode 100644 index 00000000..9fe0b6bf --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/hoard.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "hoard") -}} +{{- output "hoard" "shell-config" "--shell" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/kubectl.bash.tmpl b/home/dot_local/share/bash-completion/completions/kubectl.bash.tmpl new file mode 100644 index 00000000..6f162a4e --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/kubectl.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "kubectl") -}} +{{- output "kubectl" "completion" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/ngrok.bash.tmpl b/home/dot_local/share/bash-completion/completions/ngrok.bash.tmpl new file mode 100644 index 00000000..07c7989b --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/ngrok.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "ngrok") -}} +{{- output "ngrok" "completion" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/npm.bash.tmpl b/home/dot_local/share/bash-completion/completions/npm.bash.tmpl new file mode 100644 index 00000000..8fa4784b --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/npm.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "npm") -}} +{{- output "npm" "completion" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/plz.bash.tmpl b/home/dot_local/share/bash-completion/completions/plz.bash.tmpl new file mode 100644 index 00000000..e73a2c50 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/plz.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "plz") -}} +{{- output "plz" "--completion_script" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/poetry.bash.tmpl b/home/dot_local/share/bash-completion/completions/poetry.bash.tmpl new file mode 100644 index 00000000..16fad286 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/poetry.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "poetry") -}} +{{- output "poetry" "completions" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/portal.bash.tmpl b/home/dot_local/share/bash-completion/completions/portal.bash.tmpl new file mode 100644 index 00000000..8b772ed3 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/portal.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "portal") -}} +{{- output "portal" "completion" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/sake.bash.tmpl b/home/dot_local/share/bash-completion/completions/sake.bash.tmpl new file mode 100644 index 00000000..d35795d6 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/sake.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "sake") -}} +{{- output "sake" "completion" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/volta.bash.tmpl b/home/dot_local/share/bash-completion/completions/volta.bash.tmpl new file mode 100644 index 00000000..9f598169 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/volta.bash.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "volta") -}} +{{- output "volta" "completions" "bash" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_local/share/bash-completion/completions/wp.bash b/home/dot_local/share/bash-completion/completions/wp.bash new file mode 100644 index 00000000..ed28a8f1 --- /dev/null +++ b/home/dot_local/share/bash-completion/completions/wp.bash @@ -0,0 +1,24 @@ +# Source: https://raw.githubusercontent.com/wp-cli/wp-cli/v2.7.1/utils/wp-completion.bash +# bash completion for the `wp` command + +_wp_complete() { + local OLD_IFS="$IFS" + local cur=${COMP_WORDS[COMP_CWORD]} + + IFS=$'\n'; # want to preserve spaces at the end + local opts="$(wp cli completions --line="$COMP_LINE" --point="$COMP_POINT")" + + if [[ "$opts" =~ \\s* ]] + then + COMPREPLY=( $(compgen -f -- $cur) ) + elif [[ $opts = "" ]] + then + COMPREPLY=( $(compgen -f -- $cur) ) + else + COMPREPLY=( ${opts[*]} ) + fi + + IFS="$OLD_IFS" + return 0 +} +complete -o nospace -F _wp_complete wp \ No newline at end of file diff --git a/home/dot_local/share/zsh-completion/atuin.zsh.tmpl b/home/dot_local/share/zsh-completion/atuin.zsh.tmpl new file mode 100644 index 00000000..77cd3d8b --- /dev/null +++ b/home/dot_local/share/zsh-completion/atuin.zsh.tmpl @@ -0,0 +1,3 @@ +{{- if (lookPath "atuin") -}} +{{- output "atuin" "gen-completions" "--shell" "zsh" -}} +{{- end -}} \ No newline at end of file diff --git a/home/dot_zshrc b/home/dot_zshrc index 89205680..7a650843 100644 --- a/home/dot_zshrc +++ b/home/dot_zshrc @@ -389,7 +389,10 @@ fi ### Homebrew ZSH Completions # Must be sourced before compinit / Oh-My-ZSH inclusion -export FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}" +export FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:$FPATH" +if [ -d "$HOMEBREW_PREFIX/share/zsh-completions" ]; then + export FPATH="$HOMEBREW_PREFIX/share/zsh-completions:$FPATH" +fi ### ZSH compinit autoload -Uz +X compinit && compinit -d "${XDG_CACHE_HOME:-$HOME/.cache}/zsh/zcompdump-$ZSH_VERSION" @@ -405,6 +408,13 @@ if command -v atuin > /dev/null; then eval "$(atuin init zsh)" fi +### Carapace +if command -v carapace > /dev/null; then + zstyle ':completion:*' format $'\e[2;37mCompleting %d\e[m' + zstyle ':completion:*:git:*' group-order 'main commands' 'alias commands' 'external commands' + source <(carapace _carapace) +fi + ### Cod if command -v cod > /dev/null; then source <(cod init $$ zsh) @@ -429,6 +439,17 @@ if [ -f "$HOMEBREW_PREFIX/share/google-cloud-sdk/completion.zsh.inc" ]; then source "$HOMEBREW_PREFIX/share/google-cloud-sdk/completion.zsh.inc" fi +### hiSHtory +if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/hishtory/config.zsh" ]; then + export PATH="$PATH:${XDG_CONFIG_HOME:-$HOME/.config}/hishtory" + source "${XDG_CONFIG_HOME:-$HOME/.config}/hishtory/config.zsh" +fi + +### Hoard +if command -v hoard > /dev/null && [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/hoard/src/shell/hoard.zsh" ]; then + . "${XDG_DATA_HOME:-$HOME/.local/share}/hoard/src/shell/hoard.zsh" +fi + ### iTerm2 if [ -f "$HOME/.local/scripts/iterm2.zsh" ]; then source "$HOME/.local/scripts/iterm2.zsh" @@ -487,7 +508,7 @@ if [ -f "$HOME/.fig/shell/zshrc.post.zsh" ]; then fi ### Powerline -if [ -f "$HOME/.local/scripts/p10k.zsh" ]; then +if [ -f "${XDG_CONFIG_HOME:-$HOME.config}/scripts/p10k.zsh" ]; then source "$HOME/.local/scripts/p10k.zsh" fi @@ -500,10 +521,8 @@ elif [ -f "$SDKMAN_DIR/bin/sdkman-init.sh" ]; then . "$SDKMAN_DIR/bin/sdkman-init.sh" fi -### The Fuck -if command -v thefuck > /dev/null; then - eval "$(thefuck --alias)" -fi +### Up +[ -f "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh" ] && source "${XDG_DATA_HOME:-$HOME/.local/share}/up/up.sh" ### HashiCorp Vault if command -v vault > /dev/null; then @@ -513,7 +532,7 @@ fi ### zoxide if command -v zoxide > /dev/null; then zstyle ':autocomplete:recent-dirs' backend zoxide - eval "$(zoxide init --cmd z zsh)" > /dev/null + eval "$(zoxide init zsh)" else alias z='cd' fi diff --git a/home/private_dot_ssh/private_config.tmpl b/home/private_dot_ssh/private_config.tmpl index c9faf6f6..f366412a 100644 --- a/home/private_dot_ssh/private_config.tmpl +++ b/home/private_dot_ssh/private_config.tmpl @@ -20,5 +20,8 @@ Host gitlab.com UpdateHostKeys no Host github.com UpdateHostKeys no - +{{ if (lookPath "fig") -}} +Match all + Include ~/.fig/ssh +{{- end -}} {{- end -}} \ No newline at end of file diff --git a/home/private_dot_ssh/system/sshd_config.tmpl b/home/private_dot_ssh/system/sshd_config.tmpl index ca841bc6..cf20cc26 100644 --- a/home/private_dot_ssh/system/sshd_config.tmpl +++ b/home/private_dot_ssh/system/sshd_config.tmpl @@ -105,7 +105,8 @@ UseDNS no #VersionAddendum none # pass locale information -AcceptEnv LANG LC_* +AcceptEnv LANG LC_* FIG_* +AllowStreamLocalForwarding yes # no default banner path Banner /etc/ssh/banner diff --git a/software.yml b/software.yml index 1ba8909f..8abe7be0 100644 --- a/software.yml +++ b/software.yml @@ -1,6 +1,6 @@ --- # eslint-disable eslint-comments/disable-enable-pair, max-len, max-lines, no-warning-comments -# mongodb xhyve elm icdiff ddrescue tcl-tk flac zenity terragrunt dbus grpc diffutils sonarqube haproxy cabal-install sonar-scanner tmate solr tcptraceroute hashcat handbrake iproute2mac 2fsprogs hydra you-get cabextract sphinx-doc iftop htop-osx w3m grc moreutils rpm iperf3 libav iperf lmdb mcrypt httprack aircrack-ng ntfs-3g glog parallel rename gdbm geckodriver pv sdl swig doxygen mtr graphicsmagick putty llvm flow watch gdb ant mariadb mercurial autoconf maven readline libtool chromedriver pkg-config +# # `softwarePackages` is a map of possible package managers to use while installing a program. The installer will # look at the `installerPreference` variable and find the first package manager that is in the package's possible # installation method and then use that. It is also sensitive to the type of operating system so a package with @@ -816,6 +816,18 @@ softwarePackages: _desc: Audio loopback device for macOS (supports sound passthrough to screen recording software on macOS) _when:cask: '! test -d /Library/Audio/Plug-Ins/HAL/BlackHole16ch.driver && ! test -d ~/Library/Audio/Plug-Ins/HAL/BlackHole16ch.driver' cask: blackhole-16ch + percol: + _bin: percol + _github: https://github.com/mooz/percol + _name: Percol + pipx: percol + loop: + _bin: loop + _github: https://github.com/Miserlou/Loop + _name: Loop + snap: loop-rs --beta + pacman: loop + cargo: loop-rs aria2: _bin: aria2c _desc: '[aria2](https://aria2.github.io/) is a lightweight multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. [AriaNg](http://ariang.mayswind.net/) is a modern web frontend that makes working with aria2 easier.' @@ -1162,11 +1174,30 @@ softwarePackages: _github: https://github.com/sportngin/brew-gem _name: Homebrew RubyGems brew: brew-gem + scap-security-guide: + _bin: oscap + _github: https://github.com/ComplianceAsCode/content + _name: OpenSCAP + apt: + - ssg-debderived + - ssg-applications + apt:debian: + - ssg-debian + - ssg-applications + dnf: scap-security-guide brew-pkg: _github: https://github.com/timsutton/brew-pkg _name: Homebrew Pkg _when:darwin: '! brew pkg --help > /dev/null' brew:darwin: timsutton/formulae/brew-pkg + xpanes: + _bin: xpanes + _github: https://github.com/greymd/tmux-xpanes + _name: xpanes + apt: https://github.com/greymd/tmux-xpanes/releases/download/v4.1.4/tmux-xpanes_v4.1.4.deb + brew: tmux-xpanes + dnf: xpanes + script: curl -sSL --compressed https://raw.githubusercontent.com/greymd/tmux-xpanes/v4.1.4/bin/xpanes > /tmp/xpanes && sudo mv /tmp/xpanes /usr/local/bin/xpanes bash-completion: _bin: null _desc: null @@ -1175,7 +1206,15 @@ softwarePackages: _home: null _name: Bash Completion Formula _when: '! brew list bash-completion | grep bash-completion > /dev/null' + apt: bash-completion brew: bash-completion@2 + dnf: bash-completion + pacman: bash-completion + bashly: + _bin: bashly + _github: https://github.com/DannyBen/bashly + _name: Bashly + gem: bashly axel: _bin: axel _docs: null @@ -1355,6 +1394,42 @@ softwarePackages: _home: https://github.com/dim-an/cod _name: Cod go: github.com/dim-an/cod@master + iproute2mac: + _bin: + _github: https://github.com/brona/iproute2mac + _name: iproute2mac + brew:darwin: iproute2mac + tmate: + _bin: tmate + _github: https://github.com/tmate-io/tmate + _name: tmate + apt: tmate + brew: tmate + dnf: tmate + opkg: tmate + pacman: tmate + pkg-freebsd: tmate + pkg_add: tmate + zypper: tmate + emerge: app-misc/tmate + sphinx: + _bin: sphinx + _github: https://github.com/sphinx-doc/sphinx + _name: Sphinx + apt: python3-sphinx + brew: sphinx-doc + choco: sphinx + conda: sphinx + dnf: python-sphinx + pipx: sphinx + port: py39-sphinx + you-get: + _bin: you-get + _github: https://github.com/soimort/you-get + _name: You-Get + brew: you-get + pkg-freebsd: you-get + pipx: you-get utm: _bin: utm _github: https://github.com/utmapp/UTM @@ -2540,6 +2615,11 @@ softwarePackages: cargo: du-dust github: github.com/bootandy/dust pacman: dust + goto: + _bin: goto + _github: https://github.com/iridakos/goto + _name: goto + brew: goto easyengine: _bin: ee _desc: "[EasyEngine](https://easyengine.io/) is a command-line control panel for Nginx to manage WordPress sites running on Nginx, PHP, MySQL, and Let's Encrypt." @@ -2549,6 +2629,31 @@ softwarePackages: _name: EasyEngine ansible:darwin: professormanhattan.easyengine ansible:linux: professormanhattan.easyengine + forgit: + _deps: + - fzf + _bin: ga + _github: https://github.com/wfxr/forgit + _name: forgit + brew: forgit + ntfy: + _bin: nfty + _github: https://github.com/dschep/ntfy + _name: nfty + pipx: nfty + clipboard: + _bin: cb + _github: https://github.com/Slackadays/Clipboard.git + _name: Clipboard + apk: clipboard + brew: clipboard + emerge: app-misc/clipboard + flatpak: app.getclipboard.Clipboard + nix-env: nixpkgs.clipboard-jh + scoop: clipboard + snap: clipboard + xbps-install: clipboard + yay: clipboard editly: _bin: editly _desc: Editly is a tool and framework for declarative NLE (non-linear video editing) using Node.js and ffmpeg. Editly allows you to easily and programmatically create a video from a set of clips, images, audio and titles, with smooth transitions and music overlaid. @@ -2635,6 +2740,57 @@ softwarePackages: cargo: emplace --locked nix: emplace scoop: emplace + xsv: + _bin: xsv + _github: https://github.com/BurntSushi/xsv + _name: xsv + cargo: xsv + port: xsv + brew: xsv + nix-env: xsv + + haproxy: + _bin: haproxy + _github: https://github.com/haproxy/haproxy + _name: HAProxy + apt: haproxy + brew: haproxy + choco: haproxy + dnf: haproxy + pacman: haproxy + zypper: haproxy + apk: haproxy + ghcup: + _bin: ghcup + _github: https://github.com/haskell/ghcup-hs + _name: GHCup + brew: ghcup + zenity: + _bin: zenity + _github: https://github.com/ncruces/zenity + _name: Zenity + brew: ncruces/tap/zenity + scoop: https://ncruces.github.io/scoop/zenity.json + go: github.com/ncruces/zenity/cmd/zenity@latest + xhyve: + _bin: xhyve + _github: https://github.com/machyve/xhyve + _name: xhyve + brew:darwin: xhyve + port: xhyve + xxh: + _bin: xxh + _github: https://github.com/xxh/xxh + _name: xxh + pipx: xxh-xxh + brew: xxh + port: xxh + shml: + _bin: shml + _github: https://github.com/odb/shml + _name: SHML + brew: shml + npm: shml empty-trash: _bin: empty-trash _desc: CLI to empty trash on macOS, Windows, and Linux @@ -2692,6 +2848,22 @@ softwarePackages: _home: null _name: null ansible: professormanhattan.environment + mariadb: + _bin: mariadb + _github: false + _name: MariaDB + brew: mariadb + choco: mariadb + dnf: mariadb-server + apt: mariadb-server + pacman: mariadb-server + apk: mariadb-server + mongodb: + _bin: mongod + _github: https://github.com/mongodb/mongo + _name: MongoDB + brew: mongodb/brew/mongodb + choco: mongodb mongodb-compass: _bin: mongodb-compass _github: https://github.com/mongodb-js/compass @@ -4245,6 +4417,11 @@ softwarePackages: _name: hey brew: hey github: github.com/rakyll/hey + desk: + _bin: desk + _github: https://github.com/jamesob/desk + _name: Desk + brew: desk rustdesk: _bin: rustdesk _desc: Open source virtual / remote desktop infrastructure for everyone! The open source TeamViewer alternative. Display and control your PC and Android devices from anywhere at anytime. @@ -4650,6 +4827,13 @@ softwarePackages: pacman: atuin port: atuin pkg-termux: atuin + hishtory: + _bin: hishtory + _github: https://github.com/ddworken/hishtory + _name: hiSHtory + _todo: Check for Homebrew version + _post: source "$XDG_CONFIG_HOME/shell/private.sh" && echo y | hishtory init "$HISHTORY_USER_SECRET" + script: curl https://hishtory.dev/install.py | python3 - git-town: _bin: git-town _github: https://github.com/git-town/git-town @@ -4792,6 +4976,10 @@ softwarePackages: _home: https://github.com/zquestz/s _name: s brew: s-search + zsh-completions: + _github: https://github.com/zsh-users/zsh-completions + _name: ZSH Completions + brew: zsh-completions rancher-desktop: _github: https://github.com/rancher-sandbox/rancher-desktop/ cask: rancher @@ -5573,7 +5761,10 @@ softwarePackages: hss: _bin: hss _github: https://github.com/six-ddc/hss + _name: hss brew: hss + port: hss + script: cd /tmp && git clone https://github.com/six-ddc/hss.git && cd hss && make && make install && cd /tmp && rm -rf hss molecule: _bin: molecule _desc: Molecule aids in the development and testing of Ansible roles @@ -6350,6 +6541,19 @@ softwarePackages: _home: null _name: np npm: np + nushell: + _bin: nushell + _github: https://github.com/nushell/nushell + _name: Nu + apk: nushell + apt: nushell + brew: nushell + choco: nushell + pacman: nushell + port: nushell + dnf: nushell + scoop: nushell + winget: nushell npm-check: _bin: npm-check _desc: Check for outdated, incorrect, and unused dependencies. @@ -6581,11 +6785,21 @@ softwarePackages: _home: https://jsonresume.org/ _name: JSON Resume CLI npm: resume-cli + distrobox: + _bin: distrobox + _github: https://github.com/89luca89/distrobox + _name: Distrobox + apt: distrobox + apk: distrobox + pacman: distrobox + dnf: distrobox neofetch: _bin: neofetch _github: https://github.com/dylanaraps/neofetch _name: NeoFetch - apk: neofetch + apk: + - ncurses + - neofetch pkg-termux: neofetch pacman: neofetch apt: neofetch @@ -7479,11 +7693,21 @@ softwarePackages: apt: grep dnf: grep pacman: grep + wipe-modules: + _bin: wipe-modules + _github: https://github.com/bntzio/wipe-modules + _name: wipe-modules + npm: wipe-modules progress: _bin: progress + _github: https://github.com/Xfennec/progress + _name: Progress apt: progress + brew: progress dnf: progress pacman: progress + zypper: progress + port: progress util-linux: _bin: - cal @@ -8315,6 +8539,25 @@ softwarePackages: _home: null _name: speedtest-cli pipx: speedtest-cli + carapace: + _bin: carapace + _github: https://github.com/rsteube/carapace-bin + _name: Carapace + brew: rsteube/tap/carapace + nix-shell: carapace + pacman: carapace-bin + scoop: extras/carapace-bin + winget: rsteube.Carapace + hoard: + _bin: hoard + _github: https://github.com/Hyde46/hoard + _name: Hoard + brew: Hyde46/hoard/hoard + cargo: hoard-rs + nix-env: hoard + # Might be paru instead of pacman + pacman: hoard + port: hoard-cli spotdl: _bin: spotdl _deps: @@ -8751,6 +8994,65 @@ softwarePackages: port: t-rec snap: t-rec yay: t-rec + just: + _bin: just + _github: https://github.com/casey/just + _name: Just + cargo: just + scoop: just + brew: just + port: just + pacman: just + nix-env: nixpkgs.just + eopkg: just + xbps-install: just + pkg-freebsd: just + apk: just + dnf: just + choco: just + snap: --edge --classic just + winget: Casey.Just + apt: just + repo: + _bin: repo + _github: false + _name: Repo + apt: repo + dnf: repo + brew: repo + pacman: repo + # TODO: Include Windows install method + ack: + _bin: ack + _github: https://github.com/beyondgrep/ack3 + _name: Ack + port: perl/p5-app-ack + brew: ack + choco: ack + dnf: ack + pacman: ack + apt: ack + cloc: + _bin: cloc + _github: https://github.com/AlDanial/cloc + _name: Cloc + npm: cloc + apt: cloc + dnf: cloc + pacman: cloc + emerge: dev-util/cloc + apk: cloc + pkg_add: cloc + pkg-freebsd: cloc + port: cloc + brew: cloc + choco: cloc + scoop: cloc + shx: + _bin: shx + _github: https://github.com/shelljs/shx + _name: shx + npm: shx tabby: _bin: tabby _desc: '[Tabby](https://eugeny.github.io/tabby/) is a highly configurable terminal emulator, SSH and serial client for Windows, macOS and Linux.' @@ -8768,6 +9070,11 @@ softwarePackages: dnf: https://github.com/Eugeny/tabby/releases/download/v1.0.188/tabby-1.0.188-linux-x64.rpm github: github.com/Eugeny/tabby pacman: https://github.com/Eugeny/tabby/releases/download/v1.0.188/tabby-1.0.188-linux-x64.pacman + whereami: + _bin: whereami + _github: https://github.com/rafaelrinaldi/whereami + _name: Where Am I? + npm: '@rafaelrinaldi/whereami' tailscale: _bin: tailscale _desc: '[Tailscale](https://tailscale.com/) lets you easily manage access to private resources, quickly SSH into devices on your network, and work securely from anywhere in the world.' @@ -8791,6 +9098,7 @@ softwarePackages: _when:cask: '! test -d "/Applications/Tailscale.app" && ! test -d "$HOME/Applications/Tailscale.app"' cask: tailscale choco: tailscale + task: _bin: task _desc: A task runner / simpler Make alternative written in Go @@ -8814,6 +9122,20 @@ softwarePackages: port: dua-cli scoop: dua xbps: dua-cli + xh: + _bin: xh + _github: https://github.com/ducaale/xh + _name: XH + cargo: xh + pkg-android: xh + apk: xh + pacman: xh + apt: xh + pkg-freebsd: xh + nix-env: nixpkgs.xh + brew: xh + scoop: xh + choco: xh soduto: _github: _name: Soduto