diff --git a/.gitignore b/.gitignore index 00d2475..0407a58 100644 --- a/.gitignore +++ b/.gitignore @@ -39,8 +39,6 @@ Thumbs.db # Arbitrary files and folders # ############################### -# I symlink alacritty.toml -alacritty/alacritty.toml ## General ## ############# @@ -92,7 +90,6 @@ Music/* Pictures/* Screenshots/* Videos/* -VirtualBox VMs/* .TrueCrypt-lock-ricardo .TrueCrypt/ .adobe/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c5b66ea..2026daf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,8 @@ repos: rev: 1.16.0 hooks: - id: yamlfix + additional_dependencies: + - 'maison<2.0.0' - repo: https://github.com/Yelp/detect-secrets rev: v1.4.0 hooks: diff --git a/MacOS/post-install b/MacOS/post-install index 0ddcc0e..6b4808c 100644 --- a/MacOS/post-install +++ b/MacOS/post-install @@ -15,10 +15,8 @@ strictMode function are_brew_basics_installed() { declare -a BREW_BASICS=('bat' 'bfg' - 'exa' 'fd' 'fpp' - 'rclone' 'ripgrep' 'pandoc' 'shellcheck' @@ -33,7 +31,6 @@ function are_brew_basics_installed() { function are_cask_basics_installed() { declare -a BREW_CASK_BASICS=('1password' - 'alacritty' 'alfred' 'firefox' 'font-hack-nerd-font' @@ -52,8 +49,8 @@ function are_cask_basics_installed() { 'transmission' 'tripmode' 'tunnelblick' - 'visual-studio-code' - 'vlc') + 'vlc' + 'wezterm') are_brew_basics_installed install_if_not_installed 'brewcask' 'n' "${BREW_CASK_BASICS[@]}" } diff --git a/README.md b/README.md index afd1078..323fa8f 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ Keep key configurations and share them among your computers - [gnupg](https://gnupg.org/) - [JetBrains Mono font](https://www.jetbrains.com/lp/mono/) - [jq](https://stedolan.github.io/jq/) + - [keyring](https://pypi.org/project/keyring/) - [inetutils](https://www.gnu.org/software/inetutils/) - [mackup](https://github.com/lra/mackup) - [parallel](https://www.gnu.org/software/parallel/) @@ -33,9 +34,8 @@ Keep key configurations and share them among your computers - [tmux](https://tmux.github.io/) - [tree](http://mama.indstate.edu/users/ice/tree/) - [vim](https://www.vim.org/) - - [visual studio code](https://code.visualstudio.com/) - - [VirtualBox](https://www.virtualbox.org/wiki/Downloads) - [vlc](https://www.videolan.org/vlc/) + - [wezterm](https://wezfurlong.org/wezterm/index.html) - [wget](https://www.gnu.org/software/wget/) - [wireshark](https://www.wireshark.org) - [xz](https://tukaani.org/xz/) @@ -65,20 +65,13 @@ Keep key configurations and share them among your computers - Installs: - [Homebrew](https://brew.sh) - - [mitmproxy](https://mitmproxy.org/downloads/) - [apt](https://wiki.debian.org/Apt) - [apt-file](https://wiki.debian.org/apt-file) - [ghostwriter](https://wereturtle.github.io/ghostwriter/) - [libxml2-utils](http://xmlsoft.org) - [Network Manager OpenVPN](https://gitlab.gnome.org/GNOME/NetworkManager-openvpn) - - [python3-keyring](https://pypi.org/project/keyring/) - [xclip](https://github.com/astrand/xclip) -### Stuff I may replace - -- Virtualbox with [multipass](https://multipass.run/) or - [xhyve](https://github.com/machyve/xhyve), `xhyve` if I need windows hosts - ## how I use mackup - `~/.mackup.cfg` uses directory `~/.dot-files-rclone` with engine `file_system` diff --git a/Ubuntu/base b/Ubuntu/base index df1516c..1cddd94 100644 --- a/Ubuntu/base +++ b/Ubuntu/base @@ -34,7 +34,6 @@ function are_basics_installed() { 'lsb-release' 'make' 'procps' - 'python3-keyring' 'software-properties-common' 'tk-dev' 'wget' diff --git a/Ubuntu/post-install b/Ubuntu/post-install index 923da19..bc0e12c 100644 --- a/Ubuntu/post-install +++ b/Ubuntu/post-install @@ -10,6 +10,20 @@ strictMode # shellcheck disable=SC1091 . "${GITROOT}"/Ubuntu/base +function get_deb_url_from_xpath() { + local URL="${1}" + local XPATH="${2}" + local DEB_URL + DEB_URL="$(curl -s \ + "${URL}" | \ + xmllint --html \ + --xpath "${XPATH}" - 2> /dev/null)" + if [[ "${#DEB_URL}" -lt 4 ]]; then + return 1 + fi + echo "${DEB_URL}" +} + function is_repo_present() { local REPO="${1}" grep -v -E '^#|^ *$' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -Fq "${REPO/ppa:/}" @@ -17,9 +31,14 @@ function is_repo_present() { function add_apt_repo() { local REPO="${1}" - echo "will try to remove repository ${REPO} if it exists already" + local FILE_NAME="${2}" + msg_info "will try to remove repository ${REPO} if it exists already" if ! is_repo_present "${REPO}"; then - sudo add-apt-repository -y "${REPO}" + if [[ "${REPO}" =~ ^ppa:.*/ppa$ ]]; then + sudo add-apt-repository -y "${REPO}" + else + echo "${REPO}" | sudo tee /etc/apt/sources.list.d/"${FILE_NAME}".list > /dev/null + fi fi } @@ -41,6 +60,7 @@ function are_extra_cli_tools_installed() { 'libcurl4-openssl-dev' 'libxml2' 'libxml2-dev' + 'nala' 'pandoc' 'pkg-config' 'tshark') @@ -49,28 +69,22 @@ function are_extra_cli_tools_installed() { function are_extra_tools_installed() { declare -a EXTRA_UBUNTU_TOOLS=('ghostwriter' - 'alacritty' - 'nala' 'network-manager-openvpn-gnome' 'openvpn-systemd-resolved' 'pinta' 'sublime-text' - 'termshark' 'transmission-gtk' 'ubuntu-cleaner' 'vlc' - 'virtualbox-7.0' + 'wezterm' 'wireguard' 'wireshark-gtk') install_if_not_installed 'apt' 'n' "${EXTRA_UBUNTU_TOOLS[@]}" declare -a EXTRA_BREW_TOOLS=('bat' 'bfg' - 'exa' 'fd' 'fpp' 'bitwarden-cli' - 'mitmproxy' - 'rclone' 'ripgrep' 'shellcheck' 'shfmt' @@ -108,61 +122,63 @@ function download_and_install_deb() { } function install_desktop_apps() { + local TMP_DOT_FILES TMP_DOT_FILES=$(mktemp -d dot-files.XXXX) - echo "Adding apt keys for docker, sublime-text, virtualbox" + msg_info 'Adding apt keys for docker, sublime-text' declare -A APT_KEYS=( - ['docker']='https://download.docker.com/linux/ubuntu/gpg' ['sublime']='https://download.sublimetext.com/sublimehq-pub.gpg' - ['volian-scar-unstable']='https://deb.volian.org/volian/scar.key' + ['wezterm-fury']='https://apt.fury.io/wez/gpg.key' ) for KEY_NAME in "${!APT_KEYS[@]}"; do add_apt_key "${APT_KEYS[${KEY_NAME}]}" "${KEY_NAME}" "${TMP_DOT_FILES}" done - echo "Adding repositories: docker, GhostWriter, sublime-text, virtualbox" - declare -a REPOSITORIES=( - "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - 'ppa:wereturtle/ppa' - 'ppa:gerardpuig/ppa' - 'deb [signed-by=/etc/apt/trusted.gpg.d/sublime.gpg] https://download.sublimetext.com/ apt/stable/' - "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" - 'deb [signed-by=/etc/apt/trusted.gpg.d/volian-scar-unstable.gpg] https://deb.volian.org/volian/ scar main' + msg_info 'Will create /etc/apt/keyrings/docker.asc if does not exist' + if [[ ! -e /etc/apt/keyrings/docker.asc ]]; then + sudo install -m 0755 -d /etc/apt/keyrings + sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc + sudo chmod a+r /etc/apt/keyrings/docker.asc + msg_info 'Created /etc/apt/keyrings/docker.asc' + fi + + echo "Adding repositories: docker, GhostWriter, sublime-text" + declare -A REPOSITORIES=( + ['docker']="deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + ['ghostwriter']='ppa:wereturtle/ppa' + ['ubuntu-cleaner']='ppa:gerardpuig/ppa' + ['sublime']='deb [signed-by=/etc/apt/trusted.gpg.d/sublime.gpg] https://download.sublimetext.com/ apt/stable/' + ['wezterm']='deb [signed-by=/etc/apt/trusted.gpg.d/wezterm-fury.gpg] https://apt.fury.io/wez/ * *' ) - for REPOSITORY in "${REPOSITORIES[@]}"; do - add_apt_repo "${REPOSITORY}" + for KEY in "${!REPOSITORIES[@]}"; do + add_apt_repo "${REPOSITORIES[${KEY}]}" "${KEY}" done - sudo apt update - - is_docker_installed - are_extra_tools_installed - - echo "Installing visual studio code, Google Chrome Stable, Slack" - LATEST_SLACK="$(curl -s 'https://slack.com/downloads/instructions/ubuntu' | xmllint --html --xpath 'string(/html/body/main/section[3]/div/p[1]/a[1]/@href)' - 2> /dev/null )" + echo "Installing Google Chrome Stable, Slack" + LATEST_SLACK="$(get_deb_url_from_xpath 'https://slack.com/downloads/instructions/linux?ddl=1&build=deb' 'string(/html/body/main/section[1]/iframe/@src)')" declare -A DEB_PACKAGES=( ['1password']='https://downloads.1password.com/linux/debian/amd64/stable/1password-latest.deb' # pragma: allowlist secret - ['code']='https://go.microsoft.com/fwlink/?LinkID=760868' ['google-chrome-stable']='https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb' - ['slack']="${LATEST_SLACK}") + ['slack']="${LATEST_SLACK}" + ['nala']='https://deb.volian.org/volian/pool/main/v/volian-archive/volian-archive-nala_0.3.1_all.deb' + ['volian-keyring']='https://deb.volian.org/volian/pool/main/v/volian-archive/volian-archive-keyring_0.3.1_all.deb' + ) for KEY in "${!DEB_PACKAGES[@]}"; do download_and_install_deb "${DEB_PACKAGES[${KEY}]}" "${KEY}" done + retry_command "10" "sudo" "apt" "update" + + is_docker_installed + are_extra_tools_installed + # needed for multiple apps mkdir -p "${HOME}/bin" || true HOME_BIN="${HOME}/bin" - if ! grep -q 'Oracle VM VirtualBox Extension Pack' <(sudo VBoxManage list extpacks); then - echo 'Installing virtualbox Extension pack' - LATEST_EXT_PACK=$(curl 'https://www.virtualbox.org/wiki/Downloads' | xmllint --html --xpath 'string(//html/body/div[4]/div[3]/div[3]/div/div[2]/ul[3]/li/a/@href)' - 2> /dev/null) - curl -Lv "${LATEST_EXT_PACK}" -o "${TMP_DOT_FILES}/Oracle_VM_VirtualBox_Extension_Pack.vbox-extpack" - sudo VBoxManage extpack install --replace "${TMP_DOT_FILES}/Oracle_VM_VirtualBox_Extension_Pack.vbox-extpack" - fi - if ! grep -q 'JetBrains Mono' <(fc-list); then echo 'Installing Jetbrains Font' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/install_manual.sh)" @@ -175,7 +191,7 @@ function install_desktop_apps() { git clone --depth 1 https://github.com/ryanoasis/nerd-fonts.git "${HOME}/src/nerd-fonts" fi cd "${HOME}/src/nerd-fonts" || exit 1 - ./install.sh -q -A + ./install.sh -q cd - || exit 1 fc-cache -f -v fi @@ -194,7 +210,7 @@ function install_desktop_apps() { LATEST_JETBRAINS_TOOLBOX=$(curl -sL 'https://data.services.jetbrains.com//products/releases?code=TBA&latest=true&type=release' | jq -r '.TBA[].downloads.linux.link') curl -Lv "${LATEST_JETBRAINS_TOOLBOX}" -o "${TMP_DOT_FILES}/jetbrains-toolbox.tar.gz" tar -xzvf "${TMP_DOT_FILES}/jetbrains-toolbox.tar.gz" -C "${TMP_DOT_FILES}" - mv "${TMP_DOT_FILES}/jetbrains-toolbox-*/jetbrains-toolbox" "${HOME_BIN}/" + mv "${TMP_DOT_FILES}"/jetbrains-toolbox-*/jetbrains-toolbox "${HOME_BIN}/" fi if ! grep -q 'Bourne-Again shell' <(file ~/.tmux/plugins/tpm/tpm); then diff --git a/alacritty/alacritty_MacOS.toml b/alacritty/alacritty_MacOS.toml deleted file mode 100644 index 10b60fb..0000000 --- a/alacritty/alacritty_MacOS.toml +++ /dev/null @@ -1,27 +0,0 @@ -live_config_reload = true - -[cursor.style] -blinking = "Always" -shape = "Beam" - -[font] -size = 14 - -[font.normal] -family = "JetBrainsMono Nerd Font Mono" - -[selection] -save_to_clipboard = true - -[window] -decorations = "full" -dynamic_padding = false -dynamic_title = false -opacity = 0.9 -startup_mode = "Maximized" - -[env] -TERM = "alacritty-direct" - -[shell] -program = "/usr/local/bin/bash" diff --git a/alacritty/alacritty_Ubuntu.toml b/alacritty/alacritty_Ubuntu.toml deleted file mode 100644 index f354150..0000000 --- a/alacritty/alacritty_Ubuntu.toml +++ /dev/null @@ -1,27 +0,0 @@ -live_config_reload = true - -[cursor.style] -blinking = "Always" -shape = "Beam" - -[font] -size = 12 - -[font.normal] -family = "JetBrainsMono Nerd Font Mono" - -[selection] -save_to_clipboard = true - -[window] -decorations = "full" -dynamic_padding = false -dynamic_title = false -opacity = 0.9 -startup_mode = "Maximized" - -[env] -TERM = "alacritty-direct" - -[shell] -program = "bash" diff --git a/bash_aliases b/bash_aliases index ae88816..614d848 100644 --- a/bash_aliases +++ b/bash_aliases @@ -6,7 +6,6 @@ alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' #alias cat='bat' -#alias ls='exa' #alias find='fd' alias ll='ls -alF' alias la='ls -A' diff --git a/default-python-packages b/default-python-packages index 3964348..db6c341 100644 --- a/default-python-packages +++ b/default-python-packages @@ -1,5 +1,6 @@ keyring poetry +pre-commit pynvim uv ruff diff --git a/mackup.cfg b/mackup.cfg index 3c63e60..b1a8c8f 100644 --- a/mackup.cfg +++ b/mackup.cfg @@ -43,7 +43,6 @@ ack adium adobe-camera-raw airmail -alacritty amethyst ancient-domains-of-mystery androidstudio-13 diff --git a/setup.sh b/setup.sh index c2a48ea..6ddf137 100755 --- a/setup.sh +++ b/setup.sh @@ -90,11 +90,6 @@ done # neovim link_if_not_exists "${GITROOT}/nvim" "${HOME}/.config/nvim" -# alacritty -link_if_not_exists "${GITROOT}/alacritty" "${HOME}/.config/alacritty" -link_if_not_exists "${HOME}/.config/alacritty/alacritty_${MACHINE_OS}.toml" "${HOME}/.config/alacritty/alacritty.toml" - - declare -a OS_SPECIFIC_LINKS=() mapfile -t OS_SPECIFIC_LINKS < <(get_os_specific_links "${MACHINE_OS}")