Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Jul 3, 2024
2 parents 4e52977 + 71e5de7 commit 5246651
Show file tree
Hide file tree
Showing 204 changed files with 987 additions and 412 deletions.
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 -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 -e btop
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/Activity.png
Categories=GTK;
StartupNotify=false
EOF
4 changes: 2 additions & 2 deletions web-apps/Basecamp.sh → applications/Basecamp.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cat <<EOF > ~/.local/share/applications/Basecamp.desktop
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
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/web-apps/icons/Basecamp.png
Icon=/home/$USER/.local/share/omakub/applications/icons/Basecamp.png
Categories=GTK;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
Expand Down
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 -e lazydocker
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/Docker.png
Categories=GTK;
StartupNotify=false
EOF
2 changes: 1 addition & 1 deletion web-apps/HEY.sh → applications/HEY.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Comment=HEY Email + Calendar
Exec=google-chrome --app="https://app.hey.com/" --name=HEY
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/web-apps/icons/HEY.png
Icon=/home/$USER/.local/share/omakub/applications/icons/HEY.png
Categories=GTK;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
Expand Down
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 -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 -e omakub
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/applications/icons/Omakub.png
Categories=GTK;
StartupNotify=false
EOF
4 changes: 2 additions & 2 deletions web-apps/WhatsApp.sh → applications/WhatsApp.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cat <<EOF > ~/.local/share/applications/WhatsApp.desktop
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
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/web-apps/icons/WhatsApp.png
Icon=/home/$USER/.local/share/omakub/applications/icons/WhatsApp.png
Categories=GTK;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
Expand Down
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.
File renamed without changes
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.
File renamed without changes
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.
File renamed without changes
12 changes: 4 additions & 8 deletions bin/omakub
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#!/bin/bash

source $OMAKUB_PATH/ascii.sh

if [ $# -eq 0 ]; then
SUB=$(gum choose "Help" "Theme" "Font" "Install" "Uninstall" "Update" --height 9 --header "" | tr '[:upper:]' '[:lower:]')
else
SUB=$1
fi

[ -n "$SUB" ] && source $OMAKUB_PATH/bin/omakub-$SUB
echo "" # Add spacing
echo " $(cat $OMAKUB_PATH/version)"
echo "" # Add spacing
source $OMAKUB_PATH/bin/omakub-sub/menu.sh
18 changes: 0 additions & 18 deletions bin/omakub-font

This file was deleted.

2 changes: 0 additions & 2 deletions bin/omakub-help

This file was deleted.

2 changes: 0 additions & 2 deletions bin/omakub-install

This file was deleted.

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
45 changes: 45 additions & 0 deletions bin/omakub-sub/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
CHOICES=(
"Dev Language Install programming language environment"
"Dev Database Install development database in Docker"
"1password Manage your passwords securely across devices"
"Brave Chrome-based browser with built-in ad blocking"
"Dropbox Sync files across computers with ease"
"OBS Studio Record screencasts with inputs from both display + webcam"
"Audacity Record and edit audio"
"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"
"Zoom Attend and host video chat meetings"
"VirtualBox Virtual machines to run Windows/Linux"
"> All Re-run any of the default installers"
"<< Back "
)

CHOICE=$(gum choose "${CHOICES[@]}" --height 17 --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 @@
google-chrome "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 -
18 changes: 18 additions & 0 deletions bin/omakub-sub/theme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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/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
45 changes: 0 additions & 45 deletions bin/omakub-theme

This file was deleted.

2 changes: 0 additions & 2 deletions bin/omakub-uninstall

This file was deleted.

3 changes: 0 additions & 3 deletions bin/omakub-update

This file was deleted.

Loading

0 comments on commit 5246651

Please sign in to comment.