diff --git a/.builds/bootstrap-scirpts-ci.yml b/.builds/bootstrap-scirpts-ci.yml new file mode 100644 index 0000000..c4bc4f7 --- /dev/null +++ b/.builds/bootstrap-scirpts-ci.yml @@ -0,0 +1,18 @@ +# yaml-language-server: $schema=https://cdn.recaptime.eu.org/schema/builds.sr.ht +image: "alpine/edge" +sources: + - https://git.sr.ht/~ajhalili2006/dotfiles +packages: + # linting chores + - shellcheck + - bash + - coreutils + - docker # for running tests related to env detection +environment: + DOTFILES_HOME: "$HOME/dotfiles" +tasks: + - lint: | + cd dotfiles + shellcheck --severity=warning bootstrap tools/bootstrap-utils/*.sh + - run_script: | + bash ./dotfiles/bootstrap diff --git a/.dotfiles.kdev4 b/.dotfiles.kdev4 new file mode 100644 index 0000000..b986b94 --- /dev/null +++ b/.dotfiles.kdev4 @@ -0,0 +1,4 @@ +[Project] +CreatedFrom= +Manager=KDevGenericManager +Name=~ajhalili2006 dotfiles diff --git a/.gitignore b/.gitignore index d1f725c..294e7ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ ## general ## .envrc +.env* +!.env.example # used by ctags for code indexing in some tools # or via "ctags -R ." tags @@ -10,6 +12,7 @@ secrets ## kate and other editors ## *~ *-swp +*.save ## Doplhin ## .directory @@ -19,3 +22,7 @@ secrets *.BASE.* *.LOCAL.* *.REMOTE.* + + +## other secrets ## +config/aerc/accounts.conf \ No newline at end of file diff --git a/.kdev4/.dotfiles.kdev4 b/.kdev4/.dotfiles.kdev4 new file mode 100644 index 0000000..5383e02 --- /dev/null +++ b/.kdev4/.dotfiles.kdev4 @@ -0,0 +1,5 @@ +[Buildset] +BuildItems=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x01\x00\x00\x00,\x00~\x00a\x00j\x00h\x00a\x00l\x00i\x00l\x00i\x002\x000\x000\x006\x00 \x00d\x00o\x00t\x00f\x00i\x00l\x00e\x00s) + +[Project] +VersionControlSupport=kdevgit diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..32df7ac --- /dev/null +++ b/.mailmap @@ -0,0 +1,4 @@ +Andrei Jiroh Eugenio Halili Andrei Jiroh Eugenio Halili +Andrei Jiroh Eugenio Halili Andrei Jiroh Halili +Andrei Jiroh Eugenio Halili Andrei Jiroh Halili +Andrei Jiroh Eugenio Halili Andrei Jiroh Halili \ No newline at end of file diff --git a/README.md b/README.md index 4be1320..5dcd1fc 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,10 @@ working at Recap Time Squad (formerly The Pins Team), see [our dotfiles][df-gl] While the clone URLs use GitLab SaaS as the canonical Git repository URL, you can still clone the repository from the following URLs: -* GitLab self-hosted instances: `https://mau.dev/ajhalili2006/dotfiles` -* SourceHut (official instance): `https://git.sr.ht/~ajhalili2006/dotfiles` (SSH: `git@git.sr.ht:~ajhalili2006/dotfiles) +* GitLab self-hosted instances: `https://mau.dev/ajhalili2006/dotfiles`[^1] +* SourceHut (official instance): `https://git.sr.ht/~ajhalili2006/dotfiles` (SSH: `git@git.sr.ht:~ajhalili2006/dotfiles`) + +[^1]: mau.dev will be my GitLab instance homeserver due to changes to the SaaS free plan, but I'll stay the GitLab SaaS repo on as an mirror. To get started, run the bootstrap script which handles the repository cloning/pulling for you and then sets things up for you. @@ -29,41 +31,45 @@ $(command -v curl>>/dev/null && echo curl -o- || echo wget -q0-) https://gitlab. ```bash $ date && echo && tree -d . -Saturday, 10 September, 2022 11:41:26 PM PST +# Monday, 31 October, 2022 11:39:54 PM PST +# +# . +# |-- bash-wakatime # TODO: Migrate to tools directory +# |-- bin # Handmade and third-party scripts go here. (binaries should be in ~/.local/bin instead) +# |-- config # Configuration files, mostly not per distro, with exception of Termux and WSL2 in some cases. +# | |-- aerc +# | | `-- templates +# | |-- bashrc +# | |-- byobu +# | |-- gitconfig +# | |-- konsole +# | |-- nanorc +# | | |-- config +# | | `-- highlighting +# | |-- ssh-client +# | |-- systemd +# | | `-- system +# | |-- tmux +# | `-- zshrc +# |-- docs # Markdown versions of my dotfiles docs at my Miraheze-hosted wiki +# | |-- additional-tools +# | `-- os-installation +# |-- gnupg # TODO: Migrate to config directory +# |-- nixos # TODO: Migrate to config directory +# |-- systemd -> config/systemd # TODO: Remove symlink soon +# |-- tests # Testing bootstrap scripts across distros +# | |-- alpine +# | |-- common +# | | `-- bin +# | `-- ubuntu +# |-- tools # A bit of homegrown tools and some other stuff I use +# | |-- archive +# | | `-- scripts +# | |-- bootstrap-utils +# | `-- setup-scripts +# `-- update-golang # TODO: Migrate to tools directory, might be deprecated due to usage of asdf/other tools -. -|-- bash-wakatime # TODO: Migrate to tools directory -|-- bin # Scripts go here. -|-- config # Configuration files, mostly not per distro, with exception of Termux and WSL2. -| |-- bashrc -| |-- byobu -| |-- gitconfig -| |-- konsole -| |-- nanorc -| | |-- config -| | `-- highlighting -| |-- ssh-client -| |-- systemd -| | `-- system -| |-- tmux -| `-- zshrc -|-- docs # Markdown versions of my dotfiles docs at my Miraheze-hosted wiki -| |-- additional-tools -| `-- os-installation -|-- gnupg # TODO: Migrate to config directory -|-- nixos # TODO: Migrate to config directory -|-- systemd -> config/systemd # TODO: Remove symlink soon -|-- tests # Testing bootstrap scripts across distros -| |-- alpine -| |-- common -| | `-- bin -| `-- ubuntu -|-- tools # A bit of homegrown tools and some other stuff I use -| |-- bootstrap-utils -| `-- setup-scripts -`-- update-golang # TODO: Migrate to tools directory, might be deprecated due to usage of asdf/other tools - -30 directories +34 directories ``` ### Documentation @@ -73,7 +79,7 @@ Available documentation for the on/offboarding processes I do for devices + othe ## License and contributions Code is licensed under [the MPL-2.0](LICENSE) license, while docs on my MediaWiki-powered wiki + here in this repository are licensed -under [CC BY-SA 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/legalcode). +under [CC BY-SA 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/legalcode) license. Patches (either via GitLab merge requests or email patches via `~ajhalili2006/public-inbox@lists.sr.ht`) are welcome, but technical diff --git a/bootstrap b/bootstrap index 58fb717..aea9942 100755 --- a/bootstrap +++ b/bootstrap @@ -1,18 +1,137 @@ #!/usr/bin/env bash +# shellcheck disable=SC2034 + +# SPDX-License-Identifier: MPL-2.0 +# The holy grail for all the Linux setup. { -if ! command -v git >>/dev/null; then - +# Make sure to bail out when something went wrong in any steps. +set -e + +# Enable shell debugging if $DEBUG is set +if [[ $DEBUG != "" ]]; then + set -x fi -DOTFILES_HOME=${DOTFILES_HOME:-"$HOME/.odtfiles"} -DOTFILES_GIT_MIRROR=${DOTFILES_GIT_MIRROR:-"https://gitlab.com/ajhalili2006/dotfiles"} - -if [[ ! -d "$DOTFILES_HOME" ]]; then - git clone "$DOTFILES_GIT_MIRROR" "$DOTFILES_HOME" +# Adding colors to some text in termnial based on envvar checks +# NO_COLOR: https://no-color.org/ +if [ -t 1 ] && [[ "$NO_COLOR" == "" ]]; then + RED=$(printf '\033[31m') + GREEN=$(printf '\033[32m') + YELLOW=$(printf '\033[33m') + BLUE=$(printf '\033[34m') + MAGENTA=$(printf '\033[35m') + BOLD=$(printf '\033[1m') + RESET=$(printf '\033[m') else - git -C "$DOTFILES_HOME" pull + RED="" + GREEN="" + YELLOW="" + BLUE="" + MAGENTA="" + BOLD="" + RESET="" fi +error() { + echo "${RED}error: $*${RESET}" +} + +success() { + echo "${GREEN}success: $*${RESET}" +} + +warn() { + echo "${YELLOW}warning: $*${RESET}" +} + +info() { + echo "${BOLD}info: $*${RESET}" +} + +stage() { + echo "${BOLD}==> $*${RESET}" +} + +if ! command -v git >>/dev/null; then + error "Git is required to setup the dotfiles and other configurations." + exit 1 +fi + +osCheck() { + # This step is required for different actions, like installing deps from system-wide package managers + # among other sorts of shitfuckery. We may need to also run tests through the CI to ensure nothing breaks. + if echo "$OSTYPE" | grep -qE "linux-android.*"; then + export DOTFILES_OS_NAME=android-termux + elif echo "$OSTYPE" | grep -qE '^linux-gnu.*'; then + if [ "$(lsb_release -is)" == "Debian" ]; then + export DOTFILES_OS_NAME=debian + if [ -d '/google/devshell' ] && [ -f '/google/devshell/bashrc.google' ]; then + export GOOGLE_CLOUD_SHELL=true + fi + elif [ "$(lsb_release -is)" == "Ubuntu" ]; then + export DOTFILES_OS_NAME=ubuntu + fi + else + error "Script unsupported for this specific distro. If this was an downstream fork of" + error "another repo, you could override the DOTFILES_OS_NAME variable (and enabling the" + error "FF_DISABLE_OS_DETECTION flag)" + exit 1 + fi +} + +checkEnv() { + stage "Checking environment for some possible issues" + if [[ $CODESPACES == "true" ]]; then + warn "GitHub Codespace environment detected, fixing..." + export DOTFILES_PATH="/workspaces/.codespaces/.persistedshare/dotfiles" + export PASSWORD_STORE_DIR="/workspaces/.codespaces/.presistedshare/password-store" + elif [[ $GITPOD_INSTANCE_ID != "" ]]; then + warn "Gitpod workspace detected, fixing..." + export PASSWORD_STORE_DIR="/workspace/.password-store" + fi +} + +dotfilesInit() { + DOTFILES_HOME=${DOTFILES_HOME:-"$HOME/.dotfiles"} + DOTFILES_GIT_MIRROR=${DOTFILES_GIT_MIRROR:-"https://mau.dev/ajhalili2006/dotfiles"} + DOTFILES_GIT_BRANCH=${DOTFILES_GIT_BRANCH:-"main"} + + if [[ $DOTFILES_HOME != "$HOME/.dotfiles" ]]; then + echo "DOTFILES_HOME=${DOTFILES_HOME}" > ~/.dotfilescfg.env + fi + + if [[ ! -d "$DOTFILES_HOME" ]]; then + git clone --verbose "$DOTFILES_GIT_MIRROR" "$DOTFILES_HOME" --branch "$DOTFILES_GIT_BRANCH" --recursive + else + git remote set-url origin "$DOTFILES_GIT_MIRROR" + git -C "$DOTFILES_HOME" fetch --all --verbose + git -C "$DOTFILES_HOME" switch "$DOTFILES_GIT_BRANCH" + git -C "$DOTFILES_HOME" pull "$DOTFILES_GIT_BRANCH" + fi +} + +passwdstoreInit() { + PASSWORD_STORE_DIR=${PASSWORD_STORE_DIR:-"~/.password-store"} +} + +runBootstrapScripts() { + for script_stage in "$DOTFILES_HOME"/tools/bootstrap-utils/*.sh; do + if [[ "$script_stage" != "$DOTFILES_HOME/tools/bootstrap-utils/00-script-library.sh" ]]; then + bash "$script_stage" + else + continue + fi + done +} + +main() { + checkEnv + osCheck + dotfilesInit +} + +main "$@" + } \ No newline at end of file diff --git a/config/aerc/.gitkeep b/config/aerc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/config/aerc/accounts-template.conf b/config/aerc/accounts-template.conf new file mode 100644 index 0000000..6f056c6 --- /dev/null +++ b/config/aerc/accounts-template.conf @@ -0,0 +1,16 @@ +# Gmail address for development-related stuff +[gmail.andreijiroh.dev] +source = imaps://ajhalili2006%40gmail.com:${GMAIL_APP_PASSWORD}@imap.gmail.com:993 +outgoing = smtp+plain://ajhalili2006%40gmail.com:${GMAIL_APP_PASSWORD}@smtp.gmail.com:587 +default = INBOX +smtp-starttls = yes +from = Andrei Jiroh Halili +copy-to = Sent + +# crew mail +[recaptime.dev] +source = imaps://ajhalili2006%40recaptime.eu.org:${YANDEX_MAIL_PASSWORD}@ +outgoing = smtp+plain://ajhalili2006%40recaptime.eu.org:${YANDEX_MAIL_PASSWORD}@ +smtp-starttls = yes +from = "~ajhalili2006 [RecapTime.dev] " +copy-to = Sent \ No newline at end of file diff --git a/config/aerc/aerc.conf b/config/aerc/aerc.conf new file mode 100644 index 0000000..e63d949 --- /dev/null +++ b/config/aerc/aerc.conf @@ -0,0 +1,163 @@ +# +# aerc main configuration + +[ui] +# +# Describes the format for each row in a mailbox view. This field is compatible +# with mutt's printf-like syntax. +# +# Default: +index-format=%D %-17.17n %s + +# +# See time.Time#Format at https://godoc.org/time#Time.Format +# +# Default: 2006-01-02 03:04 PM (ISO 8601 + 12 hour time) +timestamp-format=2006-01-02 03:04 PM + +# +# Width of the sidebar, including the border. +# +# Default: 20 +sidebar-width=20 + +# +# Message to display when viewing an empty folder. +# +# Default: (no messages) +empty-message=(no messages) + +# Message to display when no folders exists or are all filtered +# +# Default: (no folders) +empty-dirlist=(no folders) + +# Enable mouse events in the ui, e.g. clicking and scrolling with the mousewheel +# +# Default: false +mouse-enabled=true + +# +# Ring the bell when new messages are received +# +# Default: yes +new-message-bell=true + +# Describes the format string to use for the directory list +# +# Default: %n %>r +dirlist-format=%n %>r + +# List of space-separated criteria to sort the messages by, see *sort* +# command in *aerc*(1) for reference. Prefixing a criterion with "-r " +# reverses that criterion. +# +# Example: "from -r date" +# +# Default: "" +sort= + +# Moves to next message when the current message is deleted +# +# Default: false +next-message-on-delete=true + +[viewer] +# +# Specifies the pager to use when displaying emails. Note that some filters +# may add ANSI codes to add color to rendered emails, so you may want to use a +# pager which supports ANSI codes. +# +# Default: less -R +pager=less -R + +# +# If an email offers several versions (multipart), you can configure which +# mimetype to prefer. For example, this can be used to prefer plaintext over +# html emails. +# +# Default: text/plain,text/html +alternatives=text/plain,text/html + +# +# Default setting to determine whether to show full headers or only parsed +# ones in message viewer. +# +# Default: false +show-headers=false + +# +# Layout of headers when viewing a message. To display multiple headers in the +# same row, separate them with a pipe, e.g. "From|To". Rows will be hidden if +# none of their specified headers are present in the message. +# +# Default: From|To,Cc|Bcc,Date,Subject +header-layout=From|To,Cc|Bcc,Date,Subject + +# Whether to always show the mimetype of an email, even when it is just a single part +# +# Default: false +always-show-mime=true + +[compose] +# +# Specifies the command to run the editor with. It will be shown in an embedded +# terminal, though it may also launch a graphical window if the environment +# supports it. Defaults to $EDITOR, or vi. +# +# Tip: Pratice using Vim a bit more. :) +editor=vi + +# +# Default header fields to display when composing a message. To display +# multiple headers in the same row, separate them with a pipe, e.g. "To|From". +# +# Default: To|From,Subject +header-layout=To|From,Subject + +[filters] +# +# Filters allow you to pipe an email body through a shell command to render +# certain emails differently, e.g. highlighting them with ANSI escape codes. +# +# The first filter which matches the email's mimetype will be used, so order +# them from most to least specific. +# +# You can also match on non-mimetypes, by prefixing with the header to match +# against (non-case-sensitive) and a comma, e.g. subject,text will match a +# subject which contains "text". Use header,~regex to match against a regex. +subject,~^\[PATCH=awk -f /usr/share/aerc/filters/hldiff +#text/html=/usr/share/aerc/filters/html +text/*=awk -f /usr/share/aerc/filters/plaintext +#image/*=catimg -w $(tput cols) - + +[triggers] +# +# Triggers specify commands to execute when certain events occur. +# +# Example: +# new-email=exec notify-send "New email from %n" "%s" + +# +# Executed when a new email arrives in the selected folder +new-email= + +[templates] +# Templates are used to populate email bodies automatically. +# + +# The directories where the templates are stored. It takes a colon-separated +# list of directories. +# +# default: /usr/share/aerc/templates/ +template-dirs=/usr/share/aerc/templates/:/home/ajhalili2006/.dotfiles/config/aerc/templates + +# The template to be used for quoted replies. +# +# default: quoted_reply +quoted-reply=quoted_reply + +# The template to be used for forward as body. +# +# default: forward_as_body +forwards=forward_as_body diff --git a/config/aerc/binds.conf b/config/aerc/binds.conf new file mode 100644 index 0000000..ac49bd0 --- /dev/null +++ b/config/aerc/binds.conf @@ -0,0 +1,99 @@ +# Binds are of the form = +# To use '=' in a key sequence, substitute it with "Eq": "" +# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit + = :prev-tab + = :next-tab + = :term + +[messages] +q = :quit + +j = :next + = :next + = :next 50% + = :next 100% + = :next -s 100% + +k = :prev + = :prev + = :prev 50% + = :prev 100% + = :prev -s 100% +g = :select 0 +G = :select -1 + +J = :next-folder +K = :prev-folder + + = :view +d = :confirm 'Really delete this message?' ':delete-message' +D = :delete +A = :archive flat + +C = :compose + +rr = :reply -a +rq = :reply -aq +Rr = :reply +Rq = :reply -q + +c = :cf +$ = :term +! = :term +| = :pipe + +/ = :search +\ = :filter +n = :next-result +N = :prev-result + +[view] +q = :close +| = :pipe +D = :delete +S = :save +A = :archive flat + +f = :forward +rr = :reply -a +rq = :reply -aq +Rr = :reply +Rq = :reply -q + +H = :toggle-headers + = :prev-part + = :next-part +J = :next +K = :prev + +[compose] +# Keybindings used when the embedded terminal is not selected in the compose +# view +$ex = + = :prev-field + = :next-field + = :next-field + +[compose::editor] +# Keybindings used when the embedded terminal is selected in the compose view +$noinherit = true +$ex = + = :prev-field + = :next-field + = :prev-tab + = :next-tab + +[compose::review] +# Keybindings used when reviewing a message to be sent +y = :send +n = :abort +q = :abort +e = :edit +a = :attach + +[terminal] +$noinherit = true +$ex = + + = :prev-tab + = :next-tab diff --git a/config/aerc/templates/recaptime.dev-onboarding b/config/aerc/templates/recaptime.dev-onboarding new file mode 100644 index 0000000..44d2ccc --- /dev/null +++ b/config/aerc/templates/recaptime.dev-onboarding @@ -0,0 +1 @@ +Hi {{new-crew-member-username}} and welcome to Recap Time Squad! \ No newline at end of file diff --git a/config/aerc/templates/thanks b/config/aerc/templates/thanks new file mode 100644 index 0000000..fc9e005 --- /dev/null +++ b/config/aerc/templates/thanks @@ -0,0 +1,5 @@ +X-Sourcehut-Patchset-Update: APPLIED + +Thanks! + +{{exec "{ git remote get-url --push origin; git reflog -2 origin/main --pretty=format:%h | xargs printf '%s\n' | tac; } | xargs printf 'To %s\n %s..%s main -> main'" ""}} \ No newline at end of file diff --git a/config/bashrc/aliases b/config/bashrc/aliases index 6357c03..3e233f3 100644 --- a/config/bashrc/aliases +++ b/config/bashrc/aliases @@ -1,5 +1,7 @@ #!/bin/bash +# SPDX-License-Identifier: MPL-2.0 +# ################################################## # # # AN NOTE ON ADDING ALIASES INTO HERE: # @@ -37,7 +39,8 @@ alias tag-checkpoint="git tag --gpg-sign" alias tag-checkpoint-nogpg="git tag --no-gpg-sign" alias new-tag="tag-checkpoint" alias new-tag-nogpg="tag-checkpoint-nogpg" -## shortcuts to managing yiff stash +## shortcuts to managing yiff stash, might be converted into an full-blown +## function/shell script later alias stash="git stash push --keep-index" alias pop-stash="git stash pop" alias apply-stash="git stash apply" @@ -46,6 +49,7 @@ alias yeet-stash="git stash drop" alias stage="git add" alias unstage="git restore --staged" alias nuke-from-index="git rm" +alias nuke-cached="git rm --cached" # branch management alias rename-branch="git branch -m" @@ -63,7 +67,7 @@ alias remove-remote="nuke-remote" alias push="git push" ## add main:master since Git assumes local branch to ## remote branch when running this alias -alias deploy-divio="git push divio" +alias deploy-divio="git push divio" # might use divio again after getting an CC in the future # fetch / pull alias fetch="git fetch --all" @@ -73,11 +77,12 @@ alias pull-upstream="fetch && git pull upstream" alias pull-origin="fetch && git pull origin" # history-cleanup like scripts -alias clean-shellhis="history -c && clear" +#alias clean-shellhis="history -c && clear" # test SSH connections -alias test-gh-ssh="ssh -p 22 git@github.com" -alias test-gl-ssh="ssh -p 22 git@gitlab.com" +alias test-gh-ssh="ssh -T -p 22 git@github.com" +alias test-gl-ssh="ssh -T -p 22 git@gitlab.com" +alias test-git-hut-ssh="ssh -T -p 22 git@git.sr.ht" # ssh-agent stuff ## quock shortcut into add-ssh-keys stuff @@ -85,9 +90,10 @@ alias add-ssh-key="$HOME/.dotfiles/bin/add-ssh-keys" # shortcuts to some functions alias edit-script="edit-script-file" +alias edit-functions="edit-funcs-bashrc" # add a bit of test here alias guild-test="echo successfully imported owo" # shortcuts for rdp stuff -alias bshq-cursed='rdesktop --user cursed-remote-user -r audio:local -x lan -r clipboard:PRIMARYCLIPBOARD -n guildedguy bullshit.hq' +#alias bshq-cursed='rdesktop --user cursed-remote-user -r audio:local -x lan -r clipboard:PRIMARYCLIPBOARD -n guildedguy bullshit.hq' diff --git a/config/bashrc/chain-source b/config/bashrc/chain-source index 9140836..9c685e0 100644 --- a/config/bashrc/chain-source +++ b/config/bashrc/chain-source @@ -3,4 +3,7 @@ # these commands should be triggered on shell startup source "$DOTFILES_HOME/config/bashrc/aliases" source "$DOTFILES_HOME/config/bashrc/functions" -#guild-test + +if ! command -v keychain >> /dev/null; then + keychain ~/.ssh/personal ~/.ssh/ajhalili2006.recaptime.dev +fi diff --git a/config/bashrc/functions b/config/bashrc/functions index cafdc63..6b4766a 100644 --- a/config/bashrc/functions +++ b/config/bashrc/functions @@ -1,10 +1,8 @@ #!/bin/bash # shellcheck disable=SC2199,SC2068,SC1091,SC2086,SC2145 -# custom function management here -# changes to the worthwhile-functions filepath requires -# an update o the filepath via 'edit-script reload-funcs-bashrc -# and also any reference here +# SPDX-License-Identifier: MPL-2.0 + DOTFILES_HOME=${DOTFILES_HOME:-"$HOME/.dotfiles"} source "$DOTFILES_HOME/tools/bootstrap-utils/00-script-library.sh" @@ -14,7 +12,7 @@ disable-funcs () { } edit-funcs-bashrc() { - $(command -v nano>>/dev/null && echo nano || echo vi) ~/.dotfiles/bashrc/worthwhile-functions + $(command -v nano>>/dev/null && echo nano || echo vi) ~/.dotfiles/bashrc/functions } list-debs-size() { @@ -23,10 +21,10 @@ list-debs-size() { edit-script-file() { # if you use other editor, please set $EDITOR. - $EDITOR "$(command -v $1)" + ${EDITOR:-"nano"} "$(command -v $1)" } -# reloading stuff +# Refreshing shell with latest updates refresh-funcs() { showStage "reloading current session with fresh functions" source "$DOTFILES_HOME/config/bashrc/functions" @@ -54,33 +52,36 @@ list-nodejs-scripts() { [[ -f "package.json" ]] && jq .scripts < package.json || echo "No package.json found in current directory." } +# TODO: Support code-server from Coder and Gitpod's OpenVSCode Server. +# TODO: Might also add support for Theia IDE too soon. code() { # quick trick in case only code-insiders is installed and not code - if ! command -v code >> /dev/null; then + if [[ $(type -p code) == "" ]]; then if command -v code-insiders >>/dev/null; then - warn "code-stable is not installed, but code-insiders is found in PATH, setting USE_CODE_INSIDERS" - warn "for this run" + warn "code is not installed, but code-insiders is found in PATH, setting USE_CODE_INSIDERS" + warn "for this run behind the scenes for you" USE_CODE_INSIDERS=true fi fi if [[ -f "/snap/bin/code" && "$USE_CODE_INSIDERS" == "" ]]; then echo "info: execing /snap/bin/code with params: $*" - exec /snap/bin/code "$@" + /snap/bin/code "$@" elif [[ -f "/snap/bin/code-insiders" ]]; then echo "info: execing /snap/bin/code-insiders with params: $*" - exec /snap/bin/code-insiders "$*" + /snap/bin/code-insiders "$*" fi - if [[ "$(command -v code)" != "" && "$USE_CODE_INSIDERS" == "" ]]; then - info "execing $(command -v code) with params: $*" - exec "$(command -v code)" "$*" - elif [[ $(command -v code-insiders) != "" ]]; then - info "execing $(command -v code-insiders) with params: $*" - exec "$(command -v code-insiders)" "$*" + if [[ "$(type -p code)" != "" && "$USE_CODE_INSIDERS" == "" ]]; then + info "execing $(type -p code) with params: $*" + "$(type -p code)" "$*" + elif [[ $(type -p code-insiders) != "" ]]; then + info "execing $(type -p code-insiders) with params: $*" + "$(command -v code-insiders)" "$*" + else + echo "Either VS Code Stable or Insiders aren't installed on your system. Please visit" + echo "https://go.rtapp.tk/get-code to install VS Code. If you're using VS Code server," + echo "" + return 1 fi - - echo "Either VS Code Stable or Insiders aren't installed on your system. Please visit" - echo "https://go.rtapp.tk/get-code to install the code editor." - return 1 -} \ No newline at end of file +} diff --git a/config/bashrc/ubuntu.bashrc b/config/bashrc/ubuntu.bashrc index 38d9653..2b26b3c 100644 --- a/config/bashrc/ubuntu.bashrc +++ b/config/bashrc/ubuntu.bashrc @@ -167,19 +167,22 @@ else fi # As long as possible, attempt to setup our GnuPG agent when we're on an SSH session. +KEYCHAIN_FLAGS_NOGUI="--nogui --noinherit" +#KEYCHAIN_FLAGS="" if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]; then - eval $(keychain --agents gpg,ssh --eval --nogui --noinherit) || true + eval $(keychain --agents gpg,ssh --eval $KEYCHAIN_FLAGS_NOGUI) || true export GPG_TTY=$(tty) else # We'll do some checks here btw, Currently I use GNOME and Xfce4 as my desktop environments case $(ps -o comm= -p $PPID) in # Sometimes, $SSH_CLIENT and/or $SSH_TTY doesn't exists so we'll pull what ps says - sshd | */sshd) eval $(keychain --agents gpg,ssh --eval --nogui --noinherit) || true;; + sshd | */sshd) eval $(keychain --agents gpg,ssh --eval $KEYCHAIN_FLAGS_NOGUI) || true;; xfce*) eval $(keychain --agents gpg,ssh --eval) || true;; gnome*) eval $(keychain --agents gpg,ssh --eval) || true;; + # Don't forget VS Code and code-server! code) eval $(keychain --agents gpg,ssh --eval) || true;; - *) eval $(keychain --agents gpg,ssh --eval --nogui --noinherit) || true;; + *) eval $(keychain --agents gpg,ssh --eval $KEYCHAIN_FLAGS_NOGUI) || true;; esac fi diff --git a/config/konsole/bookmarks.xml b/config/konsole/bookmarks.xml new file mode 100644 index 0000000..fef4e50 --- /dev/null +++ b/config/konsole/bookmarks.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/config/konsole/bookmarks.xml.tbcache b/config/konsole/bookmarks.xml.tbcache new file mode 100644 index 0000000..e69de29 diff --git a/config/konsole/konsolestaterc b/config/konsole/konsolestaterc new file mode 100644 index 0000000..9d6d89c --- /dev/null +++ b/config/konsole/konsolestaterc @@ -0,0 +1,2 @@ +[General] +CommandBarLastUsedActions= diff --git a/config/konsole/~ajhalili2006 - bash.profile b/config/konsole/~ajhalili2006 - bash.profile new file mode 100644 index 0000000..2d703ac --- /dev/null +++ b/config/konsole/~ajhalili2006 - bash.profile @@ -0,0 +1,21 @@ +[Appearance] +ColorScheme=Breeze +Font=CaskaydiaCove Nerd Font Mono,12,-1,5,50,0,0,0,0,0 +TabColor=0,255,0 + +[General] +Command=/usr/bin/env bash +Environment=TERM=xterm-256color,COLORTERM=truecolor,KONSOLE=1,TMUX= +Name=~ajhalili2006 - bash +Parent=FALLBACK/ +SemanticUpDown=false + +[Interaction Options] +CtrlRequiredForDrag=false + +[Scrolling] +HistoryMode=2 + +[Terminal Features] +BlinkingCursorEnabled=true +UrlHintsModifiers=67108864 diff --git a/config/ssh-client/linux b/config/ssh-client/linux index d05cb7f..0ec60ff 100644 --- a/config/ssh-client/linux +++ b/config/ssh-client/linux @@ -24,7 +24,6 @@ Host github.com Host gitlab.alpinelinux.org User git IdentityFile ~/.ssh/launchpad - # Launchpad.net SSH keys for mirroring some repos manually, # partularly the gitlab.com:termux-package-android5x/src.git repo # among any sort of shits and giggles. @@ -34,6 +33,9 @@ Host git.launchpad.net Host bazar.launchpad.net IdentityFile ~/.ssh/launchpad User ajhalili2006 +Host git.sr.ht + IdentityFile ~/.ssh/personal + User git # LXC containers, please append as possible Host ghost-localhost @@ -82,9 +84,9 @@ Host wsl.stellapent.local Hostname stellapent.local Port 2222 # SourceForge -Host sourceforge +Host shell.sourceforge.net User ajhalili2006 - Hostname shell.sourceforge.net + #Hostname shell.sourceforge.net IdentityFile ~/.ssh/launchpad # hax.co.id @@ -94,14 +96,13 @@ Host sourceforge # User ajhalili2006 # Port 4830 # IdentityFile ~/.ssh/launchpad - -Host sandbox.ajhalili2006.dev - Hostname 148.251.50.26 - Port 12411 - User ajhalili2006 - IdentityFile ~/.ssh/launchpad -Host mau-dev-mirrors-haxserver.runners.recaptime.dev - Hostname todo.recaptime.app - User ajhalili2006 - Port 6666 - IdentityFile ~/.ssh/ajhalili2006.recaptime.dev +#Host sandbox.ajhalili2006.dev +# Hostname 148.251.50.26 +# Port 12411 +# User ajhalili2006 +# IdentityFile ~/.ssh/launchpad +#Host mau-dev-mirrors-haxserver.runners.recaptime.dev +# Hostname todo.recaptime.app +# User ajhalili2006 +# Port 6666 +# IdentityFile ~/.ssh/ajhalili2006.recaptime.dev diff --git a/docs/onboarding.md b/docs/onboarding.md index 936cd42..4acb9b2 100644 --- a/docs/onboarding.md +++ b/docs/onboarding.md @@ -91,7 +91,7 @@ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1; sudo sysctl -w net.ipv6.conf.de ## Post System Preparation/Wramup * Run the bootstrap script as noted in the README. **Remember that Tailscale setup is still manual due to presence of ACL policies in `recaptime.org.github` tailnet.** -* After bootstrapping, run the `tailscale-provisioner` script, which requires Python instealled. It'll prompt you for an Tailscale authtoken and select tags. You don't need to do this on Termux, assuming the Android app is installed. If already configured, you may need to add `--force` flag on it. +* After bootstrapping, run the `tailscale-provisioner` script, which requires Deno instealled. It'll prompt you for an Tailscale authtoken and select tags. You don't need to do this on Termux, assuming the Android app is installed. If already configured, you may need to add `--force` flag on it. * Manually import GPG keys with `gpg --decrypt "$DOTFILES_HOME/secrets/pgp/personal.key.asc" | gpg --import`. ## Optionals diff --git a/docs/os-installation/alpinelinux.md b/docs/os-installation/alpinelinux.md new file mode 100644 index 0000000..3ffc8f2 --- /dev/null +++ b/docs/os-installation/alpinelinux.md @@ -0,0 +1,5 @@ +# Setting up Alpine Linux + +> Wiki version: https://ajhalili2006.miraheze.org/wiki/Onboarding_new_device/Computers/Linux/Alpine + +TBD