Skip to content

Commit

Permalink
Merge branch 'master' into fresh-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh authored Jun 11, 2024
2 parents 8eb712e + 78944be commit 88ffdeb
Show file tree
Hide file tree
Showing 24 changed files with 103 additions and 57 deletions.
54 changes: 40 additions & 14 deletions bin/omakub-font
Original file line number Diff line number Diff line change
@@ -1,18 +1,44 @@
# Pick a preconfigured theme
FONT=$(gum choose "Cascadia Mono" "Fira Mono" "JetBrains Mono" "Meslo" --header "Choose your programming font:" --height 6 | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')
set_font() {
local font_name=$1
local url=$2
local file_type=$3
local file_name="${font_name/ Nerd Font/}"

[ ! -n "$FONT" ] && exit 0
if ! $(fc-list | grep -i "$font_name" > /dev/null); then
cd /tmp
wget -O "$file_name.zip" "$url"
unzip "$file_name.zip" -d "$file_name"
cp "$file_name"/*."$file_type" ~/.local/share/fonts
rm -rf "$file_name.zip" "$file_name"
fc-cache
cd -
fi

if [ "$FONT" == "cascadia-mono" ]; then
NERD_FONT="CaskaydiaMono Nerd Font"
elif [ "$FONT" == "fira-mono" ]; then
NERD_FONT="FiraMono Nerd Font"
elif [ "$FONT" == "jetbrains-mono" ]; then
NERD_FONT="JetBrainsMono NFM"
elif [ "$FONT" == "meslo" ]; then
NERD_FONT="MesloLGLDZ Nerd Font"
gsettings set org.gnome.desktop.interface monospace-font-name "$font_name 10"
cp "$OMAKUB_PATH/fonts/alacritty/$file_name.toml" ~/.config/alacritty/font.toml
sed -i "s/\"editor.fontFamily\": \".*\"/\"editor.fontFamily\": \"$font_name\"/g" ~/.config/Code/User/settings.json
}

if [ "$#" -gt 0 ]; then
choice=${!#}
else
choice=$(gum choose "Cascadia Mono" "Fira Mono" "JetBrains Mono" "Meslo" --height 6)
fi

gsettings set org.gnome.desktop.interface monospace-font-name "$NERD_FONT 10"
cp $OMAKUB_PATH/fonts/alacritty/$FONT.toml ~/.config/alacritty/font.toml
sed -i "s/\"editor.fontFamily\": \".*\"/\"editor.fontFamily\": \"$NERD_FONT\"/g" ~/.config/Code/User/settings.json
case $choice in
"Cascadia Mono")
set_font "CaskaydiaMono Nerd Font" "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CascadiaMono.zip" "ttf"
;;
"Fira Mono")
set_font "FiraMono Nerd Font" "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraMono.zip" "otf"
;;
"JetBrains Mono")
set_font "JetBrainsMono Nerd Font" "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip" "ttf"
;;
"Meslo")
set_font "MesloLGS Nerd Font" "https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip" "Meslo" "ttf"
;;
* )
exit 0
;;
esac
1 change: 1 addition & 0 deletions configs/zellij.kdl
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
theme "tokyo-night"
default_layout "compact"
on_force_close "quit"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Be fancy
source ~/.local/share/omakub/ascii.sh

# Exit immediately if a command exits with a non-zero status
set -e

Expand Down
2 changes: 1 addition & 1 deletion install/app-1password.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd ~/Downloads
cd /tmp
wget https://downloads.1password.com/linux/debian/amd64/stable/1password-latest.deb
sudo apt install -y ./1password-latest.deb
rm 1password-latest.deb
Expand Down
2 changes: 1 addition & 1 deletion install/app-chrome.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd ~/Downloads
cd /tmp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
Expand Down
3 changes: 3 additions & 0 deletions install/app-fastfetch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sudo add-apt-repository ppa:zhangsongcui3371/fastfetch
sudo apt update
sudo apt install -y fastfetch
2 changes: 1 addition & 1 deletion install/app-gum.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Gum is used for the Omakub commands for tailoring Omakub after the initial install
cd ~/Downloads
cd /tmp
GUM_VERSION="0.14.1" # Use known good version
wget -O gum.deb "https://github.com/charmbracelet/gum/releases/latest/download/gum_${GUM_VERSION}_amd64.deb"
sudo apt install -y ./gum.deb
Expand Down
2 changes: 1 addition & 1 deletion install/app-lazydocker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd ~/Downloads
cd /tmp
LAZYDOCKER_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazydocker/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_x86_64.tar.gz"
tar -xf lazydocker.tar.gz lazydocker
Expand Down
2 changes: 1 addition & 1 deletion install/app-lazygit.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd ~/Downloads
cd /tmp
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar -xf lazygit.tar.gz lazygit
Expand Down
2 changes: 1 addition & 1 deletion install/app-localsend.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd ~/Downloads
cd /tmp
LOCALSEND_VERSION=$(curl -s "https://api.github.com/repos/localsend/localsend/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
wget -O localsend.deb "https://github.com/localsend/localsend/releases/latest/download/LocalSend-${LOCALSEND_VERSION}-linux-x86-64.deb"
sudo apt install -y ./localsend.deb
Expand Down
2 changes: 0 additions & 2 deletions install/app-neovim.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
sudo add-apt-repository -y ppa:neovim-ppa/stable
sudo apt update
sudo apt install -y neovim

if [ ! -d "$HOME/.config/nvim" ]; then
Expand Down
2 changes: 1 addition & 1 deletion install/app-vscode.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd ~/Downloads
cd /tmp
wget -O code.deb 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64'
sudo apt install -y ./code.deb
rm code.deb
Expand Down
2 changes: 1 addition & 1 deletion install/app-zellij.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd ~/Downloads
cd /tmp
wget -O zellij.tar.gz "https://github.com/zellij-org/zellij/releases/latest/download/zellij-x86_64-unknown-linux-musl.tar.gz"
tar -xf zellij.tar.gz zellij
sudo install zellij /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion install/app-zoom.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd ~/Downloads
cd /tmp
wget https://zoom.us/client/latest/zoom_amd64.deb
sudo apt install -y ./zoom_amd64.deb
rm zoom_amd64.deb
Expand Down
10 changes: 5 additions & 5 deletions install/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ sudo usermod -aG docker ${USER}
# Limit log size to avoid running out of disk
echo '{"log-driver":"json-file","log-opts":{"max-size":"10m","max-file":"5"}}' | sudo tee /etc/docker/daemon.json > /dev/null


# Default containers
sudo docker create --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8.4
sudo docker create --restart unless-stopped -p "127.0.0.1:6379:6379" --name=redis redis:7
sudo docker create --restart unless-stopped -p "127.0.0.1:5432:5432" --name=postgres16 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:16
DOCKER_COMPOSE_VERSION="2.27.0"
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -sSL https://github.com/docker/compose/releases/download/v$DOCKER_COMPOSE_VERSION/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
23 changes: 4 additions & 19 deletions install/fonts.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
mkdir -p ~/.local/share/fonts

cd ~/Downloads
cd /tmp
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CascadiaMono.zip
unzip CascadiaMono.zip -d CascadiaFont
cp CascadiaFont/*.ttf ~/.local/share/fonts
rm -rf CascadiaMono.zip CascadiaFont

wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraMono.zip
unzip FiraMono.zip -d FiraMono
cp FiraMono/*.otf ~/.local/share/fonts
rm -rf FiraMono.zip FiraMono

wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip
unzip JetBrainsMono.zip -d JetBrainsMono
cp JetBrainsMono/*.ttf ~/.local/share/fonts
rm -rf JetBrainsMono.zip JetBrainsMono

wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip
unzip Meslo.zip -d Meslo
cp Meslo/*.ttf ~/.local/share/fonts
rm -rf Meslo.zip Meslo

wget https://github.com/iaolo/iA-Fonts/archive/refs/heads/master.zip
unzip master.zip -d iaFonts
wget -O iafonts.zip https://github.com/iaolo/iA-Fonts/archive/refs/heads/master.zip
unzip iafonts.zip -d iaFonts
cp iaFonts/iA-Fonts-master/iA\ Writer\ Mono/Static/iAWriterMonoS-*.ttf ~/.local/share/fonts
rm -rf master.zip iaFonts
rm -rf iafonts.zip iaFonts

fc-cache
cd -
Expand Down
5 changes: 0 additions & 5 deletions install/mise.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,3 @@ wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
sudo apt update
sudo apt install -y mise

# Install default languages
mise use --global [email protected]
mise use --global node@lts
mise use --global go@latest
39 changes: 39 additions & 0 deletions install/select-dev-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Install default programming languages
languages=$(gum choose "Ruby" "Node.js" "Go" "Python" "Java" --no-limit --selected "Ruby","Node.js" --height 7 --header "Select programming languages")

for language in $languages; do
case $language in
Ruby)
mise use --global [email protected]
;;
Node.js)
mise use --global node@lts
;;
Go)
mise use --global go@latest
;;
Java)
mise use --global java@latest
;;
Python)
mise use --global python@latest
;;
esac
done

# Install default databases
dbs=$(gum choose "MySQL" "Redis" "PostgreSQL" --no-limit --selected "MySQL","Redis" --height 5 --header "Select databases (runs in Docker)")

for db in $dbs; do
case $db in
MySQL)
sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8.4
;;
Redis)
sudo docker run -d --restart unless-stopped -p "127.0.0.1:6379:6379" --name=redis redis:7
;;
PostgreSQL)
sudo docker run -d --restart unless-stopped -p "127.0.0.1:5432:5432" --name=postgres16 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:16
;;
esac
done
1 change: 1 addition & 0 deletions install/set-gnome-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ gext install [email protected]
gext install just-perfection-desktop@just-perfection
gext install blur-my-shell@aunetx
gext install space-bar@luchrioh
gext install [email protected]@gmail.com

# Compile gsettings schemas in order to be able to set them
sudo cp ~/.local/share/gnome-shell/extensions/[email protected]/schemas/org.gnome.shell.extensions.tactile.gschema.xml /usr/share/glib-2.0/schemas/
Expand Down
1 change: 1 addition & 0 deletions uninstall/app-fastfetch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sudo apt remove -y fastfetch

0 comments on commit 88ffdeb

Please sign in to comment.