Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvrajtiwary-bitmesraece committed Aug 24, 2024
0 parents commit 190aee6
Show file tree
Hide file tree
Showing 210 changed files with 2,546 additions and 0 deletions.
4 changes: 4 additions & 0 deletions EXTENSIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# [Dark and light mode theme switch](https://github.com/florentdestremau/omakub-darkmode-switch)

Select a dark and light theme of your choice to be applied automatically when switching the gnome light/dark mode.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Omakub

Turn a fresh Ubuntu installation into a fully-configured, beautiful, and modern web development system by running a single command. That's the one-line pitch for Omakub. No need to write bespoke configs for every essential tool just to get started or to be up on all the latest command-line tools. Omakub is an opinionated take on what Linux can be at its best.

Watch the introduction video and read more at [omakub.org](https://omakub.org).

## Contributing to the documentation

Please help us improve Omakub's documentation on the [basecamp/omakub-site repository](https://github.com/basecamp/omakub-site).

## License

Omakub is released under the [MIT License](https://opensource.org/licenses/MIT).

## Extras

While omakub is purposed to be an opiniated take, the open source community offers alternative customization, add-ons, extras, that you can use to adjust, replace or enrich your experience.

[⇒ Browse the omakub extensions.](EXTENSIONS.md)
12 changes: 12 additions & 0 deletions applications/About.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cat <<EOF >~/.local/share/applications/About.desktop
[Desktop Entry]
Version=1.0
Name=About
Comment=System information from Fastfetch
Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml --class=About --title=About -e bash -c 'fastfetch; read -n 1 -s'
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/Ubuntu.png
Categories=GTK;
StartupNotify=false
EOF
12 changes: 12 additions & 0 deletions applications/Activity.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cat <<EOF >~/.local/share/applications/Activity.desktop
[Desktop Entry]
Version=1.0
Name=Activity
Comment=System activity from btop
Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/btop.toml --class=Activity --title=Activity -e btop
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/Activity.png
Categories=GTK;
StartupNotify=false
EOF
13 changes: 13 additions & 0 deletions applications/Basecamp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cat <<EOF >~/.local/share/applications/Basecamp.desktop
[Desktop Entry]
Version=1.0
Name=Basecamp
Comment=Basecamp Project Management
Exec=google-chrome --app="https://launchpad.37signals.com" --name=Basecamp --class=Basecamp
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/Basecamp.png
Categories=GTK;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
EOF
12 changes: 12 additions & 0 deletions applications/Docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cat <<EOF >~/.local/share/applications/Docker.desktop
[Desktop Entry]
Version=1.0
Name=Docker
Comment=Manage Docker containers with LazyDocker
Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml --class=Docker --title=Docker -e lazydocker
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/Docker.png
Categories=GTK;
StartupNotify=false
EOF
13 changes: 13 additions & 0 deletions applications/HEY.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cat <<EOF >~/.local/share/applications/HEY.desktop
[Desktop Entry]
Version=1.0
Name=HEY
Comment=HEY Email + Calendar
Exec=google-chrome --app="https://app.hey.com/" --name=HEY --class=HEY
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/HEY.png
Categories=GTK;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
EOF
12 changes: 12 additions & 0 deletions applications/Neovim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cat <<EOF >~/.local/share/applications/Neovim.desktop
[Desktop Entry]
Version=1.0
Name=Neovim
Comment=Edit text files
Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml --class=Neovim --title=Neovim -e nvim %F
Terminal=false
Type=Application
Icon=nvim
Categories=Utilities;TextEditor;
StartupNotify=false
EOF
12 changes: 12 additions & 0 deletions applications/Omakub.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cat <<EOF >~/.local/share/applications/Omakub.desktop
[Desktop Entry]
Version=1.0
Name=Omakub
Comment=Omakub Controls
Exec=alacritty --config-file /home/$USER/.local/share/omakub/defaults/alacritty/pane.toml --class=Omakub --title=Omakub -e omakub
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/Omakub.png
Categories=GTK;
StartupNotify=false
EOF
13 changes: 13 additions & 0 deletions applications/WhatsApp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cat <<EOF >~/.local/share/applications/WhatsApp.desktop
[Desktop Entry]
Version=1.0
Name=WhatsApp
Comment=WhatsApp Messenger
Exec=google-chrome --app="https://web.whatsapp.com" --name=WhatsApp --class=Whatsapp
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/WhatsApp.png
Categories=GTK;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
EOF
Binary file added applications/icons/Activity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/icons/Basecamp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/icons/Docker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/icons/HEY.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/icons/Omakub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/icons/Ubuntu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/icons/WhatsApp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions ascii.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ascii_art='
________ __ ___.
\_____ \ _____ _____ | | ____ _\_ |__
/ | \ / \\__ \ | |/ / | \ __ \
/ | \ Y Y \/ __ \| <| | / \_\ \
\_______ /__|_| (____ /__|_ \____/|___ /
\/ \/ \/ \/ \/
'

# Define the color gradient (shades of cyan and blue)
colors=(
'\033[38;5;81m' # Cyan
'\033[38;5;75m' # Light Blue
'\033[38;5;69m' # Sky Blue
'\033[38;5;63m' # Dodger Blue
'\033[38;5;57m' # Deep Sky Blue
'\033[38;5;51m' # Cornflower Blue
'\033[38;5;45m' # Royal Blue
)

# Split the ASCII art into lines
IFS=$'\n' read -rd '' -a lines <<<"$ascii_art"

# Print each line with the corresponding color
for i in "${!lines[@]}"; do
color_index=$((i % ${#colors[@]}))
echo -e "${colors[color_index]}${lines[i]}"
done
7 changes: 7 additions & 0 deletions bin/omakub
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

source $OMAKUB_PATH/ascii.sh
echo "" # Add spacing
echo " $(cat $OMAKUB_PATH/version)"
echo "" # Add spacing
source $OMAKUB_PATH/bin/omakub-sub/menu.sh
8 changes: 8 additions & 0 deletions bin/omakub-sub/font-size.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
choice=$(gum choose {7..14} "<< Back" --height 11 --header "Choose your terminal font size")

if [[ $choice =~ ^[0-9]+$ ]]; then
sed -i "s/^size = .*$/size = $choice/g" ~/.config/alacritty/font-size.toml
source $OMAKUB_PATH/bin/omakub-sub/font-size.sh
else
source $OMAKUB_PATH/bin/omakub-sub/font.sh
fi
49 changes: 49 additions & 0 deletions bin/omakub-sub/font.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
set_font() {
local font_name=$1
local url=$2
local file_type=$3
local file_name="${font_name/ Nerd Font/}"

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 -
clear
source $OMAKUB_PATH/ascii.sh
fi

gsettings set org.gnome.desktop.interface monospace-font-name "$font_name 10"
cp "$OMAKUB_PATH/configs/alacritty/fonts/$file_name.toml" ~/.config/alacritty/font.toml
sed -i "s/\"editor.fontFamily\": \".*\"/\"editor.fontFamily\": \"$font_name\"/g" ~/.config/Code/User/settings.json
}

if [ "$#" -gt 1 ]; then
choice=${!#}
else
choice=$(gum choose "Cascadia Mono" "Fira Mono" "JetBrains Mono" "Meslo" "> Change size" "<< Back" --height 8 --header "Choose your programming font")
fi

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" "ttf"
;;
"> Change size")
source $OMAKUB_PATH/bin/omakub-sub/font-size.sh
exit
;;
esac

source $OMAKUB_PATH/bin/omakub-sub/menu.sh
47 changes: 47 additions & 0 deletions bin/omakub-sub/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
CHOICES=(
"Dev Language Install programming language environment"
"Dev Database Install development database in Docker"
"1password Manage your passwords securely across devices"
"Audacity Record and edit audio"
"Brave Chrome-based browser with built-in ad blocking"
"Doom Emacs Emacs framework with curated list of packages"
"Dropbox Sync files across computers with ease"
"OBS Studio Record screencasts with inputs from both display + webcam"
"Ollama Run LLMs, like Meta's Llama3, locally"
"RubyMine IntelliJ's commercial Ruby editor"
"Spotify Stream music from the world's most popular service"
"Steam Play games from Valve's store"
"VirtualBox Virtual machines to run Windows/Linux"
"Zed Fast all-purpose editor"
"Zoom Attend and host video chat meetings"
"> All Re-run any of the default installers"
"<< Back "
)

CHOICE=$(gum choose "${CHOICES[@]}" --height 19 --header "Install application")

if [[ "$CHOICE" == "<< Back"* ]] || [[ -z "$CHOICE" ]]; then
# Don't install anything
echo ""
elif [[ "$CHOICE" == "> All"* ]]; then
INSTALLER_FILE=$(gum file $OMAKUB_PATH/install)

[[ -n "$INSTALLER_FILE" ]] &&
gum confirm "Run installer?" &&
source $INSTALLER_FILE &&
gum spin --spinner globe --title "Install completed!" -- sleep 3
else
INSTALLER=$(echo "$CHOICE" | awk -F ' {2,}' '{print $1}' | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')

case "$INSTALLER" in
"dev-language") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/select-dev-language.sh" ;;
"dev-database") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/select-dev-storage.sh" ;;
"ollama") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/optional/app-ollama.sh" ;;
*) INSTALLER_FILE="$OMAKUB_PATH/install/desktop/optional/app-$INSTALLER.sh" ;;
esac

source $INSTALLER_FILE && gum spin --spinner globe --title "Install completed!" -- sleep 3
fi

clear
source $OMAKUB_PATH/bin/omakub
2 changes: 2 additions & 0 deletions bin/omakub-sub/manual.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
xdg-open "https://manual.omakub.org" >/dev/null
source $OMAKUB_PATH/bin/omakub-sub/menu.sh
7 changes: 7 additions & 0 deletions bin/omakub-sub/menu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if [ $# -eq 0 ]; then
SUB=$(gum choose "Theme" "Font" "Update" "Install" "Uninstall" "Manual" "Quit" --height 10 --header "" | tr '[:upper:]' '[:lower:]')
else
SUB=$1
fi

[ -n "$SUB" ] && [ "$SUB" != "quit" ] && source $OMAKUB_PATH/bin/omakub-sub/$SUB.sh
15 changes: 15 additions & 0 deletions bin/omakub-sub/migrate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cd $OMAKUB_PATH
last_updated_at=$(git log -1 --format=%cd --date=unix)
git pull

for file in $OMAKUB_PATH/migrations/*.sh; do
filename=$(basename "$file")
migrate_at="${filename%.sh}"

if [ $migrate_at -gt $last_updated_at ]; then
echo "Running migration for $migrate_at"
source $file
fi
done

cd -
19 changes: 19 additions & 0 deletions bin/omakub-sub/theme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
THEME_NAMES=("Tokyo Night" "Catppuccin" "Nord" "Everforest" "Gruvbox" "Kanagawa" "Rose Pine")
THEME=$(gum choose "${THEME_NAMES[@]}" "<< Back" --header "Choose your theme" --height 10 | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')

if [ -n "$THEME" ] && [ "$THEME" != "<<-back" ]; then
cp $OMAKUB_PATH/themes/$THEME/alacritty.toml ~/.config/alacritty/theme.toml
cp $OMAKUB_PATH/themes/$THEME/zellij.kdl ~/.config/zellij/themes/$THEME.kdl
sed -i "s/theme \".*\"/theme \"$THEME\"/g" ~/.config/zellij/config.kdl
cp $OMAKUB_PATH/themes/$THEME/neovim.lua ~/.config/nvim/lua/plugins/theme.lua

source $OMAKUB_PATH/themes/$THEME/gnome.sh
source $OMAKUB_PATH/themes/$THEME/tophat.sh
source $OMAKUB_PATH/themes/$THEME/vscode.sh

# Forgo setting the Chrome theme until we might find a less disruptive way of doing it.
# Having to quit Chrome, and all Chrome-based apps, is too much of an inposition.
# source $OMAKUB_PATH/themes/$THEME/chrome.sh
fi

source $OMAKUB_PATH/bin/omakub-sub/menu.sh
4 changes: 4 additions & 0 deletions bin/omakub-sub/uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
UNINSTALLER=$(gum file $OMAKUB_PATH/uninstall)
[ -n "$UNINSTALLER" ] && gum confirm "Run uninstaller?" && source $UNINSTALLER && gum spin --spinner globe --title "Uninstall completed!" -- sleep 3
clear
source $OMAKUB_PATH/bin/omakub
30 changes: 30 additions & 0 deletions bin/omakub-sub/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CHOICES=(
"Omakub Update Omakub itself and run any migrations"
"Ollama Run LLMs, like Meta's Llama3, locally"
"LazyGit TUI for Git"
"LazyDocker TUI for Docker"
"Neovim Text editor that runs in the terminal"
"Zellij Adds panes, tabs, and sessions to the terminal"
"<< Back "
)

CHOICE=$(gum choose "${CHOICES[@]}" --height 10 --header "Update manually-managed applications")

if [[ "$CHOICE" == "<< Back"* ]] || [[ -z "$CHOICE" ]]; then
# Don't update anything
echo ""
else
INSTALLER=$(echo "$CHOICE" | awk -F ' {2,}' '{print $1}' | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')

case "$INSTALLER" in
"omakub") INSTALLER_FILE="$OMAKUB_PATH/bin/omakub-sub/migrate.sh" ;;
"localsend") INSTALLER_FILE="$OMAKUB_PATH/install/desktop/app-localsend.sh" ;;
"ollama") INSTALLER_FILE="$OMAKUB_PATH/install/terminal/optional/app-ollama.sh" ;;
*) INSTALLER_FILE="$OMAKUB_PATH/install/terminal/app-$INSTALLER.sh" ;;
esac

source $INSTALLER_FILE && gum spin --spinner globe --title "Update completed!" -- sleep 3
fi

clear
source $OMAKUB_PATH/bin/omakub
28 changes: 28 additions & 0 deletions boot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
set -e

ascii_art='________ __ ___.
\_____ \ _____ _____ | | ____ _\_ |__
/ | \ / \\__ \ | |/ / | \ __ \
/ | \ Y Y \/ __ \| <| | / \_\ \
\_______ /__|_| (____ /__|_ \____/|___ /
\/ \/ \/ \/ \/
'

echo -e "$ascii_art"
echo "=> Omakub is for fresh Ubuntu 24.04 installations only!"
echo -e "\nBegin installation (or abort with ctrl+c)..."

sudo apt-get update >/dev/null
sudo apt-get install -y git >/dev/null

echo "Cloning Omakub..."
rm -rf ~/.local/share/omakub
git clone https://github.com/basecamp/omakub.git ~/.local/share/omakub >/dev/null
if [[ $OMAKUB_REF != "master" ]]; then
cd ~/.local/share/omakub
git fetch origin "${OMAKUB_REF:-stable}" && git checkout "${OMAKUB_REF:-stable}"
cd -
fi

echo "Installation starting..."
source ~/.local/share/omakub/install.sh
1 change: 1 addition & 0 deletions configs/alacritty.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import = [ "~/.config/alacritty/theme.toml", "~/.config/alacritty/font.toml", "~/.config/alacritty/font-size.toml", "~/.local/share/omakub/defaults/alacritty.toml" ]
3 changes: 3 additions & 0 deletions configs/alacritty/font-size.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Leave this file in place for omakub to rely on a shared font size for all terminal apps
[font]
size = 9
Loading

0 comments on commit 190aee6

Please sign in to comment.