initial commit

This commit is contained in:
Javier Feliz 2025-07-08 21:57:02 -04:00
commit ac1fafc6fc
17 changed files with 448 additions and 0 deletions

22
justgnome.sh Executable file
View File

@ -0,0 +1,22 @@
# Loads environment variables and util functions
load_dependencies() {
# Paths to the important directories
ROOT_DIRECTORY="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Export Lib functions
set -o allexport
for f in $ROOT_DIRECTORY/lib/*; do source $f; done
set +o allexport
# Export all the variables
export ROOT_DIRECTORY
}
# What to do when the program begins
load_dependencies
sudo chmod +x ./scripts/ -R
./scripts/gnome/keybinds.sh
./scripts/gnome/extensions.sh
./scripts/gnome/misc.sh

50
lib/apt.sh Normal file
View File

@ -0,0 +1,50 @@
# Helper functions
show_spinner() {
local pid=$1
local delay=0.1
local spinstr='|/-\'
local i=0
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
# Get the current character for the spinner
printf "\b%c" "${spinstr:i++%${#spinstr}:1}"
sleep $delay
done
# Clear the spinner once the process is complete
printf "\b \b \n"
}
is_installed() {
local package="$1"
if command -v "$package" >/dev/null 2>&1; then
return 0 # success
else
return 1 # failure
fi
}
install() {
for package in $1; do
# Check if app is installed
if command -v $package >/dev/null 2>&1; then
info "$package is already installed"
continue
fi
info "Installing $package"
# Start apt in the background, suppressing all output and errors
sudo apt install -y $package >/dev/null 2>&1 &
# Capture the PID of curl
local aptPid=$!
# Show the spinner while apt is running
show_spinner $aptPid
# Wait for curl to complete
wait $aptPid
done
# Check if the download was successful
success "Done"
}

21
lib/gnome.sh Normal file
View File

@ -0,0 +1,21 @@
reservebindslots() {
local count=$1
local paths=()
for ((i = 0; i < count; i++)); do
paths+=("'\/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${i}/'")
done
local joined=$(
IFS=,
echo "[${paths[*]}]"
)
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "$joined"
}
custombind() {
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$1/ name "$2"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$1/ command "$3"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$1/ binding "$4"
}

20
lib/output.sh Normal file
View File

@ -0,0 +1,20 @@
info() {
local blue_bg="\033[44m"
local white_text="\033[97m"
local reset="\033[0m"
printf " ${blue_bg}${white_text} INFO ${reset} $1 \n"
}
success() {
local green_bg="\033[42m"
local black_text="\033[30m"
local reset="\033[0m"
printf " ${green_bg}${black_text} SUCCESS ${reset} $1 \n"
}
error() {
local red_bg="\033[41m"
local white_text="\033[97m"
local reset="\033[0m"
printf " ${red_bg}${white_text} ERROR ${reset} $1 \n"
}

7
scripts/apps/brave.sh Executable file
View File

@ -0,0 +1,7 @@
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] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update
install brave-browser

17
scripts/apps/discord.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
# DISCORD_DEB="/tmp/discord.deb"
# DISCORD_URL="https://discord.com/api/download?platform=linux&format=deb"
# info "Downloading Discord .deb package..."
# curl -L "$DISCORD_URL" -o "$DISCORD_DEB"
# info "Installing Discord..."
# sudo apt install -y "$DISCORD_DEB"
# info "Cleaning up downloaded package..."
# rm -f "$DISCORD_DEB"
sudo snap install discord
success "Discord installed successfully."

19
scripts/apps/git.sh Executable file
View File

@ -0,0 +1,19 @@
install git
git config --global user.email "javier0eduardo@hotmail.com"
git config --global user.name "Javier Feliz"
# Set up github cli and log in
if ! is_installed gh; then
sudo mkdir -p -m 755 /etc/apt/keyrings
out=$(mktemp)
wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg
cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg >/dev/null
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
sudo mkdir -p -m 755 /etc/apt/sources.list.d
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null
sudo apt update
install gh
else
success "Github CLI is already installed"
fi

View File

@ -0,0 +1 @@
curl -sS https://starship.rs/install.sh | sh

16
scripts/apps/yazi.sh Executable file
View File

@ -0,0 +1,16 @@
info "Setting up yazi"
if ! is_installed cargo; then
info "Setting up rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. "$HOME/.cargo/env"
rustup update
fi
info "Installing dependencies"
install "ffmpeg 7zip jq poppler-utils fd-find ripgrep fzf zoxide imagemagick"
if ! is_installed yazi; then
info "Installing yazi from cargo"
cargo install --locked yazi-fm yazi-cli
fi

31
scripts/dev/langs.sh Executable file
View File

@ -0,0 +1,31 @@
info "Setting up programming languages"
info "***PHP***"
info "Courtesy of php.new"
if command -v php >/dev/null 2>&1; then
info "php.new script was already ran"
else
/bin/bash -c "$(curl -fsSL https://php.new/install/linux)"
fi
install php-pgsql
install php-xml
info "Valet linux"
if command -v valet >/dev/null 2>&1; then
info "Valet linux is already installed"
else
composer global require cpriego/valet-linux
# Dependencies
install network-manager
install libnss3-tools
install jq
install xsel
valet install
fi
info "***Go***"
install golang-go
info "**NodeJS**"
install nodejs
install npm

68
scripts/gnome/extensions.sh Executable file
View File

@ -0,0 +1,68 @@
install gnome-shell-extension
install pipx
install gnome-tweaks
install gnome-extensions-app
pipx install gnome-extensions-cli --system-site-packages
# Turn off default Ubuntu extensions
gnome-extensions disable tiling-assistant@ubuntu.com
gnome-extensions disable ubuntu-appindicators@ubuntu.com
gnome-extensions disable ubuntu-dock@ubuntu.com
gnome-extensions disable ding@rastersoft.com
# Pause to assure user is ready to accept confirmations
gum confirm "To install Gnome extensions, you need to accept some confirmations. Ready?"
# Install new extensions
gext install tactile@lundal.io
gext install just-perfection-desktop@just-perfection
gext install blur-my-shell@aunetx
gext install space-bar@luchrioh
gext install undecorate@sun.wxg@gmail.com
gext install AlphabeticalAppGrid@stuarthayhurst
# Compile gsettings schemas in order to be able to set them
sudo cp ~/.local/share/gnome-shell/extensions/tactile@lundal.io/schemas/org.gnome.shell.extensions.tactile.gschema.xml /usr/share/glib-2.0/schemas/
sudo cp ~/.local/share/gnome-shell/extensions/just-perfection-desktop\@just-perfection/schemas/org.gnome.shell.extensions.just-perfection.gschema.xml /usr/share/glib-2.0/schemas/
sudo cp ~/.local/share/gnome-shell/extensions/blur-my-shell\@aunetx/schemas/org.gnome.shell.extensions.blur-my-shell.gschema.xml /usr/share/glib-2.0/schemas/
sudo cp ~/.local/share/gnome-shell/extensions/space-bar\@luchrioh/schemas/org.gnome.shell.extensions.space-bar.gschema.xml /usr/share/glib-2.0/schemas/
sudo cp ~/.local/share/gnome-shell/extensions/AlphabeticalAppGrid\@stuarthayhurst/schemas/org.gnome.shell.extensions.AlphabeticalAppGrid.gschema.xml /usr/share/glib-2.0/schemas/
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
# Configure Tactile
gsettings set org.gnome.shell.extensions.tactile col-0 1
gsettings set org.gnome.shell.extensions.tactile col-1 2
gsettings set org.gnome.shell.extensions.tactile col-2 1
gsettings set org.gnome.shell.extensions.tactile col-3 0
gsettings set org.gnome.shell.extensions.tactile row-0 1
gsettings set org.gnome.shell.extensions.tactile row-1 1
gsettings set org.gnome.shell.extensions.tactile gap-size 32
# Configure Just Perfection
gsettings set org.gnome.shell.extensions.just-perfection animation 4
gsettings set org.gnome.shell.extensions.just-perfection dash-app-running true
gsettings set org.gnome.shell.extensions.just-perfection workspace true
gsettings set org.gnome.shell.extensions.just-perfection workspace-popup false
# Configure Blur My Shell
gsettings set org.gnome.shell.extensions.blur-my-shell.appfolder blur false
gsettings set org.gnome.shell.extensions.blur-my-shell.lockscreen blur false
gsettings set org.gnome.shell.extensions.blur-my-shell.screenshot blur false
gsettings set org.gnome.shell.extensions.blur-my-shell.window-list blur false
gsettings set org.gnome.shell.extensions.blur-my-shell.panel blur false
gsettings set org.gnome.shell.extensions.blur-my-shell.overview blur true
gsettings set org.gnome.shell.extensions.blur-my-shell.overview pipeline 'pipeline_default'
gsettings set org.gnome.shell.extensions.blur-my-shell.dash-to-dock blur true
gsettings set org.gnome.shell.extensions.blur-my-shell.dash-to-dock brightness 0.6
gsettings set org.gnome.shell.extensions.blur-my-shell.dash-to-dock sigma 30
gsettings set org.gnome.shell.extensions.blur-my-shell.dash-to-dock static-blur true
gsettings set org.gnome.shell.extensions.blur-my-shell.dash-to-dock style-dash-to-dock 0
# Configure Space Bar
gsettings set org.gnome.shell.extensions.space-bar.behavior smart-workspace-names false
gsettings set org.gnome.shell.extensions.space-bar.shortcuts enable-activate-workspace-shortcuts false
gsettings set org.gnome.shell.extensions.space-bar.shortcuts enable-move-to-workspace-shortcuts true
gsettings set org.gnome.shell.extensions.space-bar.shortcuts open-menu "@as []"
# Configure AlphabeticalAppGrid
gsettings set org.gnome.shell.extensions.alphabetical-app-grid folder-order-position 'end'

56
scripts/gnome/keybinds.sh Executable file
View File

@ -0,0 +1,56 @@
# Super+c closes a window
gsettings set org.gnome.desktop.wm.keybindings close "['<Super>c']"
# Make it easy to maximize like you can fill left/right
gsettings set org.gnome.desktop.wm.keybindings maximize "['<Super>Up']"
# Full-screen with title/navigation bar
gsettings set org.gnome.desktop.wm.keybindings toggle-fullscreen "['<Shift>F11']"
# Use 6 fixed workspaces instead of dynamic mode
gsettings set org.gnome.mutter dynamic-workspaces false
gsettings set org.gnome.desktop.wm.preferences num-workspaces 6
# Unbind any existing Super+num binds
info "Unbinding any Super+N keys to use for workspaces instead"
for i in {1..9}; do
gsettings set org.gnome.shell.keybindings switch-to-application-$i "[]"
done
# Use super for workspaces
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>1']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Super>2']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Super>3']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<Super>4']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['<Super>5']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['<Super>6']"
# Set right click to resize
gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true
# Clear all existing custom keybindings
echo "Clearing existing GNOME custom keybindings..."
# Get existing keybinding paths
existing=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings)
existing=$(echo "$existing" | sed "s/^\[//;s/\]$//;s/,//g" | tr -d "'")
# Loop through each and clear its keys
for path in $existing; do
gsettings reset-recursively "org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:$path" 2>/dev/null
done
# Clear the master list
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "[]"
echo "Adding custom keybindings"
reservebindslots 8
custombind 0 'Flameshot' "sh -c -- \"flameshot gui\"" '<Control>Print'
custombind 1 'New Brave window' "brave-browser" '<Super><Shift>o'
custombind 2 'New Brave incognito window' 'brave-browser --incognito' '<Super><Shift>p'
custombind 3 'Kitty' 'kitty' '<Super>q'
custombind 4 'File Explorer' 'nautilus --new-window' '<Super>e'
custombind 5 'Project selector' 'kitty --start-as=normal -- bash -ic "proj"' '<Control><Shift>p'
custombind 6 'TODO List' 'brave-browser --new-window --app=https://do.thatshit.live' '<Control><Shift>t'
custombind 7 'ChatGPT' 'brave-browser --new-window --app=https://chatgpt.com' '<Super>Return'

5
scripts/gnome/misc.sh Executable file
View File

@ -0,0 +1,5 @@
# Set clock to 12 hour time
gsettings set org.gnome.desktop.interface clock-format '12h'
# Set timezone to EST
timedatectl set-timezone America/New_York

8
scripts/gnome/vscode.sh Executable file
View File

@ -0,0 +1,8 @@
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >/tmp/packages.microsoft.gpg
sudo install -D -o root -g root -m 644 /tmp/packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list >/dev/null
rm -f packages.microsoft.gpg
cd -
sudo apt update -y
install code

31
scripts/misc/nerd-font.sh Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
FONT_DIR="$HOME/.local/share/fonts"
FONT_FILE="$FONT_DIR/HackNerdFont-Regular.ttf"
ZIP_URL="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Hack.zip"
ZIP_DEST="/tmp/Hack.zip"
# Check if font is already installed
if [[ -f "$FONT_FILE" ]]; then
echo "Hack Nerd Font is already installed. Skipping."
exit 0
fi
echo "Hack Nerd Font not found. Proceeding with installation..."
echo "Ensuring font directory exists at $FONT_DIR"
mkdir -p "$FONT_DIR"
chmod 755 "$FONT_DIR"
echo "Downloading Hack Nerd Font zip..."
curl -L "$ZIP_URL" -o "$ZIP_DEST"
echo "Unzipping font files to $FONT_DIR..."
unzip -o "$ZIP_DEST" -d "$FONT_DIR"
echo "Refreshing font cache..."
fc-cache -fv
echo "Hack Nerd Font installed successfully."

8
scripts/misc/nvidia-drivers.sh Executable file
View File

@ -0,0 +1,8 @@
install pkg-config libglvnd-dev dkms build-essential libegl-dev libegl1
install libgl-dev libgl1 libgles-dev libgles1 libglvnd-core-dev libglx-dev libopengl-dev gcc make
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
version=$(ubuntu-drivers devices | grep "recommended" | awk '{print $3}' | grep -oP 'nvidia-driver-\K[0-9]+')
echo "Using version $version"
sudo apt install -y "nvidia-driver-$version"

68
start.sh Executable file
View File

@ -0,0 +1,68 @@
# Loads environment variables and util functions
load_dependencies() {
# Paths to the important directories
ROOT_DIRECTORY="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Export Lib functions
set -o allexport
for f in $ROOT_DIRECTORY/lib/*; do source $f; done
set +o allexport
# Export all the variables
export ROOT_DIRECTORY
}
# What to do when the program begins
load_dependencies
sudo chmod +x ./scripts/ -R
# Optional.
# ./scripts/misc/nvidia-drivers.sh
# exit
info "Apt update"
sudo apt update >/dev/null 2>&1
# Basics
install kitty
install curl
install wget
install eza
install xclip
install flameshot
./scripts/misc/nerd-font.sh
./scripts/apps/git.sh
# Basic apps
if ! is_installed brave-browser; then
./scripts/apps/brave.sh
else
success "Brave is already installed"
fi
if ! is_installed discord; then
./scripts/apps/discord.sh
else
success "Discord is already installed"
fi
if ! is_installed code; then
./scripts/apps/vscode.sh
else
success "VSCode is already installed"
fi
# Dev tools
./scripts/dev/langs.sh
./scripts/apps/yazi.sh
./scripts/apps/starship-prompt.sh
# Gnome
./scripts/gnome/keybinds.sh
./scripts/gnome/extensions.sh
./scripts/gnome/misc.sh
# Ansible
install software-properties-common
install ansible