From c0941096227ef8b8c6ac0882a9ecfefc12adcf02 Mon Sep 17 00:00:00 2001 From: Juni Kim Date: Wed, 8 Jan 2025 20:54:38 -0500 Subject: [PATCH] updated ubuntu installation scripts --- dots/alacritty_ubuntu.toml | 130 +++++++++++++++++++++++++++++++++++++ dots/catppuccin-mocha.toml | 65 +++++++++++++++++++ install_ubuntu.sh | 52 ++++++--------- scripts/cht.sh | 39 ----------- scripts/doc2pdf | 7 -- scripts/gpl | 3 - scripts/tmuxs | 70 -------------------- 7 files changed, 214 insertions(+), 152 deletions(-) create mode 100644 dots/alacritty_ubuntu.toml create mode 100644 dots/catppuccin-mocha.toml delete mode 100755 scripts/cht.sh delete mode 100755 scripts/doc2pdf delete mode 100755 scripts/gpl delete mode 100755 scripts/tmuxs diff --git a/dots/alacritty_ubuntu.toml b/dots/alacritty_ubuntu.toml new file mode 100644 index 0000000..fc8dcb8 --- /dev/null +++ b/dots/alacritty_ubuntu.toml @@ -0,0 +1,130 @@ +general.import = [ + "~/.config/alacritty/catppuccin-mocha.toml" +] + +[env] +TERM = "xterm-256color" + +[font] +size = 11.5 + +[font.bold] +family = "UbuntuMono Nerd Font" +style = "Bold" + +[font.bold_italic] +family = "UbuntuMono Nerd Font" +style = "Bold Italic" + +[font.italic] +family = "UbuntuMono Nerd Font" +style = "Italic" + +[font.normal] +family = "UbuntuMono Nerd Font" +style = "Regular" + +[font.offset] +x = 0 +y = 1 + +[[keyboard.bindings]] +action = "Paste" +key = "V" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "Copy" +key = "C" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "PasteSelection" +key = "Insert" +mods = "Shift" + +[[keyboard.bindings]] +action = "ResetFontSize" +key = "Key0" +mods = "Control" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "Equals" +mods = "Control" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "Plus" +mods = "Control" + +[[keyboard.bindings]] +action = "DecreaseFontSize" +key = "Minus" +mods = "Control" + +[[keyboard.bindings]] +action = "ToggleFullscreen" +key = "F11" +mods = "None" + +[[keyboard.bindings]] +action = "Paste" +key = "Paste" +mods = "None" + +[[keyboard.bindings]] +action = "Copy" +key = "Copy" +mods = "None" + +[[keyboard.bindings]] +action = "ClearLogNotice" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +chars = "\f" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +action = "ScrollPageUp" +key = "PageUp" +mode = "~Alt" +mods = "None" + +[[keyboard.bindings]] +action = "ScrollPageDown" +key = "PageDown" +mode = "~Alt" +mods = "None" + +[[keyboard.bindings]] +action = "ScrollToTop" +key = "Home" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollToBottom" +key = "End" +mode = "~Alt" +mods = "Shift" + +[scrolling] +history = 5000 + +[window] +decorations = "none" +dynamic_padding = false +opacity = 0.9 +title = "Alacritty" + +[window.class] +general = "Alacritty" +instance = "Alacritty" + +[window.padding] +x = 10 +y = 15 diff --git a/dots/catppuccin-mocha.toml b/dots/catppuccin-mocha.toml new file mode 100644 index 0000000..7762dcd --- /dev/null +++ b/dots/catppuccin-mocha.toml @@ -0,0 +1,65 @@ +[colors.primary] +background = "#1e1e2e" +foreground = "#cdd6f4" +dim_foreground = "#7f849c" +bright_foreground = "#cdd6f4" + +[colors.cursor] +text = "#1e1e2e" +cursor = "#f5e0dc" + +[colors.vi_mode_cursor] +text = "#1e1e2e" +cursor = "#b4befe" + +[colors.search.matches] +foreground = "#1e1e2e" +background = "#a6adc8" + +[colors.search.focused_match] +foreground = "#1e1e2e" +background = "#a6e3a1" + +[colors.footer_bar] +foreground = "#1e1e2e" +background = "#a6adc8" + +[colors.hints.start] +foreground = "#1e1e2e" +background = "#f9e2af" + +[colors.hints.end] +foreground = "#1e1e2e" +background = "#a6adc8" + +[colors.selection] +text = "#1e1e2e" +background = "#f5e0dc" + +[colors.normal] +black = "#45475a" +red = "#f38ba8" +green = "#a6e3a1" +yellow = "#f9e2af" +blue = "#89b4fa" +magenta = "#f5c2e7" +cyan = "#94e2d5" +white = "#bac2de" + +[colors.bright] +black = "#585b70" +red = "#f38ba8" +green = "#a6e3a1" +yellow = "#f9e2af" +blue = "#89b4fa" +magenta = "#f5c2e7" +cyan = "#94e2d5" +white = "#a6adc8" + +[[colors.indexed_colors]] +index = 16 +color = "#fab387" + +[[colors.indexed_colors]] +index = 17 +color = "#f5e0dc" diff --git a/install_ubuntu.sh b/install_ubuntu.sh index 07eee91..246a134 100755 --- a/install_ubuntu.sh +++ b/install_ubuntu.sh @@ -6,18 +6,21 @@ DIR="$(realpath "$(dirname "$0")")" cd "$HOME" || exit 1; dependencies() { - sudo apt update -y - sudo apt install -y make curl sudo git zip unzip || exit 1 if ! (type sudo 2>&1) > /dev/null; then echo "sudo is not installed."; exit 1 fi + sudo apt-get update -y + + sudo apt-get install -y make curl sudo git zip unzip || exit 1 + echo "Updating APT and adding PPA's" - curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - - sudo apt update -y || exit 1 + curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash - + sudo apt-get update -y || exit 1 - sudo apt install -y nodejs golang cargo tmux g++ gcc || exit 1 + sudo apt-get install -y ripgrep nodejs gcc g++ golang fzf npm\ + wget tar default-jdk tree-sitter-cli python3-venv cargo tmux zsh libfuse2 || exit 1 } sysinfo() { @@ -41,17 +44,6 @@ sysinfo() { cd "$HOME" || exit 1; } -browsers() { - sudo apt remove -y firefox - sudo snap remove firefox - # install brave - sudo apt install apt-transport-https -y - sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list - sudo apt update -y - sudo apt install brave-browser -y -} - torbrowser() { sudo apt install -y torbrowser-launcher } @@ -77,16 +69,11 @@ meetings() { # install zoom curl https://zoom.us/client/latest/zoom_amd64.deb -LJo "$HOME/repos/zoomus.deb" sudo apt install "$HOME/repos/zoomus.deb" -y - - # install mt - sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt - sudo chmod +x /usr/local/bin/mt } dotfiles() { echo "Adding zsh and tmux configs" # zsh plugins - sudo apt install -y zsh tmux shellcheck fzf export RUNZSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" @@ -104,18 +91,16 @@ dotfiles() { kill-session || exit 1 mkdir -p "$HOME/.local/bin" || exit 1 cp -r "$DIR/scripts/." "$HOME/.local/bin/" || exit 1 + go install github.com/junikimm717/tmuxs || exit 1 } neovim() { # install neovim - curl https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.deb -LJo "$HOME/repos/nvim-linux64.deb" || exit 1 - sudo apt install "$HOME/repos/nvim-linux64.deb" -y || exit 1 - sudo npm install -g tree-sitter-cli - git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim || exit 1 - git clone https://git.junickim.me/junikimm717/nvim2023 ~/.config/nvim || exit 1 - nvim -c PackerSync -c 'sleep 10' -c qa --headless - echo "sleeping to compile" - nvim -c 'sleep 60' -c qa --headless + ( + sudo curl https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -LJo /usr/bin/nvim && sudo chmod +x /usr/bin/nvim + ) || exit 1 + git clone https://github.com/junikimm717/nvim2025 ~/.config/nvim || exit 1 + nvim --headless +Lazy! sync +FullSetup +qa } neovim_fonts() { @@ -127,7 +112,8 @@ neovim_fonts() { sudo add-apt-repository ppa:aslatter/ppa -y sudo apt install alacritty -y || exit 1 mkdir -p "$HOME/.config/alacritty" || exit 1 - cp "$DIR/dots/alacritty_ubuntu.yml" "$HOME/.config/alacritty/alacritty.yml" || exit 1 + cp "$DIR/dots/alacritty_ubuntu.toml" "$HOME/.config/alacritty/alacritty.toml" || exit 1 + cp "$DIR/dots/catppuccin-mocha.toml" "$HOME/.config/alacritty/catppuccin-mocha.toml" || exit 1 } competitiveprogramming() { @@ -142,13 +128,13 @@ case "$1" in (dependencies && sysinfo && dotfiles && neovim) || exit 1 ;; graphical|g) - (dependencies && sysinfo && browsers && dotfiles && neovim && neovim_fonts && popshell) || exit 1 + (dependencies && sysinfo && dotfiles && neovim && neovim_fonts && popshell) || exit 1 ;; full|f) - (dependencies && sysinfo && browsers && torbrowser && meetings && dotfiles && neovim && neovim_fonts && popshell) || exit 1 + (dependencies && sysinfo && torbrowser && meetings && dotfiles && neovim && neovim_fonts && popshell) || exit 1 ;; cp|c) - (dependencies && sysinfo && browsers && dotfiles && neovim && neovim_fonts && competitiveprogramming && popshell) || exit 1 + (dependencies && sysinfo && dotfiles && neovim && neovim_fonts && competitiveprogramming && popshell) || exit 1 ;; *) echo "First Argument should be one of ssh, graphical, full, or cp" diff --git a/scripts/cht.sh b/scripts/cht.sh deleted file mode 100755 index 3b37128..0000000 --- a/scripts/cht.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -languages=( - "zsh" - "typescript" - "bash" - "perl" - "python" - "javascript" - "go" - "rust" -) - -utilities=( - "awk" - "sed" - "grep" - "tr" - "xargs" - "tee" -) - -SEARCHED="$( (for x in "${languages[@]}"; do - echo "$x" -done -for x in "${utilities[@]}"; do - echo "$x" -done) | fzf)" - -if test -z "$SEARCHED"; then - exit 0 -fi - -if (IFS=$'\n' echo "${languages[@]}") | grep "$SEARCHED" > /dev/null 2> /dev/null; then - read -rp "Search Query: " QUERY - curl "https://cht.sh/$SEARCHED/$QUERY" | less -else - curl "https://cht.sh/$SEARCHED" | less -fi diff --git a/scripts/doc2pdf b/scripts/doc2pdf deleted file mode 100755 index 3a94340..0000000 --- a/scripts/doc2pdf +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [ -f "$1" ]; then - libreoffice --headless --convert-to pdf "$1" && rm -rf "$1" -else - echo "$1 is not a file." && exit 1 -fi diff --git a/scripts/gpl b/scripts/gpl deleted file mode 100755 index ae0f0f8..0000000 --- a/scripts/gpl +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -curl -LJ https://www.gnu.org/licenses/gpl-3.0.md -o LICENSE.md diff --git a/scripts/tmuxs b/scripts/tmuxs deleted file mode 100755 index a1ec4f2..0000000 --- a/scripts/tmuxs +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env sh - -WORKSPACES=${WORKSPACES:-$HOME/Documents:$HOME/docs/prg} - -IFS=':' findargs=$WORKSPACES - -while test $# -gt 0; do - case "$1" in - -d|--depth) - shift - if test -z "$1"; then - echo "No appropriate option given after depth" - exit 1 - else - depth="$1" - fi - shift; - ;; - -*) - echo "Invalid option $1" - exit 1 - ;; - *) - sessiondir="$1" - shift; - ;; - esac -done - -if test -z "$sessiondir"; then - if ! test -z "$depth" && test "$depth" -eq 0; then - sessiondir="$(find $findargs\ - \! -name '*.git*'\ - \! -name '*.vscode*'\ - \! -name '*.idea*'\ - \! -name '*node_modules*'\ - \! -name '*__pycache__*'\ - \! -name '*venv*'\ - -type d 2>/dev/null | fzf)" - else - sessiondir="$(find $findargs -maxdepth ${depth:-2}\ - \! -name '*.git*'\ - \! -name '*.vscode*'\ - \! -name '*.idea*'\ - \! -name '*node_modules*'\ - \! -name '*__pycache__*'\ - \! -name '*venv*'\ - -type d 2>/dev/null | fzf)" - fi -fi - -if test -z "$sessiondir" || ! test -d "$sessiondir"; then - echo "$sessiondir is not a directory. Aborting..." - exit 0 -fi - -name="$(realpath "$sessiondir" | tr '.' '_')" - -if test -z "$TMUX" && test -z "$(pgrep tmux)"; then - tmux new-session -c "$sessiondir" -s "$name" -else - if ! tmux has-session -t="$name" 2> /dev/null; then - tmux new-session -d -c "$sessiondir" -s "$name" - fi - if test -z "$TMUX"; then - tmux attach -t "$name" - else - tmux switch-client -t "$name" - fi -fi