Skip to content

Commit

Permalink
Tue Nov 12 12:52:23 PM +04 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
monoira committed Nov 12, 2024
1 parent f999de5 commit 4e8ad6b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 55 deletions.
44 changes: 19 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
- [What I keep in this repository](#what-i-keep-in-this-repository)

- [REQUIREMENTS AND REQUIRED PACKAGES](#requirements-and-required-packages)
- [What this script does](#what-this-script-does)
- [INSTALLATION](#installation)
- [Auto Installation (Recommended)](#auto-installation-recommended)
- [What this script does](#what-this-script-does)
- [Manual installation](#manual-installation)
- [Tasks you have to do manually because of certain problems](#tasks-you-have-to-do-manually-because-of-certain-problems)
- [How to uninstall](#how-to-uninstall)
Expand All @@ -20,11 +21,24 @@

## REQUIREMENTS AND REQUIRED PACKAGES

- Ubuntu or any Debian based distribution with snap and
- Ubuntu or any Debian based distribution with snapd installed + configured and
gnome desktop environment installed
- Bash (Already preinstalled on Debian based distributions)
- Git
- Wget

## What this script does

- Downloads useful and necessary apt and snap packages
- Downloads nerd font: Hack nerd font
- Downloads and compiles lazydocker
- Downloads and compiles lazygit
- Downloads vimv
- Configures gnome settings with gsettings to:
hide trash on dash-to-dock, hide home, disable notifications, etc.

And possibly more. For full info check scripts themselves.

## INSTALLATION

### Auto Installation (Recommended)

Expand All @@ -37,16 +51,6 @@ METHOD SPECIFIC REQUIREMENTS:
wget -qO- https://raw.githubusercontent.com/monoira/.dotfiles/main/start.sh | bash
```

#### What this script does

- Download useful and necessary apt and snap packages
- Download nerd font: Hack nerd font
- Download and compile lazydocker
- Download and compile lazygit
- Download vimv
- Configure gnome settings with gsettings to:
hide trash on dash-to-dock, hide home, disable notifications, etc.

When scripts finish, signaled by

<--- SYMLINKS HAVE BEEN SET. SCRIPTS ARE FINISHED. --->
Expand Down Expand Up @@ -77,16 +81,6 @@ After which run this script: [install.sh](./install.sh) like this:
bash ~/.dotfiles/install.sh
```

To automate following tasks:

- Download useful and necessary apt and snap packages
- Download nerd font: Hack nerd font
- Download and compile lazydocker
- Download and compile lazygit
- Download vimv
- Configure gnome settings with gsettings to:
hide trash on dash-to-dock, hide home, disable notifications, etc.

Then Run this script [create_symlinks.sh](./create_symlinks.sh) to create
and spread around dotfile symlinks like this:

Expand Down Expand Up @@ -127,8 +121,8 @@ Being echoed in terminal, reboot your system.
wget -qO- https://raw.githubusercontent.com/monoira/.dotfiles/main/uninstall.sh | bash
```

note: this will only remove config files & directories, Not Programs installed.
Warning: this will remove AKA rm -rf
NOTE: this will only remove config files & directories, Not Programs installed.
WARNING: this will remove AKA rm -rf

~/.bashrc
~/.zshrc
Expand Down
76 changes: 46 additions & 30 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

# NOTE: apt packages
sudo apt update -y && sudo apt upgrade -y
sudo apt install -y curl
sudo apt install -y curl # for lasygit AND lazydocker
sudo apt install -y wget # for dbeaver AND install_nerd_font()
sudo apt install -y fontconfig # for install_nerd_font()
sudo apt install -y build-essential
sudo apt install -y git
sudo apt install -y python3
Expand All @@ -29,7 +31,7 @@ sudo apt install -y xclip
# clipboard for - wayland
sudo apt install -y wl-clipboard

# general packages
# NOTE: general use apt packages
sudo apt install -y screenfetch
sudo apt install -y cmatrix
sudo apt install -y htop
Expand All @@ -43,6 +45,10 @@ sudo apt install -y strawberry
sudo apt install -y rclone
sudo apt install -y rclone-browser

# NOTE: snaps packages
sudo snap install figma-linux
sudo snap install postman

# snaps that need --classic flag.
sudo snap install --classic nvim

Expand Down Expand Up @@ -100,43 +106,53 @@ cd -
cargo install vimv
sudo ln -sf ~/.cargo/bin/vimv /bin/vimv

# NOTE: nerd font installation
nerd_font_name="Hack"
# NOTE: install nerd font automated installation function

# first and only argument: name of the nerd font that is inside ryanoasis/nerd-fonts repository on github.
# WARN: make sure you check and write font name in right case. In case of "Hack" nerd font:
# GOOD: Hack
# BAD: hack
install_nerd_font() {
nerd_font_name=$1

# Check if the font is already installed
nerd_font_check=$(fc-list : family | sort | uniq | grep "$nerd_font_name")

# Check if the font is already installed
nerd_font_check=$(fc-list : family | sort | uniq | grep "$nerd_font_name")
# If the nerd font is not installed, runs the following script
if [ -z "$nerd_font_check" ]; then
# Create a temporary directory
TEMP_FONT_DIR=$(mktemp --directory)

# If the nerd font is not installed, run the script
if [ -z "$nerd_font_check" ]; then
# Create a temporary directory
TEMP_FONT_DIR=$(mktemp --directory)
nerd_fonts_repo_url="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$nerd_font_name.zip"

nerd_fonts_repo_url="https://github.com/ryanoasis/nerd-fonts/releases/latest/download/$nerd_font_name.zip"
# download the font zip file
wget -O "$TEMP_FONT_DIR/font.zip" "$nerd_fonts_repo_url"

# download the font zip file
wget -O "$TEMP_FONT_DIR/font.zip" "$nerd_fonts_repo_url"
# unzip the font file
unzip "$TEMP_FONT_DIR/font.zip" -d "$TEMP_FONT_DIR"

# unzip the font file
unzip "$TEMP_FONT_DIR/font.zip" -d "$TEMP_FONT_DIR"
# create system fonts directory if it doesn't already exists
sudo mkdir -p /usr/local/share/fonts/

# create system fonts directory if it doesn't already exists
sudo mkdir -p /usr/local/share/fonts/
# move the font files to the system fonts directory
# NOTE: I am repeating code instead of using *.{otf,ttf,woff,woff2} because *.{otf,ttf,woff,woff2} is not
# supported in sh. I try to make THIS FILE sh compatible.
sudo mv "$TEMP_FONT_DIR"/*.otf /usr/local/share/fonts/
sudo mv "$TEMP_FONT_DIR"/*.ttf /usr/local/share/fonts/
sudo mv "$TEMP_FONT_DIR"/*.woff /usr/local/share/fonts/
sudo mv "$TEMP_FONT_DIR"/*.woff2 /usr/local/share/fonts/

# move the font files to the system fonts directory
# BUG: fix/DRY later. for now I will just repeat same code. for some reason *.{otf,ttf,woff,woff2} didn't worked.
sudo mv "$TEMP_FONT_DIR"/*.otf /usr/local/share/fonts/
sudo mv "$TEMP_FONT_DIR"/*.ttf /usr/local/share/fonts/
sudo mv "$TEMP_FONT_DIR"/*.woff /usr/local/share/fonts/
sudo mv "$TEMP_FONT_DIR"/*.woff2 /usr/local/share/fonts/
# update the font cache
fc-cache -f -v

# update the font cache
fc-cache -f -v
# clean up temporary directory
sudo rm -rf "$TEMP_FONT_DIR"
else
echo "$nerd_font_name is already installed."
fi
}

# clean up temporary directory
sudo rm -rf "$TEMP_FONT_DIR"
else
echo "$nerd_font_name is already installed."
fi
install_nerd_font "Hack"

# NOTE: autoremoving packages that are no longer needed
sudo apt autoremove -y
Expand Down

0 comments on commit 4e8ad6b

Please sign in to comment.