diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..625c576e5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf +charset = utf-8 diff --git a/applications/desktop/Docker.desktop b/applications/desktop/Docker.desktop deleted file mode 100644 index 72e17e6d1..000000000 --- a/applications/desktop/Docker.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=Docker -Comment=Manage Docker containers with LazyDocker -Exec=alacritty --class=Docker --title=Docker -e lazydocker -Terminal=false -Type=Application -Icon=Docker -Categories=GTK; -StartupNotify=false - diff --git a/applications/desktop/icons/ChatGPT.png b/applications/desktop/icons/ChatGPT.png new file mode 100644 index 000000000..9907eaf82 Binary files /dev/null and b/applications/desktop/icons/ChatGPT.png differ diff --git a/applications/desktop/icons/GitHub.png b/applications/desktop/icons/GitHub.png new file mode 100644 index 000000000..5a4295c24 Binary files /dev/null and b/applications/desktop/icons/GitHub.png differ diff --git a/applications/desktop/icons/Omakub.png b/applications/desktop/icons/Omakub.png old mode 100644 new mode 100755 index bd3635729..b72a25c41 Binary files a/applications/desktop/icons/Omakub.png and b/applications/desktop/icons/Omakub.png differ diff --git a/applications/desktop/icons/WhatsApp.png b/applications/desktop/icons/WhatsApp.png new file mode 100644 index 000000000..10ecdfb5f Binary files /dev/null and b/applications/desktop/icons/WhatsApp.png differ diff --git a/applications/desktop/icons/X.png b/applications/desktop/icons/X.png new file mode 100644 index 000000000..22fe6987a Binary files /dev/null and b/applications/desktop/icons/X.png differ diff --git a/applications/desktop/icons/YouTube.png b/applications/desktop/icons/YouTube.png new file mode 100644 index 000000000..46ed4ca78 Binary files /dev/null and b/applications/desktop/icons/YouTube.png differ diff --git a/applications/install/cursor.sh b/applications/install/cursor.sh index e251e7082..771b3429e 100644 --- a/applications/install/cursor.sh +++ b/applications/install/cursor.sh @@ -14,7 +14,7 @@ sudo bash -c "cat > $DESKTOP_FILE" </dev/null <<'EOF' } EOF +# Expose systemd-resolved to our Docker network +sudo mkdir -p /etc/systemd/resolved.conf.d +echo -e '[Resolve]\nDNSStubListenerExtra=172.17.0.1' | sudo tee /etc/systemd/resolved.conf.d/20-docker-dns.conf >/dev/null +sudo systemctl restart systemd-resolved + # Start Docker automatically sudo systemctl enable docker diff --git a/applications/install/dropbox.sh b/applications/install/dropbox.sh index 7cf0d9a8e..254340994 100644 --- a/applications/install/dropbox.sh +++ b/applications/install/dropbox.sh @@ -1,4 +1,3 @@ #!/bin/bash -# Sync files across machines using https://dropbox.com sudo apt install -y nautilus-dropbox >/dev/null diff --git a/applications/install/firefox.sh b/applications/install/firefox.sh index 65aa1683e..a5082e440 100644 --- a/applications/install/firefox.sh +++ b/applications/install/firefox.sh @@ -1,10 +1,11 @@ #!/bin/bash -# Install latest version of Firefox https://www.mozilla.org/firefox/ +# Check if the Mozilla PPA is already added if ! grep -q "^deb .*\bmozillateam/ppa\b" /etc/apt/sources.list /etc/apt/sources.list.d/* 2>/dev/null; then sudo add-apt-repository -y ppa:mozillateam/ppa fi +# Create or update the APT preferences file to prioritize Mozilla packages if [ ! -f /etc/apt/preferences.d/mozilla ]; then sudo tee /etc/apt/preferences.d/mozilla > /dev/null < ~/.config/xdg-terminals.list \ No newline at end of file diff --git a/applications/install/libreoffice.sh b/applications/install/libreoffice.sh index a4cfcf522..f11dc27b9 100644 --- a/applications/install/libreoffice.sh +++ b/applications/install/libreoffice.sh @@ -1,4 +1,3 @@ #!/bin/bash -# Work with Word, Excel, Powerpoint files sudo apt install -y libreoffice \ No newline at end of file diff --git a/applications/install/neovim.sh b/applications/install/neovim.sh index 8f484b237..cbd9edb6c 100644 --- a/applications/install/neovim.sh +++ b/applications/install/neovim.sh @@ -1,23 +1,20 @@ #!/bin/bash -if ! command -v nvim &>/dev/null; then - # Install Neovim - cd /tmp - wget -O nvim.tar.gz "https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.tar.gz" - tar -xf nvim.tar.gz - sudo install nvim-linux-x86_64/bin/nvim /usr/local/bin/nvim - sudo cp -R nvim-linux-x86_64/lib /usr/local/ - sudo cp -R nvim-linux-x86_64/share /usr/local/ - rm -rf nvim-linux-x86_64 nvim.tar.gz - cd - +cd /tmp +wget -O nvim.tar.gz "https://github.com/neovim/neovim/releases/download/stable/nvim-linux-x86_64.tar.gz" +tar -xf nvim.tar.gz +sudo install nvim-linux-x86_64/bin/nvim /usr/local/bin/nvim +sudo cp -R nvim-linux-x86_64/lib /usr/local/ +sudo cp -R nvim-linux-x86_64/share /usr/local/ +rm -rf nvim-linux-x86_64 nvim.tar.gz +cd - - # Install luarocks and tree-sitter-cli to resolve lazyvim :checkhealth warnings - sudo apt install -y luarocks tree-sitter-cli +# Install luarocks and tree-sitter-cli to resolve lazyvim :checkhealth warnings +sudo apt install -y luarocks tree-sitter-cli - # Use LazyVim - rm -rf ~/.config/nvim - git clone https://github.com/LazyVim/starter ~/.config/nvim - cp -R ~/.local/share/omakub/config/nvim/* ~/.config/nvim/ - rm -rf ~/.config/nvim/.git - echo "vim.opt.relativenumber = false" >>~/.config/nvim/lua/config/options.lua -fi \ No newline at end of file +# Use LazyVim +rm -rf ~/.config/nvim +git clone https://github.com/LazyVim/starter ~/.config/nvim +cp -R ~/.local/share/omakub/config/nvim/* ~/.config/nvim/ +rm -rf ~/.config/nvim/.git +echo "vim.opt.relativenumber = false" >>~/.config/nvim/lua/config/options.lua \ No newline at end of file diff --git a/applications/install/obs-studio.sh b/applications/install/obs-studio.sh index dbdadc20c..b19a568fb 100644 --- a/applications/install/obs-studio.sh +++ b/applications/install/obs-studio.sh @@ -1,4 +1,3 @@ #!/bin/bash -# OBS Studio is a screen recording application that allows you to capture both display and webcam in the same recording sudo apt install -y obs-studio diff --git a/applications/install/obsidian.sh b/applications/install/obsidian.sh index 90c127572..5a5f5db65 100644 --- a/applications/install/obsidian.sh +++ b/applications/install/obsidian.sh @@ -1,5 +1,4 @@ #!/bin/bash -# Obsidian is a multi-platform note taking application. See https://obsidian.md gum spin --spinner meter --title "Obsidian installation about to start. It may take up to 20 minutes on some systems!" -- sleep 3 flatpak install -y flathub md.obsidian.Obsidian diff --git a/applications/install/signal.sh b/applications/install/signal.sh index be1637c5a..70626a267 100644 --- a/applications/install/signal.sh +++ b/applications/install/signal.sh @@ -1,9 +1,10 @@ #!/bin/bash -wget -qO- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor >signal-desktop-keyring.gpg -cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg >/dev/null -echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' | - sudo tee /etc/apt/sources.list.d/signal-xenial.list + +wget -O- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > signal-desktop-keyring.gpg; +cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg > /dev/null +wget -O signal-desktop.sources https://updates.signal.org/static/desktop/apt/signal-desktop.sources; +cat signal-desktop.sources | sudo tee /etc/apt/sources.list.d/signal-desktop.sources > /dev/null rm signal-desktop-keyring.gpg sudo apt update sudo apt install -y signal-desktop diff --git a/applications/install/spotify.sh b/applications/install/spotify.sh index 020763d2f..f3cacd731 100644 --- a/applications/install/spotify.sh +++ b/applications/install/spotify.sh @@ -1,6 +1,5 @@ #!/bin/bash -# Stream music using https://spotify.com curl -sS https://download.spotify.com/debian/pubkey_C85668DF69375001.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg echo "deb [signed-by=/etc/apt/trusted.gpg.d/spotify.gpg] https://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list sudo apt update -y diff --git a/applications/install/starship.sh b/applications/install/starship.sh index 580bea891..dcc63cce1 100644 --- a/applications/install/starship.sh +++ b/applications/install/starship.sh @@ -1,4 +1,3 @@ #!/bin/bash -# Install Starship curl -sS https://starship.rs/install.sh | sh -s -- -y \ No newline at end of file diff --git a/applications/install/steam.sh b/applications/install/steam.sh index f47477742..d0239e1a4 100755 --- a/applications/install/steam.sh +++ b/applications/install/steam.sh @@ -1,6 +1,5 @@ #!/bin/bash -# Play games from https://store.steampowered.com/ cd /tmp wget https://cdn.akamai.steamstatic.com/client/installer/steam.deb sudo apt install -y ./steam.deb diff --git a/applications/install/typora.sh b/applications/install/typora.sh index 232cf62d9..92bb7942c 100644 --- a/applications/install/typora.sh +++ b/applications/install/typora.sh @@ -1,15 +1,5 @@ #!/bin/bash -# Temporarily switch away from using Typora repo which is broken. -# -# wget -qO - https://typora.io/linux/public-key.asc | sudo tee /etc/apt/trusted.gpg.d/typora.asc >/dev/null || true -# -# sudo add-apt-repository -y 'deb https://typora.io/linux ./' -# sudo add-apt-repository -y 'deb https://typora.io/linux ./' -# sudo apt update -y -# sudo apt install -y typora - -# Install with db cd /tmp wget -O typora.deb "https://downloads.typora.io/linux/typora_1.10.8_amd64.deb" sudo apt install -y /tmp/typora.deb diff --git a/applications/install/visual-studio-code.sh b/applications/install/visual-studio-code.sh index ffe1df759..cc274270b 100644 --- a/applications/install/visual-studio-code.sh +++ b/applications/install/visual-studio-code.sh @@ -1,11 +1,13 @@ #!/bin/bash -cd /tmp -wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >packages.microsoft.gpg -sudo install -D -o root -g root -m 644 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 - +if [ ! -f /etc/apt/keyrings/packages.microsoft.gpg ] || [ ! -f /usr/share/keyrings/microsoft.gpg ]; then + cd /tmp + wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >packages.microsoft.gpg + sudo install -D -o root -g root -m 644 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 - +fi sudo apt update -y sudo apt install -y code \ No newline at end of file diff --git a/applications/install/vlc.sh b/applications/install/vlc.sh deleted file mode 100644 index 40d9fefb0..000000000 --- a/applications/install/vlc.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -sudo apt install -y vlc diff --git a/applications/install/zen.sh b/applications/install/zen.sh new file mode 100644 index 000000000..e3eabd442 --- /dev/null +++ b/applications/install/zen.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +cd /tmp +curl -s https://updates.zen-browser.app/install.sh -o zen-install.sh 2>/dev/null +chmod +x zen-install.sh 2>/dev/null +bash zen-install.sh >/dev/null 2>&1 +rm -f zen-install.sh 2>/dev/null +cd - \ No newline at end of file diff --git a/applications/install/zoom.sh b/applications/install/zoom.sh index 4e240f908..0b6ca92b6 100644 --- a/applications/install/zoom.sh +++ b/applications/install/zoom.sh @@ -1,6 +1,5 @@ #!/bin/bash -# Make video calls using https://zoom.us/ cd /tmp wget https://zoom.us/client/latest/zoom_amd64.deb sudo apt install -y ./zoom_amd64.deb diff --git a/applications/remove/1password.sh b/applications/remove/1password.sh index 234d8fbee..f57f0b9a6 100755 --- a/applications/remove/1password.sh +++ b/applications/remove/1password.sh @@ -4,4 +4,4 @@ sudo rm /etc/apt/sources.list.d/1password.list sudo rm /usr/share/keyrings/1password-archive-keyring.gpg sudo rm /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg sudo rm -r /etc/debsig/policies/AC2D62742012EA22/ -sudo apt-get remove --purge -y 1password 1password-cli +sudo apt remove --purge -y 1password 1password-cli diff --git a/applications/remove/kitty.sh b/applications/remove/kitty.sh new file mode 100644 index 000000000..99f91e8ac --- /dev/null +++ b/applications/remove/kitty.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Kitty terminal installation script removal +rm -rf ~/.local/kitty.app +rm -f ~/.local/bin/kitty +rm -f ~/.local/bin/kitten +rm -f ~/.local/share/applications/kitty.desktop +rm -f ~/.local/share/applications/kitty-open.desktop +rm -f ~/.config/xdg-terminals.list \ No newline at end of file diff --git a/applications/remove/libreoffice.sh b/applications/remove/libreoffice.sh index 2e578c41e..5745e37d9 100644 --- a/applications/remove/libreoffice.sh +++ b/applications/remove/libreoffice.sh @@ -1,5 +1,5 @@ #!/bin/bash -sudo apt-get remove --purge -y "libreoffice*" -sudo apt-get -y clean -sudo apt-get -y autoremove \ No newline at end of file +sudo apt remove --purge -y "libreoffice*" +sudo apt -y clean +sudo apt -y autoremove \ No newline at end of file diff --git a/applications/remove/neovim.sh b/applications/remove/neovim.sh index 7d1d62152..5ccba919d 100644 --- a/applications/remove/neovim.sh +++ b/applications/remove/neovim.sh @@ -1,7 +1,7 @@ #!/bin/bash -sudo apt purge -y neovim neovim-runtime -rm ~/.local/share/applications/Neovim.desktop +sudo rm /usr/local/bin/nvim +sudo rm -r /usr/local/share/nvim/ rm -rf ~/.config/nvim rm -rf ~/.local/share/nvim rm -rf ~/.local/state/nvim diff --git a/applications/remove/vlc.sh b/applications/remove/vlc.sh deleted file mode 100644 index 44e52edfb..000000000 --- a/applications/remove/vlc.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -sudo apt remove -y vlc diff --git a/applications/remove/zen.sh b/applications/remove/zen.sh new file mode 100644 index 000000000..35e4ab613 --- /dev/null +++ b/applications/remove/zen.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sudo apt purge -y zen \ No newline at end of file diff --git a/bin/omakub-app-folder-add b/bin/omakub-app-folder-add index 93c1fa0fd..6b24c2c90 100755 --- a/bin/omakub-app-folder-add +++ b/bin/omakub-app-folder-add @@ -3,6 +3,8 @@ # omakub-app-folder-add: Move a .desktop file to a specified app folder. # Usage: omakub-app-folder-add +DESKTOP_DIR="$HOME/.local/share/applications" + if [ "$#" -ne 2 ]; then echo -e "\e[32mLet's add an app to a folder in the app grid!\n\e[0m" DESKTOP_FILE=$(gum input --prompt "Name> " --placeholder "A desktop file app (e.g., Spotify.desktop, no full path!)") @@ -17,18 +19,50 @@ if [[ -z "$DESKTOP_FILE" || -z "$FOLDER_NAME" ]]; then exit 1 fi -if ! locate "$DESKTOP_FILE" &> /dev/null; then +if [ ! -f "$DESKTOP_DIR/$DESKTOP_FILE" ]; then echo "Desktop file '$DESKTOP_FILE' not found!" exit 1 fi -# Convert to lowercase immediately for consistency -FOLDER=$(echo "$FOLDER_NAME" | tr -d ' ' | tr '[:upper:]' '[:lower:]') -SCHEMA="org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/$FOLDER/" +# Get current folders list CURRENT_FOLDERS=$(gsettings get org.gnome.desktop.app-folders folder-children) -# Check if folder exists using the lowercase version -if [[ "$CURRENT_FOLDERS" != *"'$FOLDER'"* ]]; then +# Convert to different formats for checking +FOLDER_LOWERCASE=$(echo "$FOLDER_NAME" | tr -d ' ' | tr '[:upper:]' '[:lower:]') +FOLDER_CAMELCASE=$(echo "$FOLDER_NAME" | tr -d ' ') + +# Check if folder exists (try exact name, camelcase, then lowercase) +EXISTING_FOLDER="" +if [[ "$CURRENT_FOLDERS" == *"'$FOLDER_NAME'"* ]]; then + # Exact name match - use original name for schema + EXISTING_FOLDER="$FOLDER_NAME" + FOLDER="$FOLDER_NAME" +elif [[ "$CURRENT_FOLDERS" == *"'$FOLDER_CAMELCASE'"* ]]; then + # CamelCase match (like "WebApps") - use camelcase for schema + EXISTING_FOLDER="$FOLDER_CAMELCASE" + FOLDER="$FOLDER_CAMELCASE" +elif [[ "$CURRENT_FOLDERS" == *"'$FOLDER_LOWERCASE'"* ]]; then + # Lowercase match - use lowercase for schema + EXISTING_FOLDER="$FOLDER_LOWERCASE" + FOLDER="$FOLDER_LOWERCASE" +else + # No existing folder - will create new one with lowercase schema + FOLDER="$FOLDER_LOWERCASE" +fi + +# Set schema and display name based on whether folder exists +if [ -n "$EXISTING_FOLDER" ]; then + # Use existing folder + SCHEMA="org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/$FOLDER/" + FOLDER_DISPLAY_NAME=$(gsettings get "$SCHEMA" name | sed 's/^.\(.*\).$/\1/') +else + # Create new folder + SCHEMA="org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/$FOLDER/" + FOLDER_DISPLAY_NAME="$FOLDER_NAME" +fi + +# Check if we need to create a new folder +if [ -z "$EXISTING_FOLDER" ]; then # Create new folder TRIMMED_FOLDERS=$(echo "$CURRENT_FOLDERS" | sed "s/^\[//;s/\]$//") @@ -38,10 +72,8 @@ if [[ "$CURRENT_FOLDERS" != *"'$FOLDER'"* ]]; then gsettings set org.gnome.desktop.app-folders folder-children "['$FOLDER']" fi - gsettings set "$SCHEMA" name "$FOLDER_NAME" + gsettings set "$SCHEMA" name "$FOLDER_DISPLAY_NAME" gsettings set "$SCHEMA" apps "['$DESKTOP_FILE']" - - echo -e "Created folder '$FOLDER_NAME' and added app '$DESKTOP_FILE' to it\n" else # Add app to existing folder CURRENT_APPS=$(gsettings get "$SCHEMA" apps) @@ -53,9 +85,5 @@ else else gsettings set "$SCHEMA" apps "['$DESKTOP_FILE']" fi - - echo -e "App '$DESKTOP_FILE' has been added to folder '$FOLDER_NAME'\n" - else - echo -e "App '$DESKTOP_FILE' is already in folder '$FOLDER_NAME'\n" fi fi \ No newline at end of file diff --git a/bin/omakub-app-folder-remove b/bin/omakub-app-folder-remove index 164a407c2..07145013c 100755 --- a/bin/omakub-app-folder-remove +++ b/bin/omakub-app-folder-remove @@ -3,6 +3,8 @@ # omakub-app-folder-remove: Remove an app from a specified folder. # Usage: omakub-app-folder-remove +DESKTOP_DIR="$HOME/.local/share/applications" + if [ "$#" -ne 2 ]; then echo -e "\e[32mLet's remove an app from a folder in the app grid!\n\e[0m" DESKTOP_FILE=$(gum input --prompt "Name> " --placeholder "A desktop file app (e.g., Spotify.desktop, no full path!)") @@ -17,21 +19,44 @@ if [[ -z "$DESKTOP_FILE" || -z "$FOLDER_NAME" ]]; then exit 1 fi -if ! locate "$DESKTOP_FILE" &> /dev/null; then +if [ ! -f "$DESKTOP_DIR/$DESKTOP_FILE" ]; then echo "Desktop file '$DESKTOP_FILE' not found!" exit 1 fi -FOLDER=$(echo "$FOLDER_NAME" | tr -d ' ' | tr '[:upper:]' '[:lower:]') -SCHEMA="org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/$FOLDER/" +# Get current folders list +CURRENT_FOLDERS=$(gsettings get org.gnome.desktop.app-folders folder-children) + +# Convert to different formats for checking +FOLDER_LOWERCASE=$(echo "$FOLDER_NAME" | tr -d ' ' | tr '[:upper:]' '[:lower:]') +FOLDER_CAMELCASE=$(echo "$FOLDER_NAME" | tr -d ' ') + +# Check if folder exists (try exact name, camelcase, then lowercase) +EXISTING_FOLDER="" +if [[ "$CURRENT_FOLDERS" == *"'$FOLDER_NAME'"* ]]; then + # Exact name match - use original name for schema + EXISTING_FOLDER="$FOLDER_NAME" + FOLDER="$FOLDER_NAME" +elif [[ "$CURRENT_FOLDERS" == *"'$FOLDER_CAMELCASE'"* ]]; then + # CamelCase match (like "WebApps") - use camelcase for schema + EXISTING_FOLDER="$FOLDER_CAMELCASE" + FOLDER="$FOLDER_CAMELCASE" +elif [[ "$CURRENT_FOLDERS" == *"'$FOLDER_LOWERCASE'"* ]]; then + # Lowercase match - use lowercase for schema + EXISTING_FOLDER="$FOLDER_LOWERCASE" + FOLDER="$FOLDER_LOWERCASE" +fi # Check if folder exists -CURRENT_FOLDERS=$(gsettings get org.gnome.desktop.app-folders folder-children) -if [[ "$CURRENT_FOLDERS" != *"'$FOLDER'"* ]]; then +if [ -z "$EXISTING_FOLDER" ]; then echo "Folder '$FOLDER_NAME' does not exist!" return 1 fi +# Set schema and get display name +SCHEMA="org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/$FOLDER/" +FOLDER_DISPLAY_NAME=$(gsettings get "$SCHEMA" name | sed 's/^.\(.*\).$/\1/') + CURRENT_APPS=$(gsettings get "$SCHEMA" apps) # Check if app exists in folder @@ -77,15 +102,13 @@ if [[ "$CURRENT_APPS" == *"$DESKTOP_FILE"* ]]; then gsettings set org.gnome.desktop.app-folders folder-children "[$FOLDER_LIST]" fi - echo -e "Removed app '$DESKTOP_FILE' and deleted empty folder '$FOLDER_NAME'\n" else # Update apps list NEW_LIST=$(IFS=, ; echo "${NEW_APPS[*]}") gsettings set "$SCHEMA" apps "[$NEW_LIST]" - echo -e "Removed app '$DESKTOP_FILE' from folder '$FOLDER_NAME'\n" fi else - echo "App '$DESKTOP_FILE' is not in folder '$FOLDER_NAME'" + echo "App '$DESKTOP_FILE' is not in folder '$FOLDER_DISPLAY_NAME'" return 1 fi diff --git a/bin/omakub-cmd-missing b/bin/omakub-cmd-missing new file mode 100755 index 000000000..4658d37ba --- /dev/null +++ b/bin/omakub-cmd-missing @@ -0,0 +1,9 @@ +#!/bin/bash + +for cmd in "$@"; do + if ! command -v "$cmd" &>/dev/null; then + exit 0 + fi +done + +exit 1 diff --git a/bin/omakub-cmd-present b/bin/omakub-cmd-present new file mode 100755 index 000000000..fecdc9435 --- /dev/null +++ b/bin/omakub-cmd-present @@ -0,0 +1,7 @@ +#!/bin/bash + +for cmd in "$@"; do + command -v "$cmd" &>/dev/null || exit 1 +done + +exit 0 diff --git a/bin/omakub-dev-add-migration b/bin/omakub-dev-add-migration index cd579c046..82fe65b13 100755 --- a/bin/omakub-dev-add-migration +++ b/bin/omakub-dev-add-migration @@ -3,4 +3,4 @@ cd ~/.local/share/omakub migration_file="$HOME/.local/share/omakub/migrations/$(git log -1 --format=%cd --date=unix).sh" touch $migration_file -nvim $migration_file +$EDITOR $migration_file diff --git a/bin/omakub-font-set b/bin/omakub-font-set index 59de449a6..9b9eac1be 100755 --- a/bin/omakub-font-set +++ b/bin/omakub-font-set @@ -4,7 +4,16 @@ font_name="$1" if [[ -n "$font_name" && "$font_name" != "CNCLD" ]]; then if fc-list | grep -iq "$font_name"; then - sed -i "s/family = \".*\"/family = \"$font_name\"/g" ~/.config/alacritty/alacritty.toml + if [[ -f ~/.config/alacritty/alacritty.toml ]]; then + sed -i "s/family = \".*\"/family = \"$font_name\"/g" ~/.config/alacritty/alacritty.toml + fi + + if [[ -f ~/.config/kitty/kitty.conf ]]; then + sed -i "s/^font_family .*/font_family $font_name/g" ~/.config/kitty/kitty.conf + pkill -USR1 kitty + fi + + omakub-hook font-set "$font_name" else echo "Font '$font_name' not found." exit 1 diff --git a/bin/omakub-hook b/bin/omakub-hook new file mode 100755 index 000000000..bd90a8536 --- /dev/null +++ b/bin/omakub-hook @@ -0,0 +1,14 @@ +#!/bin/bash + +if [[ $# -lt 1 ]]; then + echo "Usage: omakub-hook [name] [args...]" + exit 1 +fi + +HOOK=$1 +HOOK_PATH="$HOME/.config/omakub/hooks/$1" +shift + +if [[ -f $HOOK_PATH ]]; then + bash "$HOOK_PATH" "$@" +fi diff --git a/bin/omakub-install-chromium-google-account b/bin/omakub-install-chromium-google-account new file mode 100755 index 000000000..5087cee8a --- /dev/null +++ b/bin/omakub-install-chromium-google-account @@ -0,0 +1,13 @@ +#!/bin/bash + +if [[ -f ~/.config/chromium-flags.conf ]]; then + CONF=~/.config/chromium-flags.conf + + grep -qxF -- "--oauth2-client-id=77185425430.apps.googleusercontent.com" "$CONF" || + echo "--oauth2-client-id=77185425430.apps.googleusercontent.com" >>"$CONF" + + grep -qxF -- "--oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT" "$CONF" || + echo "--oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT" >>"$CONF" + + echo "Now you can login to your Google Account in Chromium." +fi diff --git a/bin/omakub-install-docker-dbs b/bin/omakub-install-docker-dbs index f7b624ad3..5ed8c61a3 100755 --- a/bin/omakub-install-docker-dbs +++ b/bin/omakub-install-docker-dbs @@ -1,6 +1,6 @@ #!/bin/bash -options=("MySQL" "PostgreSQL" "Redis" "MongoDB" "MariaDB") +options=("MySQL" "PostgreSQL" "Redis" "MongoDB" "MariaDB" "MSSQL") if [[ "$#" -eq 0 ]]; then choices=$(printf "%s\n" "${options[@]}" | gum choose --header "Select databases (space to select, return to install, esc to cancel)") || main_menu @@ -16,6 +16,7 @@ if [[ -n "$choices" ]]; then MariaDB) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mariadb11 -e MARIADB_ROOT_PASSWORD= -e MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=true mariadb:11.8 ;; Redis) sudo docker run -d --restart unless-stopped -p "127.0.0.1:6379:6379" --name=redis redis:7 ;; MongoDB) sudo docker run -d --restart unless-stopped -p "127.0.0.1:27017:27017" --name mongodb -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin123 mongo:noble ;; + MSSQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:1433:1433" --name mssql -e MSSQL_PID=Developer -e ACCEPT_EULA=Y -e "MSSQL_SA_PASSWORD=@dmin123" mcr.microsoft.com/mssql/server:2022-CU12-ubuntu-22.04 ;; esac done else diff --git a/bin/omakub-install-terminal b/bin/omakub-install-terminal new file mode 100755 index 000000000..ee35564d4 --- /dev/null +++ b/bin/omakub-install-terminal @@ -0,0 +1,24 @@ +#!/bin/bash + +if (($# == 0)); then + echo "Usage: omakub-install-terminal [alacritty|kitty]" + exit 1 +fi + +package="$1" + +# Install package +omakub-app-install "$package" + +# Set as default terminal +echo "Setting $package as new default terminal..." +# If TERMINAL export exists in .bashrc, replace it. Otherwise, append it. +if ! grep -q "export TERMINAL=" ~/.bashrc; then + echo "export TERMINAL=$package" >> ~/.bashrc +else + sed -i "/export TERMINAL=/ c\export TERMINAL=$package" ~/.bashrc +fi + +# Restart is needed for new default to take effect +echo +gum confirm "Restart to use new terminal?" && systemctl reboot --no-wall diff --git a/bin/omakub-keybinding-add b/bin/omakub-keybinding-add new file mode 100755 index 000000000..c1ada3bb9 --- /dev/null +++ b/bin/omakub-keybinding-add @@ -0,0 +1,62 @@ +#!/bin/bash + +# omakub-keybinding-add: Create a custom keybinding. +# Usage: omakub-keybinding-add + +if [ "$#" -lt 3 ]; then + echo -e "\e[32mLet's create a new custom keybinding.\n\e[0m" + KB_NAME=$(gum input --prompt "Name> " --placeholder "My Custom Shortcut") + KB_COMMAND=$(gum input --prompt "Command> " --placeholder "gnome-terminal") + KB_BINDING=$(gum input --prompt "Keybinding> " --placeholder "t") + INTERACTIVE_MODE=true +else + KB_NAME="$1" + KB_COMMAND="$2" + KB_BINDING="$3" + INTERACTIVE_MODE=false +fi + +# Ensure valid parameters +if [[ -z "$KB_NAME" || -z "$KB_COMMAND" || -z "$KB_BINDING" ]]; then + echo "You must set name, command, and keybinding!" + exit 1 +fi + +# Get current custom keybindings +CURRENT_BINDINGS=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings) + +# Find next available index +if [[ "$CURRENT_BINDINGS" == "@as []" || "$CURRENT_BINDINGS" == "[]" ]]; then + # No existing keybindings + NEXT_INDEX=0 + NEW_BINDINGS="['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']" +else + # Extract existing indices + INDICES=$(echo "$CURRENT_BINDINGS" | grep -oP 'custom\K[0-9]+' | sort -n) + + if [[ -z "$INDICES" ]]; then + NEXT_INDEX=0 + else + LAST_INDEX=$(echo "$INDICES" | tail -1) + NEXT_INDEX=$((LAST_INDEX + 1)) + fi + + # Build new bindings array by appending to existing + NEW_PATH="'/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${NEXT_INDEX}/'" + # Remove trailing ] and add new path with ] + NEW_BINDINGS="${CURRENT_BINDINGS%]}, $NEW_PATH]" +fi + +# Set the new custom keybindings array +gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "$NEW_BINDINGS" + +# Configure the new keybinding +BASE_PATH="org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${NEXT_INDEX}/" + +gsettings set "${BASE_PATH}" name "$KB_NAME" +gsettings set "${BASE_PATH}" command "$KB_COMMAND" +gsettings set "${BASE_PATH}" binding "$KB_BINDING" + +if [[ $INTERACTIVE_MODE == true ]]; then + echo -e "Keybinding created successfully!\n" +fi \ No newline at end of file diff --git a/bin/omakub-keybinding-remove b/bin/omakub-keybinding-remove new file mode 100755 index 000000000..707118c15 --- /dev/null +++ b/bin/omakub-keybinding-remove @@ -0,0 +1,110 @@ +#!/bin/bash + +# omakub-keybinding-remove: Remove a custom keybinding. +# Usage: omakub-keybinding-remove + +# Get current custom keybindings +CURRENT_BINDINGS=$(gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings) + +# Check if there are any keybindings +if [[ "$CURRENT_BINDINGS" == "@as []" || "$CURRENT_BINDINGS" == "[]" ]]; then + echo "No custom keybindings found." + exit 1 +fi + +# Extract all custom indices +INDICES=$(echo "$CURRENT_BINDINGS" | grep -oP 'custom\K[0-9]+' | sort -n) + +if [[ -z "$INDICES" ]]; then + echo "No custom keybindings found." + exit 1 +fi + +if [ "$#" -eq 0 ]; then + # Build array of keybindings with their details + declare -a KB_OPTIONS + for index in $INDICES; do + BASE_PATH="org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${index}/" + KB_NAME=$(gsettings get "${BASE_PATH}" name 2>/dev/null | tr -d "'") + KB_BINDING=$(gsettings get "${BASE_PATH}" binding 2>/dev/null | tr -d "'") + + if [[ -n "$KB_NAME" ]]; then + KB_OPTIONS+=("${index}|${KB_NAME} (${KB_BINDING})") + fi + done + + if ((${#KB_OPTIONS[@]})); then + IFS=$'\n' SORTED_OPTIONS=($(sort -t'|' -k2 <<<"${KB_OPTIONS[*]}")) + unset IFS + + # Format for display (remove index from display) + DISPLAY_OPTIONS=() + for option in "${SORTED_OPTIONS[@]}"; do + DISPLAY_OPTIONS+=("${option#*|}") + done + + SELECTED_STRING=$(gum choose --no-limit --header "Select keybindings to remove..." --selected-prefix="✗ " "${DISPLAY_OPTIONS[@]}") + + # Extract indices from selected options + SELECTED_INDICES=() + while IFS= read -r line; do + if [[ -n "$line" ]]; then + # Find the original option with index + for option in "${SORTED_OPTIONS[@]}"; do + if [[ "${option#*|}" == "$line" ]]; then + SELECTED_INDICES+=("${option%%|*}") + break + fi + done + fi + done <<< "$SELECTED_STRING" + else + echo "No keybindings found." + exit 1 + fi +else + # Use provided indices + SELECTED_INDICES=("$@") +fi + +if [[ ${#SELECTED_INDICES[@]} -eq 0 ]]; then + echo "No keybindings selected." + exit 1 +fi + +# Remove selected keybindings +for index in "${SELECTED_INDICES[@]}"; do + BASE_PATH="org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${index}/" + KB_NAME=$(gsettings get "${BASE_PATH}" name 2>/dev/null | tr -d "'") + + # Clear the keybinding settings + gsettings reset "${BASE_PATH}" name 2>/dev/null + gsettings reset "${BASE_PATH}" command 2>/dev/null + gsettings reset "${BASE_PATH}" binding 2>/dev/null + + echo "✗ Removed: $KB_NAME (custom${index})" +done + +# Rebuild the custom-keybindings array without removed indices +NEW_PATHS=() +for index in $INDICES; do + # Check if this index was not selected for removal + SHOULD_KEEP=true + for selected in "${SELECTED_INDICES[@]}"; do + if [[ "$index" == "$selected" ]]; then + SHOULD_KEEP=false + break + fi + done + + if [[ "$SHOULD_KEEP" == true ]]; then + NEW_PATHS+=("'/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom${index}/'") + fi +done + +# Update the custom-keybindings array +if [[ ${#NEW_PATHS[@]} -eq 0 ]]; then + gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "[]" +else + gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "[$(IFS=,; echo "${NEW_PATHS[*]}")]" +fi \ No newline at end of file diff --git a/bin/omakub-launch-about b/bin/omakub-launch-about new file mode 100755 index 000000000..ded1bab8d --- /dev/null +++ b/bin/omakub-launch-about @@ -0,0 +1,3 @@ +#!/bin/bash + +exec alacritty --class=Omakub -o font.size=9 -e bash -c 'fastfetch; read -n 1 -s' diff --git a/bin/omakub-launch-browser b/bin/omakub-launch-browser new file mode 100755 index 000000000..cff9f46f8 --- /dev/null +++ b/bin/omakub-launch-browser @@ -0,0 +1,14 @@ +#!/bin/bash + +default_browser=$(xdg-settings get default-web-browser) +browser_exec=$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$default_browser 2>/dev/null | head -1) + +if [[ $browser_exec =~ (firefox|zen|librewolf) ]]; then + private_flag="--private-window" + new_window_flag="--new-window" +else + private_flag="--incognito" + new_window_flag="--new-window" +fi + +exec "$browser_exec" "${@/--private/$private_flag}" diff --git a/bin/omakub-launch-editor b/bin/omakub-launch-editor new file mode 100755 index 000000000..6e73d5c8c --- /dev/null +++ b/bin/omakub-launch-editor @@ -0,0 +1,10 @@ +#!/bin/bash + +case "${EDITOR:-nvim}" in +nvim | vim | nano | micro | hx | helix) + exec "$TERMINAL" -e "$EDITOR" "$@" + ;; +*) + exec "$EDITOR" "$@" + ;; +esac diff --git a/bin/omakub-launch-terminal b/bin/omakub-launch-terminal new file mode 100755 index 000000000..db72ce20c --- /dev/null +++ b/bin/omakub-launch-terminal @@ -0,0 +1,3 @@ +#!/bin/bash + +exec ${OMAKUB_TERMINAL:-alacritty} diff --git a/bin/omakub-launch-terminal-with-presentation b/bin/omakub-launch-terminal-with-presentation index ae07ac5bb..097be42eb 100755 --- a/bin/omakub-launch-terminal-with-presentation +++ b/bin/omakub-launch-terminal-with-presentation @@ -1,4 +1,4 @@ #!/bin/bash cmd="$*" -alacritty --class Omakub -e bash -c -l "omakub-show-logo; $cmd; omakub-show-done" +alacritty -o font.size=9 --class Omakub -e bash -c "omakub-show-logo; $cmd; omakub-show-done" diff --git a/bin/omakub-launch-webapp b/bin/omakub-launch-webapp index 10cc6c3c3..62b808b3c 100755 --- a/bin/omakub-launch-webapp +++ b/bin/omakub-launch-webapp @@ -9,19 +9,25 @@ fi APP_URL="$1" APP_NAME="$2" +APP_ID=$(echo "$APP_NAME" | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') + # This prevents data loss and force to open in a separate profile OMAKUB_DATA_DIR="$HOME/.config/omakub/webapp" WEBAPP_DATA_DIR="$OMAKUB_DATA_DIR/$(echo "$APP_NAME" | tr ' ' '-' | tr '[:upper:]' '[:lower:]')" +if [ ! -d "$WEBAPP_DATA_DIR" ]; then + mkdir -p "$WEBAPP_DATA_DIR" +fi browser=$(xdg-settings get default-web-browser) - case $browser in -google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi*) ;; +google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi* | helium-browser*) ;; *) browser="chromium.desktop" ;; esac +browser_exec=$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1) -if [ ! -d "$WEBAPP_DATA_DIR" ]; then - mkdir -p "$WEBAPP_DATA_DIR" -fi - -exec $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1) --user-data-dir="$WEBAPP_DATA_DIR" --window-size=800,600 --app="$APP_URL" --name="$APP_NAME" --class="$APP_NAME" +exec "$browser_exec" \ + --user-data-dir="$WEBAPP_DATA_DIR" \ + --window-size=800,600 \ + --app="$APP_URL" \ + --class="$APP_ID" \ + --name="$APP_NAME" diff --git a/bin/omakub-menu b/bin/omakub-menu index c562badee..4db38fe16 100755 --- a/bin/omakub-menu +++ b/bin/omakub-menu @@ -8,7 +8,7 @@ BACK_TO_EXIT=false back_to() { local parent_menu="$1" - if [[ "$DIRECT_ACCESS" == "true" ]]; then + if [[ "$BACK_TO_EXIT" == "true" ]]; then exit 0 elif [[ -n "$parent_menu" ]]; then "$parent_menu" @@ -35,7 +35,7 @@ menu() { --allow-markup \ --prompt "$prompt..." \ "${args[@]}" \ - "$wofi_options" 2>>/tmp/omakub.log) + "$wofi_options" 2>>/dev/null) echo -e "$selection" } @@ -48,21 +48,25 @@ present_terminal() { omakub-launch-terminal-with-presentation "$@" } -edit_in_nvim() { +open_in_editor() { notify-send "Editing config file" "$1" - alacritty -e nvim "$1" + omakub-launch-editor "$1" } -app_install() { +install_app() { present_terminal "echo 'Installing $1...'; omakub-app-install $1" } -app_remove() { +install_terminal() { + present_terminal "omakub-install-terminal $1" +} + +remove_app() { present_terminal "echo 'Removing $1...'; omakub-app-remove $1" } show_learn_menu() { - case $(menu "Learn" " Keybindings\n Omakub\n Ubuntu\n Neovim\n Zellij\n󱆃 Bash" "--width 250 --height 300") in + case $(menu "Learn" " Keybindings\n Omakub\n Ubuntu\n Neovim\n Zellij\n󱆃 Bash" "--width 250 --height 280") in *Keybindings*) omakub-launch-webapp "https://learn.omacom.io/1/read/29/hotkeys" "Omakub Keybindings" ;; *Omakub*) omakub-launch-webapp "https://learn.omacom.io/1/read#leaf_40" "Omakub" ;; *Ubuntu*) omakub-launch-webapp "https://help.ubuntu.com/" "Ubuntu" ;; @@ -74,7 +78,7 @@ show_learn_menu() { } show_style_menu() { - case $(menu "Style" "󰸌 Theme\n Font\n Background" "--width 250 --height 250") in + case $(menu "Style" "󰸌 Theme\n Font\n Background" "--width 250 --height 180") in *Theme*) show_theme_menu ;; *Font*) show_font_menu ;; *Background*) omakub-theme-bg-next ;; @@ -83,7 +87,7 @@ show_style_menu() { } show_theme_menu() { - theme=$(menu "Theme" "$(omakub-theme-list)" "--width 250 --height 400 -O alphabetical" "$(omakub-theme-current)") + theme=$(menu "Theme" "$(omakub-theme-list)" "--width 250 --height 470 -O alphabetical" "$(omakub-theme-current)") if [[ "$theme" == "CNCLD" || -z "$theme" ]]; then back_to show_style_menu else @@ -92,7 +96,7 @@ show_theme_menu() { } show_font_menu() { - case $(menu "Font" " Family\n󰧴 Size" "--width 200 --height 200") in + case $(menu "Font" " Family\n󰧴 Size" "--width 250 --height 130") in *Family*) show_font_family_menu ;; *Size*) present_terminal omakub-font-size-set ;; *) show_main_menu ;; @@ -109,97 +113,106 @@ show_font_family_menu() { } show_setup_menu() { - case $(menu "Setup" " Folders\n Starship\n Zellij\n󰌧 Wofi" "--width 250 --height 300") in + case $(menu "Setup" " Folders\n Keybindings\n Starship\n Zellij\n󰌧 Wofi\n󰞅 XCompose" "--width 250 --height 280") in *Folders*) show_setup_folders_menu ;; + *Keybindings*) show_setup_keybindings_menu ;; *Starship*) edit_in_nvim ~/.config/starship.toml ;; *Zellij*) edit_in_nvim ~/.config/zellij/config.kdl ;; *Wofi*) edit_in_nvim ~/.config/wofi/config ;; + *XCompose*) open_in_editor ~/.XCompose && omakub-restart-xcompose ;; *) show_main_menu ;; esac } show_setup_folders_menu() { - case $(menu "Folders" "󰮝 Add\n󰮞 Remove" "--width 200 --height 200") in + case $(menu "Folders" "󰮝 Add\n󰮞 Remove" "--width 250 --height 120") in *Add*) present_terminal omakub-app-folder-add ;; *Remove*) present_terminal omakub-app-folder-remove ;; *) show_setup_menu ;; esac } +show_setup_keybindings_menu() { + case $(menu "Keybindings" " Add\n Remove" "--width 250 --height 120") in + *Add*) present_terminal omakub-keybinding-add ;; + *Remove*) present_terminal omakub-keybinding-remove ;; + *) show_setup_menu ;; + esac +} + show_install_menu() { - case $(menu "Install" " Web App\n TUI\n Tools\n Style\n Service\n󰵮 Development\n Editor\n󱚤 AI\n Gaming" "--width 250 --height 500") in + case $(menu "Install" " Web App\n TUI\n Service\n Browser\n Utility\n Style\n󰵮 Development\n Editor\n Terminal\n󱚤 AI\n Gaming" "--width 250 --height 470") in *Web*) present_terminal omakub-webapp-install ;; *TUI*) present_terminal omakub-tui-install ;; - *Tools*) show_install_tools_menu ;; - *Style*) show_install_style_menu ;; *Service*) show_install_service_menu ;; + *Browser*) show_install_browser_menu ;; + *Utility*) show_install_utility_menu ;; + *Style*) show_install_style_menu ;; *Development*) show_install_development_menu ;; *Editor*) show_install_editor_menu ;; + *Terminal*) show_install_terminal_menu ;; + *AI*) show_install_ai_menu ;; *Gaming*) show_install_gaming_menu ;; *) show_main_menu ;; esac } -show_install_tools_menu() { - case $(menu "Install" " ASDControl\n Flameshot\n Pinta\n Starship\n Virtualbox\n󰕼 VLC\n Xournalpp" "--width 250 --height 450") in - *ASDControl*) app_install "asdcontrol" ;; - *Flameshot*) app_install "flameshot" ;; - *Pinta*) app_install "pinta" ;; - *Xournalpp*) app_install "xournalpp" ;; - *Virtualbox*) app_install "virtualbox" ;; - *Starship*) app_install "starship" ;; - *VLC*) app_install "vlc" ;; +show_install_service_menu() { + case $(menu "Install" " 1password\n Audacity\n Discord\n Dropbox\n GeekBench\n Gimp\n LibreOffice\n LocalSend\n Obsidian\n Signal\n Spotify\n Typora\n Tailscale\n Virtualbox\n Zoom" "--width 250 --height 600") in + *1password*) install_app "1password" ;; + *Audacity*) install_app "audacity" ;; + *Discord*) install_app "discord" ;; + *Dropbox*) install_app "dropbox" ;; + *GeekBench*) install_app "geekbench" ;; + *Gimp*) install_app "gimp" ;; + *LibreOffice*) install_app "libreoffice" ;; + *LocalSend*) install_app "localsend" ;; + *Obsidian*) install_app "obsidian" ;; + *Signal*) install_app "signal" ;; + *Spotify*) install_app "spotify" ;; + *Typora*) install_app "typora" ;; + *Tailscale*) install_app "tailscale" ;; + *Virtualbox*) install_app "virtualbox" ;; + *Zoom*) install_app "zoom" ;; *) show_install_menu ;; esac } -show_install_service_menu() { - case $(menu "Install" " 1password\n Audacity\n Brave\n Chromium\n Discord\n Dropbox\n Firefox\n GeekBench\n Gimp\n LibreOffice\n LocalSend\n Obsidian\n Signal\n Spotify\n Typora\n Tailscale\n Zoom" "--width 250 --height 750") in - *1password*) app_install "1password" ;; - *Audacity*) app_install "audacity" ;; - *Chromium*) app_install "chromium" ;; - *Brave*) app_install "brave" ;; - *Discord*) app_install "discord" ;; - *Dropbox*) app_install "dropbox" ;; - *Firefox*) app_install "firefox" ;; - *GeekBench*) app_install "geekbench" ;; - *Gimp*) app_install "gimp" ;; - *LibreOffice*) app_install "libreoffice" ;; - *LocalSend*) app_install "localsend" ;; - *Obsidian*) app_install "obsidian" ;; - *Signal*) app_install "signal" ;; - *Spotify*) app_install "spotify" ;; - *Typora*) app_install "typora" ;; - *Tailscale*) app_install "tailscale" ;; - *Zoom*) app_install "zoom" ;; +show_install_browser_menu() { + case $(menu "Install" " Brave\n Chromium\n Firefox\n Zen" "--width 250 --height 210") in + *Brave*) install_app "brave" ;; + *Chromium*) install_app "chromium" ;; + *Firefox*) install_app "firefox" ;; + *Zen*) install_app "zen" ;; *) show_install_menu ;; esac } -show_install_editor_menu() { - case $(menu "Install" " NeoVim\n VSCode\n Cursor\n Zed\n Emacs" "--width 250 --height 350") in - *VSCode*) app_install "visual-studio-code" ;; - *NeoVim*) app_install "neovim" ;; - *Cursor*) app_install "cursor" ;; - *Zed*) app_install "zed" ;; - *Emacs*) app_install "doom-emacs" ;; +show_install_utility_menu() { + case $(menu "Install" " ASDControl\n Flameshot\n Pinta\n Starship\n Xournalpp" "--width 250 --height 250") in + *ASDControl*) install_app "asdcontrol" ;; + *Flameshot*) install_app "flameshot" ;; + *Pinta*) install_app "pinta" ;; + *Starship*) install_app "starship" ;; + *Xournalpp*) install_app "xournalpp" ;; *) show_install_menu ;; esac } -show_install_ai_menu() { - case $(menu "Install" "󱚤 Ollama" "--width 200 --height 200") in - *Ollama*) app_install "ollama" ;; +show_install_style_menu() { + case $(menu "Install" "󰸌 Theme\n Background" "--width 250 --height 130") in + *Theme*) present_terminal omakub-theme-install ;; + *Background*) nautilus ~/.config/omakub/current/theme/backgrounds ;; *) show_install_menu ;; esac } show_install_development_menu() { - case $(menu "Install" " Docker\n󱘲 Databases\n Github\n Gitlab\n󰫏 Ruby on Rails\n JavaScript\n Go\n PHP\n Python\n Elixir\n Zig\n Rust\n Java\n .NET\n OCaml\n Clojure" "--width 250 --height 700") in - *Docker*) app_install "docker" ;; + case $(menu "Install" " Docker\n󱘲 Databases\n Github\n Gitlab\n󰫏 Ruby on Rails\n JavaScript\n Go\n PHP\n Python\n Elixir\n Zig\n Rust\n Java\n .NET\n OCaml\n Clojure" "--width 250 --height 600") in + *Docker*) install_app "docker" ;; *Databases*) present_terminal "omakub-install-docker-dbs" ;; - *Github*) app_install "github-cli" ;; - *Gitlab*) app_install "gitlab-cli" ;; + *Github*) install_app "github-cli" ;; + *Gitlab*) install_app "gitlab-cli" ;; *Rails*) present_terminal "omakub-install-dev-env ruby" ;; *JavaScript*) show_install_javascript_menu ;; *Go*) present_terminal "omakub-install-dev-env go" ;; @@ -217,7 +230,7 @@ show_install_development_menu() { } show_install_javascript_menu() { - case $(menu "Install" " Node.js\n Bun\n Deno") in + case $(menu "Install" " Node.js\n Bun\n Deno" "--width 250 --height 170") in *Node*) present_terminal "omakub-install-dev-env node" ;; *Bun*) present_terminal "omakub-install-dev-env bun" ;; *Deno*) present_terminal "omakub-install-dev-env deno" ;; @@ -226,32 +239,50 @@ show_install_javascript_menu() { } show_install_elixir_menu() { - case $(menu "Install" " Elixir\n Phoenix") in + case $(menu "Install" " Elixir\n Phoenix" "--width 250 --height 130") in *Elixir*) present_terminal "omakub-install-dev-env elixir" ;; *Phoenix*) present_terminal "omakub-install-dev-env phoenix" ;; *) show_install_development_menu ;; esac } -show_install_gaming_menu() { - case $(menu "Install" " Steam\n RetroArch\n󰍳 Minecraft") in - *Steam*) app_install "steam" ;; - *RetroArch*) app_install "retroarch" ;; - *Minecraft*) app_install "minecraft" ;; +show_install_editor_menu() { + case $(menu "Install" " NeoVim\n VSCode\n Cursor\n Zed\n Emacs" "--width 250 --height 245") in + *VSCode*) install_app "visual-studio-code" ;; + *NeoVim*) install_app "neovim" ;; + *Cursor*) install_app "cursor" ;; + *Zed*) install_app "zed" ;; + *Emacs*) install_app "doom-emacs" ;; *) show_install_menu ;; esac } -show_install_style_menu() { - case $(menu "Install" "󰸌 Theme\n Background" "--width 350") in - *Theme*) present_terminal omakub-theme-install ;; - *Background*) nautilus ~/.config/omakub/current/theme/backgrounds ;; +show_install_terminal_menu() { + case $(menu "Install" " Alacritty\n Kitty" "--width 250 --height 130") in + *Alacritty*) install_terminal "alacritty" ;; + *Kitty*) install_terminal "kitty" ;; + *) show_install_menu ;; + esac +} + +show_install_ai_menu() { + case $(menu "Install" "󱚤 Ollama" "--width 250 --height 80") in + *Ollama*) install_app "ollama" ;; + *) show_install_menu ;; + esac +} + +show_install_gaming_menu() { + case $(menu "Install" " Steam\n RetroArch\n󰍳 Minecraft" "--width 250 --height 170") in + *Steam*) install_app "steam" ;; + *RetroArch*) install_app "retroarch" ;; + *Minecraft*) install_app "minecraft" ;; *) show_install_menu ;; esac } show_remove_menu() { - case $(menu "Remove" " Web App\n TUI\n󰀻 App\n󰸌 Theme" "--width 250 --height 300") in + case $(menu "Remove" " Web App\n TUI\n󰀻 App\n󰸌 Theme" "--width 250 --height 210") in *Web*) present_terminal omakub-webapp-remove ;; *TUI*) present_terminal omakub-tui-remove ;; *App*) present_terminal omakub-app-remove ;; @@ -261,29 +292,54 @@ show_remove_menu() { } show_update_menu() { - case $(menu "Update" "󰟢 Omakub\n󰇅 Firmware\n Config\n󰸌 Themes" "--width 250 --height 300") in + case $(menu "Update" "󰟢 Omakub\n󰟢 Branch\n Config\n󰸌 Themes\n󰇅 Hardware\n Firmware\n Password" "--width 250 --height 320") in *Omakub*) present_terminal omakub-update ;; - *Firmware*) present_terminal omakub-update-firmware ;; + *Branch*) present_terminal omakub-update-branch ;; *Config*) show_update_config_menu ;; *Themes*) present_terminal omakub-theme-update ;; + *Hardware*) show_update_hardware_menu ;; + *Firmware*) present_terminal omakub-update-firmware ;; + *Password*) show_update_password_menu ;; *) show_main_menu ;; esac } +show_update_branch_menu() { + case $(menu "Branch" "main\ndev" "--width 250 --height 120" "$(omakub-version-branch)") in + *main*) present_terminal "omakub-update-branch main" ;; + *dev*) present_terminal "omakub-update-branch dev" ;; + *) show_update_menu ;; + esac +} + show_update_config_menu() { - case $(menu "Use default config" " Starship\n Zellij\n Gnome\n󰍂 GDM\n󱣴 Plymouth\n󰌧 Wofi" "--width 250") in - *Starship*) present_terminal omakub-refresh-config starship.toml ;; - *Zellij*) present_terminal omakub-refresh-config zellij/config.kdl ;; + case $(menu "Use default config" " Gnome\n󰍂 GDM\n󱣴 Plymouth\n󰌧 Wofi\n Starship\n Zellij" "--width 250 --height 280") in *Gnome*) present_terminal omakub-refresh-gnome ;; *GDM*) present_terminal omakub-refresh-gdm ;; *Plymouth*) present_terminal omakub-refresh-plymouth ;; *Wofi*) present_terminal omakub-refresh-wofi ;; + *Starship*) present_terminal omakub-refresh-config starship.toml ;; + *Zellij*) present_terminal omakub-refresh-config zellij/config.kdl ;; + *) show_update_menu ;; + esac +} + +show_update_hardware_menu() { + case $(menu "Restart" " Audio" "--width 250 --height 80") in + *Audio*) present_terminal omarchy-restart-pipewire ;; + *) show_update_menu ;; + esac +} + +show_update_password_menu() { + case $(menu "Update Password" " User" "--width 250 --height 80") in + *User*) present_terminal passwd ;; *) show_update_menu ;; esac } show_main_menu() { - go_to_menu "$(menu "Go" "󰀻 Apps\n󰧑 Learn\n Style\n Setup\n󰉉 Install\n󰭌 Remove\n Update\n About" "--width 250 --height 400")" + go_to_menu "$(menu "Go" "󰀻 Apps\n󰧑 Learn\n Style\n Setup\n󰉉 Install\n󰭌 Remove\n Update\n About" "--width 250 --height 360")" } go_to_menu() { @@ -296,7 +352,7 @@ go_to_menu() { *install*) show_install_menu ;; *remove*) show_remove_menu ;; *update*) show_update_menu ;; - *about*) alacritty --class Omakub -o font.size=9 -e bash -c -l 'fastfetch; read -n 1 -s' ;; + *about*) omakub-launch-about ;; esac } @@ -305,4 +361,4 @@ if [[ -n "$1" ]]; then go_to_menu "$1" else show_main_menu -fi +fi \ No newline at end of file diff --git a/bin/omakub-migrate b/bin/omakub-migrate index d459c79a6..f52e56415 100755 --- a/bin/omakub-migrate +++ b/bin/omakub-migrate @@ -1,20 +1,27 @@ #!/bin/bash -set -e - # Where we store an empty file for each migration that has already been performed. STATE_DIR="$HOME/.local/state/omakub/migrations" mkdir -p "$STATE_DIR" +# Skipped migrations are tracked separately +mkdir -p "$STATE_DIR/skipped" + # Run any pending migrations -if [ -n "$(ls -A ~/.local/share/omakub/migrations/*.sh 2>/dev/null)" ]; then - for file in ~/.local/share/omakub/migrations/*.sh; do - filename=$(basename "$file") +for file in ~/.local/share/omakub/migrations/*.sh; do + filename=$(basename "$file") + + if [[ ! -f "$STATE_DIR/$filename" && ! -f "$STATE_DIR/skipped/$filename" ]]; then + echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m" - if [[ ! -f "$STATE_DIR/$filename" ]]; then - echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m" - source $file + if bash $file; then touch "$STATE_DIR/$filename" + else + if gum confirm "Migration ${filename%.sh} failed. Skip and continue?"; then + touch "$STATE_DIR/skipped/$filename" + else + exit 1 + fi fi - done -fi \ No newline at end of file + fi +done diff --git a/bin/omakub-pkg-add b/bin/omakub-pkg-add new file mode 100755 index 000000000..407e387f1 --- /dev/null +++ b/bin/omakub-pkg-add @@ -0,0 +1,15 @@ +#!/bin/bash + +if omakub-pkg-missing "$@"; then + sudo apt -y install "$@" || exit 1 +fi + +for pkg in "$@"; do + # Secondary check to handle states where dpkg doesn't actually register an error + if ! dpkg -l | grep -q "$pkg"; then + echo -e "\033[31mError: Package '$pkg' did not install\033[0m" >&2 + exit 1 + fi +done + +exit 0 diff --git a/bin/omakub-pkg-drop b/bin/omakub-pkg-drop new file mode 100755 index 000000000..5cef85220 --- /dev/null +++ b/bin/omakub-pkg-drop @@ -0,0 +1,7 @@ +#!/bin/bash + +for pkg in "$@"; do + if dpkg -l | grep -q "$pkg"; then + sudo apt -y remove --purge "$pkg" + fi +done diff --git a/bin/omakub-pkg-missing b/bin/omakub-pkg-missing new file mode 100755 index 000000000..429c85000 --- /dev/null +++ b/bin/omakub-pkg-missing @@ -0,0 +1,9 @@ +#!/bin/bash + +for pkg in "$@"; do + if ! dpkg -l | grep -q "$pkg"; then + exit 0 + fi +done + +exit 1 diff --git a/bin/omakub-pkg-present b/bin/omakub-pkg-present new file mode 100755 index 000000000..d3d80cba7 --- /dev/null +++ b/bin/omakub-pkg-present @@ -0,0 +1,7 @@ +#!/bin/bash + +for pkg in "$@"; do + dpkg -l | grep -q "$pkg" &>/dev/null || exit 1 +done + +exit 0 diff --git a/bin/omakub-refresh-applications b/bin/omakub-refresh-applications index 64d36aaa6..0c7928a39 100755 --- a/bin/omakub-refresh-applications +++ b/bin/omakub-refresh-applications @@ -8,8 +8,6 @@ gtk-update-icon-cache ~/.local/share/icons/hicolor &>/dev/null # Copy .desktop declarations mkdir -p ~/.local/share/applications cp ~/.local/share/omakub/applications/desktop/*.desktop ~/.local/share/applications/ -if [ -d ~/.local/share/omakub/applications/desktop/hidden ]; then - cp ~/.local/share/omakub/applications/desktop/hidden/*.desktop ~/.local/share/applications/ -fi +cp ~/.local/share/omakub/applications/desktop/hidden/*.desktop ~/.local/share/applications/ update-desktop-database ~/.local/share/applications diff --git a/bin/omakub-refresh-plymouth b/bin/omakub-refresh-plymouth index 262868865..cbdb9b4ae 100755 --- a/bin/omakub-refresh-plymouth +++ b/bin/omakub-refresh-plymouth @@ -1,9 +1,5 @@ #!/bin/bash -if [[ "$1" == "-y" ]]; then - sudo cp ~/.local/share/omakub/default/plymouth/* /usr/share/plymouth/themes/omakub/ - # Install the theme as an alternative - sudo update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth /usr/share/plymouth/themes/omakub/omakub.plymouth 100 - # Set it as the default - sudo update-alternatives --set default.plymouth /usr/share/plymouth/themes/omakub/omakub.plymouth -fi +sudo cp ~/.local/share/omakub/default/plymouth/* /usr/share/plymouth/themes/omakub/ +sudo update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth /usr/share/plymouth/themes/omakub/omakub.plymouth 100 +sudo update-alternatives --set default.plymouth /usr/share/plymouth/themes/omakub/omakub.plymouth diff --git a/bin/omakub-refresh-theme b/bin/omakub-refresh-theme new file mode 100755 index 000000000..224e97bca --- /dev/null +++ b/bin/omakub-refresh-theme @@ -0,0 +1,11 @@ +#!/bin/bash + +# Add missing theme links +for f in ~/.local/share/omakub/themes/*; do + if [ ! -e ~/.config/omakub/themes/$(basename "$f") ]; then + echo -e "\e[32mCreating symlink for $(basename "$f")\e[0m" + ln -s "$f" ~/.config/omakub/themes/ + fi +done + + diff --git a/bin/omakub-reset-sudo b/bin/omakub-reset-sudo new file mode 100755 index 000000000..94822623b --- /dev/null +++ b/bin/omakub-reset-sudo @@ -0,0 +1,4 @@ +#!/bin/bash + +# Resetting sudo lockout for user +su -c "faillock --reset --user $USER" diff --git a/bin/omakub-restart-pipewire b/bin/omakub-restart-pipewire new file mode 100755 index 000000000..f26ee09e7 --- /dev/null +++ b/bin/omakub-restart-pipewire @@ -0,0 +1,4 @@ +#!/bin/bash + +echo -e "Restarting pipewire audio service...\n" +systemctl --user restart pipewire.service diff --git a/bin/omakub-theme-bg-next b/bin/omakub-theme-bg-next index 6759c584b..bb881e680 100755 --- a/bin/omakub-theme-bg-next +++ b/bin/omakub-theme-bg-next @@ -10,8 +10,7 @@ TOTAL=${#BACKGROUNDS[@]} if [[ $TOTAL -eq 0 ]]; then notify-send "No background was found for theme" -t 2000 - gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/warty-final-ubuntu.png' - gsettings set org.gnome.desktop.background picture-uri-dark 'file:///usr/share/backgrounds/warty-final-ubuntu.png' + omakub-theme-bg-set else # Get current background from symlink if [[ -L "$CURRENT_BACKGROUND_LINK" ]]; then @@ -43,7 +42,5 @@ else ln -nsf "$NEW_BACKGROUND" "$CURRENT_BACKGROUND_LINK" # Update GNOME background settings - gsettings set org.gnome.desktop.background picture-uri $CURRENT_BACKGROUND_LINK - gsettings set org.gnome.desktop.background picture-uri-dark $CURRENT_BACKGROUND_LINK - gsettings set org.gnome.desktop.background picture-options 'zoom' + omakub-theme-bg-set "$CURRENT_BACKGROUND_LINK" fi diff --git a/bin/omakub-theme-bg-set b/bin/omakub-theme-bg-set new file mode 100755 index 000000000..e07257119 --- /dev/null +++ b/bin/omakub-theme-bg-set @@ -0,0 +1,15 @@ +#!/bin/bash + +# omakub-theme-bg-set: Set GNOME background image and options + +BACKGROUND_LINK=$1 +ZOOM_FLAG=${2:-'zoom'} +DEFAULT_BACKGROUND='file:///usr/share/backgrounds/warty-final-ubuntu.png' + +if [[ -z "$BACKGROUND_LINK" ]]; then + BACKGROUND_LINK="$DEFAULT_BACKGROUND" +fi + +gsettings set org.gnome.desktop.background picture-uri $BACKGROUND_LINK +gsettings set org.gnome.desktop.background picture-uri-dark $BACKGROUND_LINK +gsettings set org.gnome.desktop.background picture-options $ZOOM_FLAG diff --git a/bin/omakub-theme-install b/bin/omakub-theme-install index e071e4135..3fac59150 100755 --- a/bin/omakub-theme-install +++ b/bin/omakub-theme-install @@ -4,6 +4,7 @@ # Usage: omakub-theme-install if [ -z "$1" ]; then + echo -e "\e[32mSee https://omakasui.org/themes\n\e[0m" REPO_URL=$(gum input --placeholder="Git repo URL for theme" --header="") else REPO_URL="$1" diff --git a/bin/omakub-theme-set b/bin/omakub-theme-set index ad3090063..ea6d8a647 100755 --- a/bin/omakub-theme-set +++ b/bin/omakub-theme-set @@ -23,77 +23,19 @@ fi # Update theme symlinks ln -nsf "$THEME_PATH" "$CURRENT_THEME_DIR" -# Change gnome modes -if [[ -f ~/.config/omakub/current/theme/gnome.theme ]]; then - OMAKUB_THEME_COLOR=$(<~/.config/omakub/current/theme/gnome.theme) -else - OMAKUB_THEME_COLOR="blue" -fi - -if [[ -f ~/.config/omakub/current/theme/light.mode ]]; then - gsettings set org.gnome.desktop.interface color-scheme "prefer-light" - gsettings set org.gnome.desktop.interface gtk-theme "Yaru-$OMAKUB_THEME_COLOR" -else - gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" - gsettings set org.gnome.desktop.interface gtk-theme "Yaru-$OMAKUB_THEME_COLOR-dark" -fi -gsettings set org.gnome.desktop.interface accent-color "$OMAKUB_THEME_COLOR" 2>/dev/null || true - -# Change gnome cursor theme color -if [[ -f ~/.config/omakub/current/theme/cursor.theme ]]; then - gsettings set org.gnome.desktop.interface cursor-theme "$(<~/.config/omakub/current/theme/cursor.theme)" -else - gsettings set org.gnome.desktop.interface cursor-theme "Yaru" -fi - -# Change gnome icon theme color -if [[ -f ~/.config/omakub/current/theme/icons.theme ]]; then - gsettings set org.gnome.desktop.interface icon-theme "$(<~/.config/omakub/current/theme/icons.theme)" -else - gsettings set org.gnome.desktop.interface icon-theme "Yaru-$OMAKUB_THEME_COLOR" -fi - -# Change gnome extensions theme -if [[ -f ~/.config/omakub/current/theme/tophat.theme ]]; then - gsettings set org.gnome.shell.extensions.tophat meter-fg-color "$(<~/.config/omakub/current/theme/tophat.theme)" -else - if [[ -f ~/.config/omakub/current/theme/light.mode ]]; then - gsettings set org.gnome.shell.extensions.tophat meter-fg-color "#e92020" - else - gsettings set org.gnome.shell.extensions.tophat meter-fg-color "#33ccff" - fi -fi - -# Change vscode colors -if command -v code &>/dev/null; then - if [[ -f ~/.config/omakub/current/theme/vscode.theme ]]; then - declare -A vscode - source ~/.config/omakub/current/theme/vscode.theme - - # Install extension if specified - if [[ -n "${vscode[extension]}" ]]; then - code --install-extension "${vscode[extension]}" --force - fi - - # Set theme if specified - if [[ -n "${vscode[theme]}" ]]; then - sed -i "s/\"workbench.colorTheme\": \".*\"/\"workbench.colorTheme\": \"${vscode[theme]}\"/g" ~/.config/Code/User/settings.json - fi - # Fallback to default themes - else - if [[ -f ~/.config/omakub/current/theme/light.mode ]]; then - sed -i "s/\"workbench.colorTheme\": \".*\"/\"workbench.colorTheme\": \"Default Light+\"/g" ~/.config/Code/User/settings.json - else - sed -i "s/\"workbench.colorTheme\": \".*\"/\"workbench.colorTheme\": \"Default Dark+\"/g" ~/.config/Code/User/settings.json - fi - fi -fi - -# Touch alacritty config to pickup the changed theme -touch "$HOME/.config/alacritty/alacritty.toml" +# Change background with theme +omakub-theme-bg-next # Restart components to apply new theme pkill -SIGUSR2 btop -# Set new background -omakub-theme-bg-next \ No newline at end of file +# Change gnome, browser, vscode themes +omakub-theme-set-terminal +omakub-theme-set-gnome +omakub-theme-set-browser +omakub-theme-set-vscode +omakub-theme-set-cursor +omakub-theme-set-obsidian + +# Call hook on theme set +omakub-hook theme-set "$THEME_NAME" \ No newline at end of file diff --git a/bin/omakub-theme-set-browser b/bin/omakub-theme-set-browser new file mode 100755 index 000000000..6482685cc --- /dev/null +++ b/bin/omakub-theme-set-browser @@ -0,0 +1,36 @@ +#!/bin/bash + +CHROMIUM_THEME=~/.config/omakub/current/theme/chromium.theme + +if omakub-cmd-present chromium || omakub-cmd-present helium-browser || omakub-cmd-present brave; then + if [[ -f $CHROMIUM_THEME ]]; then + THEME_RGB_COLOR=$(<$CHROMIUM_THEME) + THEME_HEX_COLOR=$(printf '#%02x%02x%02x' ${THEME_RGB_COLOR//,/ }) + else + # Use a default, neutral grey if theme doesn't have a color + THEME_RGB_COLOR="28,32,39" + THEME_HEX_COLOR="#1c2027" + fi + + if omakub-cmd-present chromium; then + rm -f /etc/chromium/policies/managed/color.json + chromium --no-startup-window --set-theme-color="$THEME_RGB_COLOR" + + if [[ -f ~/.config/omakub/current/theme/light.mode ]]; then + chromium --no-startup-window --set-color-scheme="light" + else + chromium --no-startup-window --set-color-scheme="dark" + fi + fi + + if omakub-cmd-present helium-browser; then + echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\"}" | tee "/etc/chromium/policies/managed/color.json" >/dev/null + helium-browser --no-startup-window --refresh-platform-policy + fi + + if omakub-cmd-present brave; then + echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\"}" | tee "/etc/brave/policies/managed/color.json" >/dev/null + brave --refresh-platform-policy --no-startup-window + fi +fi + diff --git a/bin/omakub-theme-set-cursor b/bin/omakub-theme-set-cursor new file mode 100755 index 000000000..a146667b4 --- /dev/null +++ b/bin/omakub-theme-set-cursor @@ -0,0 +1,4 @@ +#!/bin/bash + +# Call the VSCode theme setter with Cursor-specific parameters +omakub-theme-set-vscode cursor "$HOME/.config/Cursor/User/settings.json" "$HOME/.local/state/omakub/toggles/skip-cursor-theme-changes" Cursor diff --git a/bin/omakub-theme-set-eza b/bin/omakub-theme-set-eza new file mode 100755 index 000000000..b3e5b2056 --- /dev/null +++ b/bin/omakub-theme-set-eza @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ -f ~/.config/omakub/current/theme/eza.yml ]; then + ln -snf ~/.config/omakub/current/theme/eza.yml ~/.config/eza/theme.yml +else + rm -f ~/.config/eza/theme.yml +fi diff --git a/bin/omakub-theme-set-gnome b/bin/omakub-theme-set-gnome new file mode 100755 index 000000000..5697c7301 --- /dev/null +++ b/bin/omakub-theme-set-gnome @@ -0,0 +1,48 @@ +#!/bin/bash + +# Change gnome modes +GNOME_THEME=~/.config/omakub/current/theme/gnome.theme +GNOME_LIGHT_MODE=~/.config/omakub/current/theme/light.mode + +if [[ -f $GNOME_THEME ]]; then + OMAKUB_THEME_COLOR=$(<$GNOME_THEME) +else + OMAKUB_THEME_COLOR="blue" +fi + +if [[ -f $GNOME_LIGHT_MODE ]]; then + gsettings set org.gnome.desktop.interface color-scheme "prefer-light" + gsettings set org.gnome.desktop.interface gtk-theme "Yaru-$OMAKUB_THEME_COLOR" +else + gsettings set org.gnome.desktop.interface color-scheme "prefer-dark" + gsettings set org.gnome.desktop.interface gtk-theme "Yaru-$OMAKUB_THEME_COLOR-dark" +fi +gsettings set org.gnome.desktop.interface accent-color "$OMAKUB_THEME_COLOR" 2>/dev/null || true + +# Change gnome cursor theme color +GNOME_CURSOR_THEME=~/.config/omakub/current/theme/cursor.theme +if [[ -f $GNOME_CURSOR_THEME ]]; then + gsettings set org.gnome.desktop.interface cursor-theme "$(<$GNOME_CURSOR_THEME)" +else + gsettings set org.gnome.desktop.interface cursor-theme "Yaru" +fi + +# Change gnome icon theme color +GNOME_ICONS_THEME=~/.config/omakub/current/theme/icons.theme +if [[ -f $GNOME_ICONS_THEME ]]; then + gsettings set org.gnome.desktop.interface icon-theme "$(<$GNOME_ICONS_THEME)" +else + gsettings set org.gnome.desktop.interface icon-theme "Yaru-$OMAKUB_THEME_COLOR" +fi + +# Change gnome extensions theme +GNOME_TOPHAT_THEME=~/.config/omakub/current/theme/tophat.theme +if [[ -f $GNOME_TOPHAT_THEME ]]; then + gsettings set org.gnome.shell.extensions.tophat meter-fg-color "$(<$GNOME_TOPHAT_THEME)" +else + if [[ -f ~/.config/omakub/current/theme/light.mode ]]; then + gsettings set org.gnome.shell.extensions.tophat meter-fg-color "#e92020" + else + gsettings set org.gnome.shell.extensions.tophat meter-fg-color "#33ccff" + fi +fi \ No newline at end of file diff --git a/bin/omakub-theme-set-obsidian b/bin/omakub-theme-set-obsidian new file mode 100755 index 000000000..e24435654 --- /dev/null +++ b/bin/omakub-theme-set-obsidian @@ -0,0 +1,659 @@ +#!/bin/bash + +# omakub-theme-set-obsidian: Bootstrap and update Omakub theme for Obsidian +# +# - Ensures registry at ~/.local/state/omakub/obsidian-vaults +# - If missing/empty, bootstraps by scanning ~/Documents/*/.obsidian and ~/Dropbox/*/.obsidian +# - For each valid vault: +# - Ensures .obsidian/themes/Omakub/{manifest.json, theme.css} +# - Updates theme.css (uses current theme’s obsidian.css if present; otherwise generates -- see below) + +# Theme automagic generation logic: +# +# - Background/foreground: read from ~/.config/omakub/current/theme/alacritty.toml [colors.primary] +# (background/foreground). Fallbacks: bg=#1a1b26, fg=#a9b1d6. Compute bg brightness for light/dark handling. +# - Palette extraction: collect colors from Alacritty (primary/normal/bright/dim/selection), Waybar (@define-color), +# and Hyprland (col.*_border; rgba->hex). Normalize, dedupe, and count frequencies. +# - Slot ordering: remove bg/fg, sort remaining colors by frequency, then fill 13 slots by cycling. Map slots to: +# h1–h6, links, inline code, marks, interactive accent, blockquote border; muted/faint use border color. +# - Code colors: code background = closest color to bg (Euclidean RGB); if none, make a subtle bg variant (+/− RGB). +# code foreground = closest color to fg; fallback #e0e0e0. +# - Border color: from btop.theme theme[div_line]; else blended mix biased toward bg (≈ (bg+fg)/3). +# - Selection: from Alacritty [colors.selection] (background/text), honoring CellForeground/Background. +# If missing, background = 75% bg + 25% fg; text chosen for contrast vs selection background. +# - Fonts: monospace from Alacritty [font] or fontconfig monospace; UI font from fontconfig sans-serif. + +VAULTS_FILE="$HOME/.local/state/omakub/obsidian-vaults" +CURRENT_THEME_DIR="$HOME/.config/omakub/current/theme" + +# Ensure the vaults registry exists, or bootstrap from known locations +ensure_vaults_file() { + mkdir -p "$(dirname "$VAULTS_FILE")" + # If file exists (even empty), do not scan; treat as authoritative + if [ -f "$VAULTS_FILE" ]; then + return + fi + local tmpfile + tmpfile="$(mktemp)" + # Scan a couple of common locations for //.obsidian + for base in "$HOME/Documents" "$HOME/Dropbox"; do + [ -d "$base" ] || continue + for d in "$base"/*/.obsidian; do + [ -d "$d" ] || continue + vault_dir="${d%/.obsidian}" + printf "%s\n" "$vault_dir" >>"$tmpfile" + done + done + if [ -s "$tmpfile" ]; then + sort -u "$tmpfile" >"$VAULTS_FILE" + else + : >"$VAULTS_FILE" + fi + rm -f "$tmpfile" +} + +# Ensure theme directory and minimal manifest exist in a vault +ensure_theme_scaffold() { + local vault_path="$1" + local theme_dir="$vault_path/.obsidian/themes/Omakub" + mkdir -p "$theme_dir" + if [ ! -f "$theme_dir/manifest.json" ]; then + cat >"$theme_dir/manifest.json" <<'EOF' +{ + "name": "Omakub", + "version": "1.0.0", + "minAppVersion": "0.16.0", + "description": "Automatically syncs with your current Omakub system theme colors and fonts", + "author": "Omakub", + "authorUrl": "https://omakub.org" +} +EOF + fi + [ -f "$theme_dir/theme.css" ] || : >"$theme_dir/theme.css" +} + +# Function to extract hex color from string +extract_hex_color() { + echo "$1" | grep -oE '#[0-9a-fA-F]{6}' | head -1 +} + +# Function to convert RGB/RGBA to hex +rgb_to_hex() { + local rgb_string="$1" + if [[ $rgb_string =~ rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+) ]]; then + printf "#%02x%02x%02x\n" "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "${BASH_REMATCH[3]}" + fi +} + +# Convert hex to RGB components +hex_to_rgb() { + local hex="${1#\#}" + printf "%d %d %d\n" "0x${hex:0:2}" "0x${hex:2:2}" "0x${hex:4:2}" +} + +# Calculate perceived brightness (0-255) +calculate_brightness() { + local hex="$1" + read -r r g b <<<"$(hex_to_rgb "$hex")" + # Use perceived brightness formula + echo $(((r * 299 + g * 587 + b * 114) / 1000)) +} + +# Calculate color distance (euclidean in RGB space) +color_distance() { + local hex1="$1" + local hex2="$2" + read -r r1 g1 b1 <<<"$(hex_to_rgb "$hex1")" + read -r r2 g2 b2 <<<"$(hex_to_rgb "$hex2")" + echo $(((r1 - r2) * (r1 - r2) + (g1 - g2) * (g1 - g2) + (b1 - b2) * (b1 - b2))) +} + +# Extract all colors with frequency count +extract_all_colors_with_count() { + local -A color_counts + local color + + # Extract from Alacritty config + if [ -f "$CURRENT_THEME_DIR/alacritty.toml" ]; then + # Primary colors + while IFS= read -r color; do + color=$(echo "$color" | tr '[:upper:]' '[:lower:]') # Lowercase for consistency + [ -n "$color" ] && ((color_counts["$color"]++)) + done < <(grep -E "(background|foreground|cursor|text)" "$CURRENT_THEME_DIR/alacritty.toml" | sed "s/.*[\"']0x/#/;s/.*[\"']#/#/;s/[\"'].*//;s/.*#\([0-9a-fA-F]\{6\}\).*/\#\1/" | grep "^#") + + # Normal colors + while IFS= read -r color; do + color=$(echo "$color" | tr '[:upper:]' '[:lower:]') # Lowercase for consistency + [ -n "$color" ] && ((color_counts["$color"]++)) + done < <(grep -A 20 "\[colors.normal\]" "$CURRENT_THEME_DIR/alacritty.toml" | grep -E "(black|red|green|yellow|blue|magenta|cyan|white)" | sed "s/.*[\"']0x/#/;s/.*[\"']#/#/;s/[\"'].*//;s/.*#\([0-9a-fA-F]\{6\}\).*/\#\1/" | grep "^#") + + # Bright colors + while IFS= read -r color; do + # Add # if missing + [[ "$color" =~ ^[0-9a-fA-F]{6}$ ]] && color="#$color" + color=$(echo "$color" | tr '[:upper:]' '[:lower:]') # Lowercase for consistency + [[ "$color" =~ ^#[0-9a-f]{6}$ ]] && ((color_counts["$color"]++)) + done < <(grep -A 20 "\[colors.bright\]" "$CURRENT_THEME_DIR/alacritty.toml" | grep -E "(black|red|green|yellow|blue|magenta|cyan|white)" | sed "s/.*[\"']//;s/[\"'].*//") + + # Dim colors if present + while IFS= read -r color; do + # Add # if missing + [[ "$color" =~ ^[0-9a-fA-F]{6}$ ]] && color="#$color" + color=$(echo "$color" | tr '[:upper:]' '[:lower:]') # Lowercase for consistency + [[ "$color" =~ ^#[0-9a-f]{6}$ ]] && ((color_counts["$color"]++)) + done < <(grep -A 20 "\[colors.dim\]" "$CURRENT_THEME_DIR/alacritty.toml" 2>/dev/null | grep -E "(black|red|green|yellow|blue|magenta|cyan|white)" | sed "s/.*[\"']//;s/[\"'].*//") + + # Selection colors + while IFS= read -r color; do + color=$(echo "$color" | tr '[:upper:]' '[:lower:]') # Lowercase for consistency + [ -n "$color" ] && ((color_counts["$color"]++)) + done < <(grep -A 5 "\[colors.selection\]" "$CURRENT_THEME_DIR/alacritty.toml" 2>/dev/null | grep -E "(background|text)" | sed "s/.*[\"']0x/#/;s/.*[\"']#/#/;s/[\"'].*//;s/.*#\([0-9a-fA-F]\{6\}\).*/\#\1/" | grep "^#") + fi + + # Extract from Waybar CSS + if [ -f "$CURRENT_THEME_DIR/waybar.css" ]; then + while IFS= read -r color; do + color=$(echo "$color" | tr '[:upper:]' '[:lower:]') # Lowercase for consistency + [ -n "$color" ] && ((color_counts["$color"]++)) + done < <(grep -oE '@define-color [a-z_-]+ #[0-9a-fA-F]{6}' "$CURRENT_THEME_DIR/waybar.css" | grep -oE '#[0-9a-fA-F]{6}') + fi + + # Extract from Hyprland config + if [ -f "$CURRENT_THEME_DIR/hyprland.conf" ]; then + while IFS= read -r color; do + if [[ $color == rgba* ]] || [[ $color == rgb* ]]; then + color=$(rgb_to_hex "$color") + fi + color=$(echo "$color" | tr '[:upper:]' '[:lower:]') # Lowercase for consistency + [ -n "$color" ] && ((color_counts["$color"]++)) + done < <(grep -E "col\.(active|inactive)_border" "$CURRENT_THEME_DIR/hyprland.conf" | grep -oE 'rgba?\([^)]+\)|#[0-9a-fA-F]{6,8}' | sed 's/ff$//') + fi + + # Output colors with their counts + for color in "${!color_counts[@]}"; do + echo "${color_counts[$color]} $color" + done +} + +# Sort colors by frequency +sort_colors_by_frequency() { + # Input is already "count color" format + sort -rn | cut -d' ' -f2 +} + +# Fill color slots with cycling if needed +fill_color_slots() { + local -a colors=("$@") + local -a slots + local num_colors=${#colors[@]} + + # Need 13 slots total (code colors are handled separately) + local slots_needed=13 + + if [ $num_colors -eq 0 ]; then + # No colors available, use defaults + colors=("#3d3d3d" "#5d5d5d" "#7d7d7d" "#9d9d9d" "#bd93f9" "#50fa7b") + num_colors=6 + fi + + # Fill slots, cycling if necessary + for ((i = 0; i < slots_needed; i++)); do + slots[$i]="${colors[$((i % num_colors))]}" + done + + echo "${slots[@]}" +} + +# Main color extraction and theme generation +extract_theme_data() { + # Get primary colors from Alacritty + local bg_color="#1a1b26" + local fg_color="#a9b1d6" + + if [ -f "$CURRENT_THEME_DIR/alacritty.toml" ]; then + local extracted_bg=$(grep -A 5 "\[colors.primary\]" "$CURRENT_THEME_DIR/alacritty.toml" | grep "^background = " | sed "s/.*[\"']0x/#/;s/.*[\"']#/#/;s/[\"'].*//;s/.*#\([0-9a-fA-F]\{6\}\).*/\#\1/" | head -1 | tr '[:upper:]' '[:lower:]') + local extracted_fg=$(grep -A 5 "\[colors.primary\]" "$CURRENT_THEME_DIR/alacritty.toml" | grep "^foreground = " | sed "s/.*[\"']0x/#/;s/.*[\"']#/#/;s/[\"'].*//;s/.*#\([0-9a-fA-F]\{6\}\).*/\#\1/" | head -1 | tr '[:upper:]' '[:lower:]') + [ -n "$extracted_bg" ] && bg_color="$extracted_bg" + [ -n "$extracted_fg" ] && fg_color="$extracted_fg" + fi + + # Determine if light or dark theme + local bg_brightness=$(calculate_brightness "$bg_color") + local is_light_theme=false + [ $bg_brightness -gt 127 ] && is_light_theme=true + + # Extract all colors with counts + local color_data=$(extract_all_colors_with_count) + + # Filter out background and foreground colors for the main array + local filtered_data=$(echo "$color_data" | grep -v "$bg_color" | grep -v "$fg_color") + + # Get all unique colors (including bg/fg) for distance calculations + local -a all_unique_colors + readarray -t all_unique_colors < <(echo "$color_data" | cut -d' ' -f2 | sort -u) + + # Find the 3 closest colors to background for background variations + local -a bg_distances + for color in "${all_unique_colors[@]}"; do + if [ "$color" != "$bg_color" ]; then + distance=$(color_distance "$color" "$bg_color") + bg_distances+=("$distance:$color") + fi + done + + # Sort by distance and get the closest color for code background + local -a closest_to_bg + readarray -t closest_to_bg < <(printf '%s\n' "${bg_distances[@]}" | sort -n | head -1 | cut -d: -f2) + + # All background variations use the same as primary background + local bg_primary_alt="$bg_color" + local bg_secondary="$bg_color" + local bg_secondary_alt="$bg_color" + + # Code block background uses the closest different color + local code_bg="${closest_to_bg[0]}" + + # If no different color available, create a subtle variant for code blocks + if [ -z "$code_bg" ]; then + read -r r g b <<<"$(hex_to_rgb "$bg_color")" + if [ $bg_brightness -gt 127 ]; then + r=$((r - 10)) + g=$((g - 10)) + b=$((b - 10)) + else + r=$((r + 15)) + g=$((g + 15)) + b=$((b + 15)) + fi + [ $r -lt 0 ] && r=0 + [ $r -gt 255 ] && r=255 + [ $g -lt 0 ] && g=0 + [ $g -gt 255 ] && g=255 + [ $b -lt 0 ] && b=0 + [ $b -gt 255 ] && b=255 + code_bg=$(printf "#%02x%02x%02x" "$r" "$g" "$b") + fi + + # Find closest color to foreground for code block text + local code_fg="" + min_distance=999999999 + for color in "${all_unique_colors[@]}"; do + if [ "$color" != "$fg_color" ]; then + distance=$(color_distance "$color" "$fg_color") + if [ $distance -lt $min_distance ]; then + min_distance=$distance + code_fg="$color" + fi + fi + done + [ -z "$code_fg" ] && code_fg="#e0e0e0" # Fallback + + # Extract text selection colors from Alacritty + local selection_bg="" + local selection_fg="" + if [ -f "$CURRENT_THEME_DIR/alacritty.toml" ]; then + selection_bg=$(grep -A 5 "\[colors.selection\]" "$CURRENT_THEME_DIR/alacritty.toml" | grep "^background = " | sed "s/.*[\"']0x/#/;s/.*[\"']#/#/;s/[\"'].*//;s/.*#\([0-9a-fA-F]\{6\}\).*/\#\1/" | head -1 | tr '[:upper:]' '[:lower:]') + local selection_text=$(grep -A 5 "\[colors.selection\]" "$CURRENT_THEME_DIR/alacritty.toml" | grep "^text = " | sed "s/.*[\"']0x/#/;s/.*[\"']#/#/;s/[\"'].*//;s/.*#\([0-9a-fA-F]\{6\}\).*/\#\1/" | head -1 | tr '[:upper:]' '[:lower:]') + + # If text is set to CellForeground/CellBackground, use the appropriate color + if [ -z "$selection_text" ] || [[ "$(grep -A 5 "\[colors.selection\]" "$CURRENT_THEME_DIR/alacritty.toml" | grep "^text = ")" == *"CellForeground"* ]]; then + selection_fg="$fg_color" + elif [[ "$(grep -A 5 "\[colors.selection\]" "$CURRENT_THEME_DIR/alacritty.toml" | grep "^text = ")" == *"CellBackground"* ]]; then + selection_fg="$bg_color" + else + selection_fg="$selection_text" + fi + fi + + # Fallback if no selection colors found + if [ -z "$selection_bg" ]; then + read -r r1 g1 b1 <<<"$(hex_to_rgb "$bg_color")" + read -r r2 g2 b2 <<<"$(hex_to_rgb "$fg_color")" + local r=$(((r1 * 3 + r2) / 4)) # 75% background, 25% foreground + local g=$(((g1 * 3 + g2) / 4)) + local b=$(((b1 * 3 + b2) / 4)) + selection_bg=$(printf "#%02x%02x%02x" "$r" "$g" "$b") + fi + + # Use contrasting color for selection text if not defined + if [ -z "$selection_fg" ]; then + # Calculate brightness of selection background + local sel_brightness=$(calculate_brightness "$selection_bg") + if [ $sel_brightness -gt 127 ]; then + selection_fg="$bg_color" # Dark text on light selection + else + selection_fg="$fg_color" # Light text on dark selection + fi + fi + + # Extract border color from btop theme + local border_color="" + if [ -f "$CURRENT_THEME_DIR/btop.theme" ]; then + # Look for theme[div_line] in btop theme + local btop_divline=$(grep 'theme\[div_line\]' "$CURRENT_THEME_DIR/btop.theme" | head -1) + + if [ -n "$btop_divline" ]; then + # Extract the color value after the = sign + local extracted=$(echo "$btop_divline" | sed 's/.*=//' | xargs) + + # Check if it's a hex color and lowercase it + if [[ $extracted =~ ^#[0-9a-fA-F]{6}$ ]]; then + border_color=$(echo "$extracted" | tr '[:upper:]' '[:lower:]') + elif [[ $extracted =~ ^[0-9a-fA-F]{6}$ ]]; then + # Add # if missing and lowercase + border_color=$(echo "#$extracted" | tr '[:upper:]' '[:lower:]') + fi + fi + fi + + # Fallback if no border color found + if [ -z "$border_color" ]; then + # Use a color between bg and fg + read -r r1 g1 b1 <<<"$(hex_to_rgb "$bg_color")" + read -r r2 g2 b2 <<<"$(hex_to_rgb "$fg_color")" + local r=$(((r1 + r2) / 3)) # Closer to background + local g=$(((g1 + g2) / 3)) + local b=$(((b1 + b2) / 3)) + border_color=$(printf "#%02x%02x%02x" "$r" "$g" "$b") + fi + + # Get unique colors array (without bg/fg) sorted by frequency + local -a unique_colors + readarray -t unique_colors < <(echo "$filtered_data" | sort_colors_by_frequency) + + # Fill the 13 color slots (code colors handled separately) + local -a color_slots + readarray -t color_slots < <(fill_color_slots "${unique_colors[@]}" | tr ' ' '\n') + + # Extract fonts + local monospace_font="CaskaydiaMono Nerd Font" + local ui_font="Liberation Sans" + + if [ -f "$CURRENT_THEME_DIR/alacritty.toml" ]; then + local alacritty_font=$(grep -A 5 "\[font\]" "$CURRENT_THEME_DIR/alacritty.toml" | grep 'family = ' | head -1 | cut -d'"' -f2) + [ -n "$alacritty_font" ] && monospace_font="$alacritty_font" + fi + + if [ -f "$HOME/.config/fontconfig/fonts.conf" ]; then + local fontconfig_mono=$(xmlstarlet sel -t -v '//match[@target="pattern"][test/string="monospace"]/edit[@name="family"]/string' "$HOME/.config/fontconfig/fonts.conf" 2>/dev/null || true) + [ -n "$fontconfig_mono" ] && monospace_font="$fontconfig_mono" + + local fontconfig_sans=$(xmlstarlet sel -t -v '//match[@target="pattern"][test/string="sans-serif"]/edit[@name="family"]/string' "$HOME/.config/fontconfig/fonts.conf" 2>/dev/null || true) + [ -n "$fontconfig_sans" ] && ui_font="$fontconfig_sans" + fi + + # Generate CSS with 14-slot system + cat </dev/null || echo "unknown")") */ +/* Colors sorted by frequency, backgrounds by distance */ + +.theme-dark, .theme-light { + /* Core colors */ + --background-primary: $bg_color; + --text-normal: $fg_color; + + /* Background variations (always distance-based) */ + --background-primary-alt: $bg_primary_alt; + --background-secondary: $bg_secondary; + --background-secondary-alt: $bg_secondary_alt; + + /* Code block colors (always distance-based) */ + --code-background: $code_bg; + --code-foreground: $code_fg; + + /* Border color from btop theme */ + --border-color: $border_color; + + /* Selection colors from Alacritty */ + --text-selection: $selection_bg; + --text-selection-fg: $selection_fg; + + /* 13-slot color system for remaining elements */ + --text-title-h1: ${color_slots[0]}; + --text-title-h2: ${color_slots[1]}; + --text-title-h3: ${color_slots[2]}; + --text-title-h4: ${color_slots[3]}; + --text-title-h5: ${color_slots[4]}; + --text-title-h6: ${color_slots[4]}; /* Same as h5 */ + --text-link: ${color_slots[5]}; + --markup-code: ${color_slots[6]}; + --text-mark: ${color_slots[7]}; + --interactive-accent: ${color_slots[8]}; + --blockquote-border: ${color_slots[9]}; + --text-muted: $border_color; /* Use border color for muted text */ + --text-faint: $border_color; /* Use border color for faint text */ + + /* Additional mappings */ + --text-accent: var(--interactive-accent); + --text-accent-hover: var(--interactive-accent); + --text-error: var(--text-title-h1); + --text-error-hover: var(--text-title-h1); + --text-highlight-bg: $fg_color; /* Use text color as highlight background */ + --text-on-accent: $bg_color; + + --interactive-normal: var(--code-background); + --interactive-hover: var(--interactive-accent); + --interactive-accent-hover: var(--interactive-accent); + --interactive-success: var(--text-title-h2); + + --scrollbar-bg: var(--background-primary); + --scrollbar-thumb-bg: var(--code-background); + --scrollbar-active-thumb-bg: var(--interactive-accent); + + --background-modifier-border: var(--border-color); + --background-modifier-form-field: var(--code-background); + --background-modifier-form-field-highlighted: var(--code-background); + --background-modifier-box-shadow: rgba(0, 0, 0, 0.3); + --background-modifier-success: var(--interactive-success); + --background-modifier-error: var(--text-error); + --background-modifier-error-hover: var(--text-error); + --background-modifier-cover: rgba(0, 0, 0, 0.8); + + --link-color: var(--text-link); + --link-color-hover: var(--text-link); + --link-unresolved-color: var(--text-muted); + --link-unresolved-opacity: 0.7; + + --tag-color: var(--text-title-h3); + --tag-background: var(--code-background); + + --graph-line: var(--text-muted); + --graph-node: var(--interactive-accent); + --graph-node-unresolved: var(--text-muted); + --graph-node-focused: var(--text-link); + --graph-node-tag: var(--text-title-h3); + --graph-node-attachment: var(--text-title-h2); + + /* Fonts */ + --font-interface-theme: "$ui_font"; + --font-text-theme: "$ui_font"; + --font-monospace-theme: "$monospace_font"; +} + +/* Headers */ +.cm-header-1, .markdown-rendered h1 { color: var(--text-title-h1); } +.cm-header-2, .markdown-rendered h2 { color: var(--text-title-h2); } +.cm-header-3, .markdown-rendered h3 { color: var(--text-title-h3); } +.cm-header-4, .markdown-rendered h4 { color: var(--text-title-h4); } +.cm-header-5, .markdown-rendered h5 { color: var(--text-title-h5); } +.cm-header-6, .markdown-rendered h6 { color: var(--text-title-h6); } + +/* Code blocks */ +.markdown-rendered code { + font-family: var(--font-monospace-theme); + background-color: var(--code-background); + color: var(--markup-code); + padding: 2px 4px; + border-radius: 3px; +} + +.markdown-rendered pre { + background-color: var(--code-background); + border: 1px solid var(--background-modifier-border); + border-radius: 5px; +} + +.markdown-rendered pre code { + background-color: transparent; + color: var(--code-foreground); +} + +/* Syntax highlighting */ +.cm-s-obsidian span.cm-keyword { color: var(--text-title-h1); } +.cm-s-obsidian span.cm-string { color: var(--text-title-h2); } +.cm-s-obsidian span.cm-number { color: var(--text-title-h3); } +.cm-s-obsidian span.cm-comment { color: var(--text-muted); } +.cm-s-obsidian span.cm-operator { color: var(--text-link); } +.cm-s-obsidian span.cm-variable { color: var(--text-normal); } +.cm-s-obsidian span.cm-def { color: var(--text-link); } + +/* Highlighted text */ +.markdown-rendered mark, +.cm-s-obsidian span.cm-highlight, +mark { + background-color: var(--text-highlight-bg) !important; + color: var(--code-background) !important; +} + +/* Links */ +.markdown-rendered a { + color: var(--text-link); +} + +/* Blockquotes */ +.markdown-rendered blockquote { + border-left: 4px solid var(--blockquote-border); + padding-left: 1em; +} + +/* Status bar */ +.status-bar { + background-color: var(--code-background); + border-top: 1px solid var(--background-modifier-border); +} + +/* Active file */ +.workspace-leaf.mod-active .workspace-leaf-header-title { + color: var(--interactive-accent); +} + +.nav-file-title.is-active { + background-color: var(--code-background); + color: var(--interactive-accent); +} + +/* Text selection */ +::selection { + background-color: var(--text-selection); + color: var(--text-selection-fg); +} + +/* Search results */ +.search-result-file-title { + color: var(--interactive-accent); +} + +.search-result-file-match { + background-color: var(--code-background); + color: var(--text-normal); + border-left: 3px solid var(--interactive-accent); +} + +.search-result-file-matched-text { + color: var(--code-background); +} + +/* Tables */ +.markdown-rendered table { + border: 1px solid var(--background-modifier-border); +} + +.markdown-rendered th { + background-color: var(--code-background); + color: var(--text-accent); +} + +.markdown-rendered td { + border: 1px solid var(--background-modifier-border); +} + +/* Callouts */ +.callout { + border-left: 4px solid var(--interactive-accent); + background-color: var(--code-background); +} +.callout * { + color: var(--text-normal); +} + +/* Modal dialogs */ +.modal { + background-color: var(--background-primary); + border: 2px solid var(--background-modifier-border); +} + +/* Settings */ +.vertical-tab-header-group-title { + color: var(--interactive-accent); +} + +.vertical-tab-nav-item.is-active { + background-color: var(--code-background); + color: var(--interactive-accent); +} +EOF +} + +# Option handling +if [ "${1:-}" = "--reset" ]; then + echo "♻️ Resetting Omakub themes and registry..." + if [ -f "$VAULTS_FILE" ] && [ -s "$VAULTS_FILE" ]; then + while IFS= read -r vault_path || [ -n "$vault_path" ]; do + case "$vault_path" in ""|\#*) continue ;; esac + vault_path="${vault_path%/}" + vault_name=$(basename "$vault_path") + theme_dir="$vault_path/.obsidian/themes/Omakub" + if [ -d "$theme_dir" ]; then + rm -rf "$theme_dir" + echo " ✅ $vault_name (theme removed)" + else + echo " ℹ️ $vault_name (no theme present)" + fi + done <"$VAULTS_FILE" + fi + rm -f "$VAULTS_FILE" + echo "✅ Registry removed" + exit 0 +fi + +# Main update logic +echo "🔄 Updating Obsidian vaults..." + +# Step 1: ensure registry exists (bootstrap if needed) +ensure_vaults_file + +while IFS= read -r vault_path || [ -n "$vault_path" ]; do + case "$vault_path" in "" | \#*) continue ;; esac + vault_path="${vault_path%/}" + vault_name=$(basename "$vault_path") + + # Step 2: verify path exists; log/skip gracefully if invalid + if [ ! -d "$vault_path" ] || [ ! -d "$vault_path/.obsidian" ]; then + echo " ❌ $vault_name (invalid entry: missing directory or .obsidian)" + continue + fi + + # Ensure theme files exist for this vault + ensure_theme_scaffold "$vault_path" + THEME_DIR="$vault_path/.obsidian/themes/Omakub" + + # Step 3: update theme.css + if [ -f "$CURRENT_THEME_DIR/obsidian.css" ]; then + cp "$CURRENT_THEME_DIR/obsidian.css" "$THEME_DIR/theme.css" + echo " ✅ $vault_name (custom theme)" + else + extract_theme_data >"$THEME_DIR/theme.css" + echo " ✅ $vault_name (generated theme)" + fi +done <"$VAULTS_FILE" diff --git a/bin/omakub-theme-set-terminal b/bin/omakub-theme-set-terminal new file mode 100755 index 000000000..f015199e4 --- /dev/null +++ b/bin/omakub-theme-set-terminal @@ -0,0 +1,7 @@ +#!/bin/bash + +case "$TERMINAL" in +"alacritty") touch ~/.config/alacritty/alacritty.toml ;; +esac + +killall -SIGUSR1 kitty \ No newline at end of file diff --git a/bin/omakub-theme-set-vscode b/bin/omakub-theme-set-vscode new file mode 100755 index 000000000..63eee8b44 --- /dev/null +++ b/bin/omakub-theme-set-vscode @@ -0,0 +1,48 @@ +#!/bin/bash + +# Note: We cannot use `jq` to update settings.json because it’s JSONC (allows comments), +# which jq doesn’t support. + +# Parameters: EDITOR_CMD SETTINGS_PATH SKIP_FLAG EDITOR_NAME +EDITOR_CMD="${1:-code}" +SETTINGS_PATH="${2:-$HOME/.config/Code/User/settings.json}" +SKIP_FLAG="$HOME/.local/state/omakub/toggles/skip-vscode-theme-changes" +EDITOR_NAME="${4:-VS Code}" + +VS_CODE_THEME="$HOME/.config/omakub/current/theme/vscode.json" + +if omakub-cmd-present "$EDITOR_CMD" && [[ ! -f "$SKIP_FLAG" ]]; then + if [[ -f "$VS_CODE_THEME" ]]; then + theme_name=$(jq -r '.name' "$VS_CODE_THEME") + extension=$(jq -r '.extension' "$VS_CODE_THEME") + + # Install $EDITOR_NAME theme extension + if [[ -n "$extension" ]] && ! "$EDITOR_CMD" --list-extensions | grep -Fxq "$extension"; then + "$EDITOR_CMD" --install-extension "$extension" >/dev/null + fi + + # Create config file if there isn't already one + mkdir -p "$(dirname "$SETTINGS_PATH")" + if [[ ! -f "$SETTINGS_PATH" ]]; then + printf '{\n}\n' >"$SETTINGS_PATH" + fi + + # Create a `workbench.colorTheme` entry in settings. + if ! grep -q '"workbench.colorTheme"' "$SETTINGS_PATH"; then + # Insert `"workbench.colorTheme": "",` immediately after the first `{` + # Use sed's first-match range (0,/{/) to only replace the first `{` + sed -i --follow-symlinks -E '0,/\{/{s/\{/{\ "workbench.colorTheme": "",/}' "$SETTINGS_PATH" + fi + + # Update theme + sed -i --follow-symlinks -E \ + "s/(\"workbench.colorTheme\"[[:space:]]*:[[:space:]]*\")[^\"]*(\")/\1$theme_name\2/" \ + "$SETTINGS_PATH" + else + # Remove theme from settings.json when the theme doesn't have $EDITOR_NAME support + if [[ -f "$SETTINGS_PATH" ]]; then + sed -i --follow-symlinks -E 's/\"workbench\.colorTheme\"[[:space:]]*:[^,}]*,?//' "$SETTINGS_PATH" + fi + fi +fi + diff --git a/bin/omakub-theme-update b/bin/omakub-theme-update index 55304a31e..9f3860e4a 100755 --- a/bin/omakub-theme-update +++ b/bin/omakub-theme-update @@ -1,5 +1,7 @@ #!/bin/bash +omakub-refresh-theme + for dir in ~/.config/omakub/themes/*/; do [ -d "$dir" ] && [ ! -L "${dir%/}" ] && echo "Updating: $(basename "$dir")" && git -C "$dir" pull done diff --git a/bin/omakub-tui-install b/bin/omakub-tui-install index a15d364c9..8e08766a7 100755 --- a/bin/omakub-tui-install +++ b/bin/omakub-tui-install @@ -1,16 +1,14 @@ #!/bin/bash -if [ "$#" -ne 4 ]; then +if [ "$#" -ne 3 ]; then echo -e "\e[32mLet's create a TUI shortcut you can start with the app launcher.\n\e[0m" APP_NAME=$(gum input --prompt "Name> " --placeholder "My TUI") APP_EXEC=$(gum input --prompt "Launch Command> " --placeholder "lazydocker or bash -c 'dust; read -n 1 -s'") - WINDOW_STYLE=$(gum choose --header "Window style" float tile) ICON_URL=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG!)") else APP_NAME="$1" APP_EXEC="$2" - WINDOW_STYLE="$3" - ICON_URL="$4" + ICON_URL="$3" fi if [[ -z "$APP_NAME" || -z "$APP_EXEC" || -z "$ICON_URL" ]]; then @@ -20,27 +18,25 @@ fi ICON_DIR="$HOME/.local/share/applications/icons" DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop" -ICON_PATH="$ICON_DIR/$APP_NAME.png" - -mkdir -p "$ICON_DIR" -if ! curl -sL -o "$ICON_PATH" "$ICON_URL"; then - echo "Error: Failed to download icon." - return 1 -fi - -if [[ $WINDOW_STYLE == "float" ]]; then - APP_CLASS="TUI.float" +if [[ ! "$ICON_URL" =~ ^https?:// ]] && [ -f "$ICON_URL" ]; then + ICON_PATH="$ICON_URL" else - APP_CLASS="TUI.tile" + ICON_PATH="$ICON_DIR/$APP_NAME.png" + mkdir -p "$ICON_DIR" + if ! curl -sL -o "$ICON_PATH" "$ICON_URL"; then + echo "Error: Failed to download icon." + exit 1 + fi fi + cat >"$DESKTOP_FILE" </dev/null | grep 'The following packages will be REMOVED:' | wc -l) -gt 0 ]]; then + echo -e "\e[32m\nRemoving unnecessary packages\e[0m" + sudo apt -y autoremove +fi # If Flatpak is installed, update Flatpak packages if ! command -v "flatpak --version" &> /dev/null; then diff --git a/bin/omakub-version b/bin/omakub-version index 8e32cc197..268a95194 100755 --- a/bin/omakub-version +++ b/bin/omakub-version @@ -1,3 +1,2 @@ #!/bin/bash - -git -C "$OMAKUB_PATH" describe --tags $(git -C "$OMAKUB_PATH" rev-list --tags --max-count=1) +cat $OMAKUB_PATH/version diff --git a/bin/omakub-webapp-install b/bin/omakub-webapp-install index db3b73b75..c1ea1fffb 100755 --- a/bin/omakub-webapp-install +++ b/bin/omakub-webapp-install @@ -1,48 +1,88 @@ #!/bin/bash -if [ "$#" -ne 3 ]; then +# omakub-webapp-add: Create a .desktop file for a web app and add it to the "Web Apps" folder. +# Usage: omakub-webapp-add [custom_exec] [mime_types] + +if [ "$#" -lt 3 ]; then echo -e "\e[32mLet's create a new web app you can start with the app launcher.\n\e[0m" APP_NAME=$(gum input --prompt "Name> " --placeholder "My favorite web app") APP_URL=$(gum input --prompt "URL> " --placeholder "https://example.com") - ICON_URL=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG!)") + ICON_REF=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG!)") + CUSTOM_EXEC="" + MIME_TYPES="text/html;text/xml;application/xhtml_xml;" + INTERACTIVE_MODE=true else APP_NAME="$1" APP_URL="$2" - ICON_URL="$3" + ICON_REF="$3" + CUSTOM_EXEC="$4" # Optional custom exec command + MIME_TYPES="$5" # Optional mime types + INTERACTIVE_MODE=false fi -if [[ -z "$APP_NAME" || -z "$APP_URL" || -z "$ICON_URL" ]]; then +# Ensure valid execution +if [[ -z "$APP_NAME" || -z "$APP_URL" || -z "$ICON_REF" ]]; then echo "You must set app name, app URL, and icon URL!" exit 1 fi +# Refer to local icon or fetch remotely from URL ICON_DIR="$HOME/.local/share/applications/icons" -DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop" -ICON_PATH="$ICON_DIR/$APP_NAME.png" - -mkdir -p "$ICON_DIR" +if [[ $ICON_REF =~ ^https?:// ]]; then + ICON_FILE_NAME="$(echo "$APP_NAME" | tr -d ' ').png" + ICON_PATH="$ICON_DIR/$ICON_FILE_NAME" + if curl -sL -o "$ICON_PATH" "$ICON_REF"; then + ICON_PATH="$ICON_PATH" # Use full path for .desktop file + else + echo "Error: Failed to download icon." + exit 1 + fi +else + # If it's a local file, copy it to the standard location + if [[ -f "$ICON_REF" ]]; then + ICON_FILE_NAME="$(echo "$APP_NAME" | tr -d ' ').png" + ICON_PATH="$ICON_DIR/$ICON_FILE_NAME" + cp "$ICON_REF" "$ICON_PATH" + else + # Assume it's already in the correct location or is a theme icon name + ICON_PATH="$ICON_REF" + fi +fi -if ! curl -sL -o "$ICON_PATH" "$ICON_URL"; then - echo "Error: Failed to download icon." - return 1 +# Use custom exec if provided, otherwise default behavior +if [[ -n $CUSTOM_EXEC ]]; then + EXEC_COMMAND="$CUSTOM_EXEC" +else + EXEC_COMMAND="omakub-launch-webapp $APP_URL $APP_NAME" fi +# Create application .desktop file +DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop" + cat >"$DESKTOP_FILE" <>"$DESKTOP_FILE" +fi + chmod +x "$DESKTOP_FILE" -if [ "$#" -ne 3 ]; then +# Add to Web Apps folder in app grid +omakub-app-folder-add "$APP_NAME.desktop" "Web Apps" + +if [[ $INTERACTIVE_MODE == true ]]; then echo -e "You can now find $APP_NAME using the app launcher (SUPER + SPACE)\n" fi diff --git a/bin/omakub-webapp-remove b/bin/omakub-webapp-remove index daf3b0297..3edc47997 100755 --- a/bin/omakub-webapp-remove +++ b/bin/omakub-webapp-remove @@ -1,5 +1,8 @@ #!/bin/bash +# omakub-app-folder-remove: Remove a .desktop file from a specified app folder. +# Usage: omakub-app-folder-remove + ICON_DIR="$HOME/.local/share/applications/icons" DESKTOP_DIR="$HOME/.local/share/applications/" @@ -35,8 +38,8 @@ if [[ ${#APP_NAMES[@]} -eq 0 ]]; then fi for APP_NAME in "${APP_NAMES[@]}"; do + omakub-app-folder-remove "$APP_NAME.desktop" "Web Apps" rm -f "$DESKTOP_DIR/$APP_NAME.desktop" rm -f "$ICON_DIR/$APP_NAME.png" - rm -f "$HOME/.config/omakub/webapp/$APP_NAME" echo "Removed $APP_NAME" done \ No newline at end of file diff --git a/bin/omakub-wofi b/bin/omakub-wofi index d8f03ddf5..849ef3ddb 100755 --- a/bin/omakub-wofi +++ b/bin/omakub-wofi @@ -4,4 +4,4 @@ if pgrep -x wofi > /dev/null; then pkill wofi fi -exec wofi $@ \ No newline at end of file +exec wofi --cache-file=/dev/null $@ \ No newline at end of file diff --git a/boot.sh b/boot.sh index c4a2712ff..00f105465 100755 --- a/boot.sh +++ b/boot.sh @@ -16,9 +16,9 @@ sudo apt-get update >/dev/null sudo apt-get install -y git >/dev/null # Use custom repo if specified, otherwise use default -OMAKUB_REPO="${OMAKUB_REPO:-basecamp/omakub}" +OMAKUB_REPO="${OMAKUB_REPO:-Kasui92/omakube}" -echo -e "\e[32m\nCloning Omakub...\e[0m" +echo -e "\nCloning Omakub from: https://github.com/${OMAKUB_REPO}.git" rm -rf ~/.local/share/omakub git clone https://github.com/$OMAKUB_REPO.git ~/.local/share/omakub >/dev/null diff --git a/config/alacritty/alacritty.toml b/config/alacritty/alacritty.toml index 86b23c099..4752ff5e6 100644 --- a/config/alacritty/alacritty.toml +++ b/config/alacritty/alacritty.toml @@ -3,9 +3,6 @@ import = [ "~/.config/omakub/current/theme/alacritty.toml" ] [env] TERM = "xterm-256color" -[shell] -program = "zellij" - [font] normal = { family = "CaskaydiaMono Nerd Font", style = "Regular" } bold = { family = "CaskaydiaMono Nerd Font", style = "Bold" } @@ -16,12 +13,9 @@ size = 9 padding.x = 14 padding.y = 14 decorations = "None" -opacity = 0.98 - -[selection] -save_to_clipboard = true [keyboard] bindings = [ -{ key = "F11", action = "ToggleFullscreen" } +{ key = "Insert", mods = "Shift", action = "Paste" }, +{ key = "Insert", mods = "Control", action = "Copy" } ] \ No newline at end of file diff --git a/config/btop/btop.conf b/config/btop/btop.conf index 7d2da4e7c..fd3594ddc 100644 --- a/config/btop/btop.conf +++ b/config/btop/btop.conf @@ -1,4 +1,4 @@ -#? Config file for btop v. 1.3.0 +#? Config file for btop #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" @@ -22,7 +22,7 @@ presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:defaul #* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. #* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. -vim_keys = False +vim_keys = True #* Rounded corners on boxes, is ignored if TTY mode is ON. rounded_corners = True diff --git a/config/chromium-flags.conf b/config/chromium-flags.conf index d6d120e60..83b78d40e 100644 --- a/config/chromium-flags.conf +++ b/config/chromium-flags.conf @@ -1,3 +1,4 @@ --ozone-platform=wayland --ozone-platform-hint=wayland --enable-features=TouchpadOverscrollHistoryNavigation +--load-extension=~/.local/share/omakub/default/chromium/extensions/copy-url diff --git a/config/chromium/Default/Preferences b/config/chromium/Default/Preferences new file mode 100644 index 000000000..3b4bc82d3 --- /dev/null +++ b/config/chromium/Default/Preferences @@ -0,0 +1,15 @@ +{ + "extensions": { + "theme": { + "id": "", + "use_system": false, + "use_custom": false + } + }, + "browser": { + "theme": { + "color_scheme": 2, + "user_color": 2 + } + } +} diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf new file mode 100644 index 000000000..88749514d --- /dev/null +++ b/config/kitty/kitty.conf @@ -0,0 +1,31 @@ +include ~/.config/omakub/current/theme/kitty.conf + +# Font +font_family CaskaydiaMono Nerd Font +bold_italic_font auto +font_size 9.0 + +# Window +window_padding_width 14 +window_padding_height 14 +hide_window_decorations yes +show_window_resize_notification no +confirm_os_window_close 0 + +# Keybindings +map ctrl+insert copy_to_clipboard +map shift+insert paste_from_clipboard + +# Allow remote access +single_instance yes +allow_remote_control yes + +# Aesthetics +cursor_shape block +enable_audio_bell no + +# Minimal Tab bar styling +tab_bar_edge bottom +tab_bar_style powerline +tab_powerline_style slanted +tab_title_template {title}{' :{}:'.format(num_windows) if num_windows > 1 else ''} diff --git a/config/nvim/lua/plugins/core.lua b/config/nvim/lua/plugins/core.lua new file mode 100644 index 000000000..947312534 --- /dev/null +++ b/config/nvim/lua/plugins/core.lua @@ -0,0 +1,3 @@ +return { + { "LazyVim/LazyVim", version = "14.15.1" }, +} \ No newline at end of file diff --git a/config/nvim/lua/plugins/snacks-animated-scrolling-off.lua b/config/nvim/lua/plugins/snacks-animated-scrolling-off.lua index cbb0a58e0..ff82210b3 100644 --- a/config/nvim/lua/plugins/snacks-animated-scrolling-off.lua +++ b/config/nvim/lua/plugins/snacks-animated-scrolling-off.lua @@ -5,4 +5,4 @@ return { enabled = false, -- Disable scrolling animations }, }, -} +} \ No newline at end of file diff --git a/config/nvim/plugin/after/transparency.lua b/config/nvim/plugin/after/transparency.lua index d0090f07d..1687e0b52 100644 --- a/config/nvim/plugin/after/transparency.lua +++ b/config/nvim/plugin/after/transparency.lua @@ -42,4 +42,4 @@ vim.api.nvim_set_hl(0, "NotifyINFOBorder", { bg = "none" }) vim.api.nvim_set_hl(0, "NotifyERRORBorder", { bg = "none" }) vim.api.nvim_set_hl(0, "NotifyWARNBorder", { bg = "none" }) vim.api.nvim_set_hl(0, "NotifyTRACEBorder", { bg = "none" }) -vim.api.nvim_set_hl(0, "NotifyDEBUGBorder", { bg = "none" }) +vim.api.nvim_set_hl(0, "NotifyDEBUGBorder", { bg = "none" }) \ No newline at end of file diff --git a/config/omakub/hooks/font-set.sample b/config/omakub/hooks/font-set.sample new file mode 100644 index 000000000..36d8c3ecd --- /dev/null +++ b/config/omakub/hooks/font-set.sample @@ -0,0 +1,7 @@ +#!/bin/bash + +# This hook is called with the snake-cased name of the font that has just been set. +# To put it into use, remove .sample from the name. + +# Example: Show the name of the theme that was just set. +# notify-send "New font" "Your new font is $1" diff --git a/config/omakub/hooks/post-update.sample b/config/omakub/hooks/post-update.sample new file mode 100644 index 000000000..1e429804f --- /dev/null +++ b/config/omakub/hooks/post-update.sample @@ -0,0 +1,7 @@ +#!/bin/bash + +# This hook is called after an Omakub system update has been performed. +# To put it into use, remove .sample from the name. + +# Example: Show notification after the system has been updated. +# notify-send "Update Performed" "Your system is now up to date" diff --git a/config/omakub/hooks/theme-set.sample b/config/omakub/hooks/theme-set.sample new file mode 100644 index 000000000..b2a5fe1d8 --- /dev/null +++ b/config/omakub/hooks/theme-set.sample @@ -0,0 +1,7 @@ +#!/bin/bash + +# This hook is called with the snake-cased name of the theme that has just been set. +# To put it into use, remove .sample from the name. + +# Example: Show the name of the theme that was just set. +# notify-send "New theme" "Your new theme is $1" diff --git a/default/bash/aliases b/default/bash/aliases index 0d949b77c..ccf0b86b4 100644 --- a/default/bash/aliases +++ b/default/bash/aliases @@ -11,7 +11,7 @@ zd() { elif [ -d "$1" ]; then builtin cd "$1" else - z "$@" && printf " \U000F17A9 " && pwd || echo "Error: Directory not found" + z "$@" && printf "\U000F17A9 " && pwd || echo "Error: Directory not found" fi } @@ -23,6 +23,7 @@ alias ....='cd ../../..' # Tools alias g='git' alias d='docker' +alias r='rails' alias bat='batcat' alias lzg='lazygit' alias lzd='lazydocker' @@ -34,6 +35,7 @@ open() { } # Git +alias g='git' alias gcm='git commit -m' alias gcam='git commit -a -m' alias gcad='git commit -a --amend' \ No newline at end of file diff --git a/default/bash/shell b/default/bash/shell index 6ef4c2540..31a0deca5 100644 --- a/default/bash/shell +++ b/default/bash/shell @@ -8,5 +8,6 @@ HISTFILESIZE="${HISTSIZE}" source /usr/share/bash-completion/bash_completion # Set complete path -export PATH="./bin:$HOME/.local/bin:$HOME/.local/share/omakub/bin:$PATH" +export OMAKUB_PATH="$HOME/.local/share/omakub" +export PATH="$OMAKUB_PATH/bin:$PATH" set +h \ No newline at end of file diff --git a/default/chromium/extensions/copy-url/background.js b/default/chromium/extensions/copy-url/background.js new file mode 100644 index 000000000..a2537c50f --- /dev/null +++ b/default/chromium/extensions/copy-url/background.js @@ -0,0 +1,21 @@ +chrome.commands.onCommand.addListener((command) => { + if (command === 'copy-url') { + chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { + const currentTab = tabs[0]; + + chrome.scripting.executeScript({ + target: { tabId: currentTab.id }, + func: () => { + navigator.clipboard.writeText(window.location.href); + } + }).then(() => { + chrome.notifications.create({ + type: 'basic', + iconUrl: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==', + title: ' URL copied to clipboard', + message: '' + }); + }); + }); + } +}); diff --git a/default/chromium/extensions/copy-url/icon.png b/default/chromium/extensions/copy-url/icon.png new file mode 120000 index 000000000..e088259ef --- /dev/null +++ b/default/chromium/extensions/copy-url/icon.png @@ -0,0 +1 @@ +../../../../icon.png \ No newline at end of file diff --git a/default/chromium/extensions/copy-url/manifest.json b/default/chromium/extensions/copy-url/manifest.json new file mode 100644 index 000000000..19604b424 --- /dev/null +++ b/default/chromium/extensions/copy-url/manifest.json @@ -0,0 +1,19 @@ +{ + "manifest_version": 4, + "name": "Copy URL", + "version": "1.0", + "description": "Copy current URL to clipboard, this extension is installed by Omakub", + "permissions": ["activeTab", "scripting", "notifications"], + "icons": { + "16": "icon.png", + "48": "icon.png", + "128": "icon.png" + }, + "commands": { + "copy-url": { + "suggested_key": { "default": "Alt+Shift+L" }, + "description": "Copy URL" + } + }, + "background": { "service_worker": "background.js" } +} diff --git a/install.sh b/install.sh index b5bd050e8..045209110 100644 --- a/install.sh +++ b/install.sh @@ -1,73 +1,18 @@ #!/bin/bash # Exit immediately if a command exits with a non-zero status -set -eE - -show_logo() { - clear - echo -e "\n\e[1;36m$(cat ~/.local/share/omakub/logo.txt)\e[0m" - echo -} - -show_subtext() { - echo "$1" - echo -} - -export PATH="$HOME/.local/share/omakub/bin:$PATH" -OMAKUB_INSTALL=~/.local/share/omakub/install - - -# Preparation -source $OMAKUB_INSTALL/preflight/trap-errors.sh -source $OMAKUB_INSTALL/preflight/guard.sh -source $OMAKUB_INSTALL/preflight/no-sleep.sh -source $OMAKUB_INSTALL/preflight/migrations.sh -source $OMAKUB_INSTALL/preflight/presentation.sh - -# User Inputs -show_logo -show_subtext "Get ready to fill out some configuration... [1/4]" -source $OMAKUB_INSTALL/preflight/identification.sh - -# Packaging -show_logo -show_subtext "Installing packages... [2/4]" -source $OMAKUB_INSTALL/packages.sh -source $OMAKUB_INSTALL/packaging/remove-snap.sh -source $OMAKUB_INSTALL/packaging/fonts.sh -source $OMAKUB_INSTALL/packaging/nvim.sh -source $OMAKUB_INSTALL/packaging/tools.sh -source $OMAKUB_INSTALL/packaging/apps.sh -source $OMAKUB_INSTALL/packaging/webapps.sh -source $OMAKUB_INSTALL/packaging/tuis.sh - -# Configuration -show_logo -show_subtext "Apply Omakub configuration... [3/4]" -source $OMAKUB_INSTALL/config/config.sh -source $OMAKUB_INSTALL/config/git.sh -source $OMAKUB_INSTALL/config/xcompose.sh -source $OMAKUB_INSTALL/config/defaults.sh -source $OMAKUB_INSTALL/config/alacritty.sh -source $OMAKUB_INSTALL/config/firewall.sh -source $OMAKUB_INSTALL/config/hardware/fix-fkeys.sh -source $OMAKUB_INSTALL/config/hardware/framework-text-scaling.sh -source $OMAKUB_INSTALL/config/gnome/app-grid.sh -source $OMAKUB_INSTALL/config/gnome/dock.sh -source $OMAKUB_INSTALL/config/gnome/extensions.sh -source $OMAKUB_INSTALL/config/gnome/hotkeys.sh -source $OMAKUB_INSTALL/config/gnome/settings.sh -source $OMAKUB_INSTALL/config/theme.sh - -# Login -show_logo -show_subtext "Configuring login settings... [4/4]" -source $OMAKUB_INSTALL/login/plymouth.sh -source $OMAKUB_INSTALL/login/gdm3.sh -source $OMAKUB_INSTALL/login/alt-bootloaders.sh - -# Finishing -show_logo -show_subtext "You're done!" -source $OMAKUB_INSTALL/reboot.sh \ No newline at end of file +set -eEo pipefail + +# Define Omakub locations +export OMAKUB_PATH="$HOME/.local/share/omakub" +export OMAKUB_INSTALL="$OMAKUB_PATH/install" +export OMAKUB_INSTALL_LOG_FILE="/var/log/omakub-install.log" +export PATH="$OMAKUB_PATH/bin:$PATH" + +# Install +source "$OMAKUB_INSTALL/helpers/all.sh" +source "$OMAKUB_INSTALL/preflight/all.sh" +source "$OMAKUB_INSTALL/packaging/all.sh" +source "$OMAKUB_INSTALL/config/all.sh" +source "$OMAKUB_INSTALL/login/all.sh" +source "$OMAKUB_INSTALL/post-install/all.sh" \ No newline at end of file diff --git a/install/config/all.sh b/install/config/all.sh new file mode 100644 index 000000000..418c3da52 --- /dev/null +++ b/install/config/all.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +run_logged $OMAKUB_INSTALL/config/config.sh +run_logged $OMAKUB_INSTALL/config/git.sh +run_logged $OMAKUB_INSTALL/config/xcompose.sh +run_logged $OMAKUB_INSTALL/config/mise-work.sh +run_logged $OMAKUB_INSTALL/config/mimetypes.sh +run_logged $OMAKUB_INSTALL/config/localdb.sh +run_logged $OMAKUB_INSTALL/config/hardware/fix-fkeys.sh +run_logged $OMAKUB_INSTALL/config/hardware/fix-framework-text-scaling.sh +run_logged $OMAKUB_INSTALL/config/gnome/app-grid.sh +run_logged $OMAKUB_INSTALL/config/gnome/dock.sh +source $OMAKUB_INSTALL/config/gnome/request-confirm.sh +run_logged $OMAKUB_INSTALL/config/gnome/extensions.sh +run_logged $OMAKUB_INSTALL/config/gnome/hotkeys.sh +run_logged $OMAKUB_INSTALL/config/gnome/settings.sh +run_logged $OMAKUB_INSTALL/config/theme.sh \ No newline at end of file diff --git a/install/config/defaults.sh b/install/config/defaults.sh deleted file mode 100644 index 87200df6d..000000000 --- a/install/config/defaults.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Refresh applications .desktop files -omakub-refresh-applications -update-desktop-database ~/.local/share/applications - -# Make alacritty default terminal emulator -sudo update-alternatives --set x-terminal-emulator /usr/bin/alacritty - -# Use Chromium as the default browser -xdg-settings set default-web-browser chromium.desktop -xdg-mime default chromium.desktop x-scheme-handler/http -xdg-mime default chromium.desktop x-scheme-handler/https diff --git a/install/config/git.sh b/install/config/git.sh index 1a9074ab7..ab83e94cb 100644 --- a/install/config/git.sh +++ b/install/config/git.sh @@ -10,6 +10,7 @@ git config --global alias.br branch git config --global alias.ci commit git config --global alias.st status git config --global pull.rebase true +git config --global init.defaultBranch master # Set identification from install inputs if [[ -n "${OMAKUB_USER_NAME//[[:space:]]/}" ]]; then diff --git a/install/config/gnome/app-grid.sh b/install/config/gnome/app-grid.sh index caa4a2f8a..dca25e14f 100644 --- a/install/config/gnome/app-grid.sh +++ b/install/config/gnome/app-grid.sh @@ -9,4 +9,4 @@ gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folder gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/LibreOffice/ name 'LibreOffice' gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/LibreOffice/ apps "['libreoffice-base.desktop', 'libreoffice-calc.desktop', 'libreoffice-draw.desktop', 'libreoffice-impress.desktop', 'libreoffice-math.desktop', 'libreoffice-startcenter.desktop', 'libreoffice-writer.desktop', 'libreoffice-xsltfilter.desktop']" gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/WebApps/ name 'Web Apps' -gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/WebApps/ apps "['Basecamp.desktop', 'HEY.desktop', 'WhatsApp.desktop', 'Google Photos.desktop', 'Google Contacts.desktop', 'Google Messages.desktop', 'ChatGPT.desktop', 'YouTube.desktop', 'GitHub.desktop', 'X.desktop', 'Figma.desktop', 'Discord.desktop', 'Zoom.desktop']" \ No newline at end of file +gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/WebApps/ apps "['WhatsApp.desktop', 'ChatGPT.desktop', 'YouTube.desktop', 'GitHub.desktop', 'X.desktop']" \ No newline at end of file diff --git a/install/config/gnome/dock.sh b/install/config/gnome/dock.sh index de86721a1..ed56c895a 100644 --- a/install/config/gnome/dock.sh +++ b/install/config/gnome/dock.sh @@ -4,19 +4,14 @@ apps=( "chromium.desktop" "Alacritty.desktop" - "Neovim.desktop" + "nvim.desktop" "code.desktop" "WhatsApp.desktop" - "signal-desktop.desktop" - "Zoom.desktop" "spotify.desktop" - "steam.desktop" "pinta_pinta.desktop" - "md.obsidian.Obsidian.desktop" "Activity.desktop" - "Docker.desktop" - "Omakub.desktop" - "1password.desktop" + "docker.desktop" + "omakub.desktop" "org.gnome.Settings.desktop" "org.gnome.Nautilus.desktop" "localsend_app.desktop" diff --git a/install/config/gnome/extensions.sh b/install/config/gnome/extensions.sh index cbd9575e1..c64dee9af 100644 --- a/install/config/gnome/extensions.sh +++ b/install/config/gnome/extensions.sh @@ -1,16 +1,11 @@ #!/bin/bash -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 @@ -19,6 +14,8 @@ gext install space-bar@luchrioh gext install undecorate@sun.wxg@gmail.com gext install tophat@fflewddur.github.io gext install AlphabeticalAppGrid@stuarthayhurst +gext install gnome-ui-tune@itstime.tech +gext install quick-settings-tweaks@qwreey # 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/ @@ -27,16 +24,18 @@ sudo cp ~/.local/share/gnome-shell/extensions/blur-my-shell\@aunetx/schemas/org. 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/tophat@fflewddur.github.io/schemas/org.gnome.shell.extensions.tophat.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 cp ~/.local/share/gnome-shell/extensions/gnome-ui-tune\@itstime.tech/schemas/org.gnome.shell.extensions.gnome-ui-tune.gschema.xml /usr/share/glib-2.0/schemas/ +sudo cp ~/.local/share/gnome-shell/extensions/quick-settings-tweaks\@qwreey/schemas/org.gnome.shell.extensions.quick-settings-tweaks.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-1 1 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 col-3 1 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 +gsettings set org.gnome.shell.extensions.tactile gap-size 10 # Configure Just Perfection gsettings set org.gnome.shell.extensions.just-perfection animation 2 @@ -74,3 +73,9 @@ gsettings set org.gnome.shell.extensions.tophat network-usage-unit bits # Configure AlphabeticalAppGrid gsettings set org.gnome.shell.extensions.alphabetical-app-grid folder-order-position 'end' + +# Configure Gnome 4x UI Improvements +# default settings are good! + +# Configure [QSTweak] Quick Setting Tweaker +# default settings are good! diff --git a/install/config/gnome/hotkeys.sh b/install/config/gnome/hotkeys.sh index def4984e0..86a54596f 100644 --- a/install/config/gnome/hotkeys.sh +++ b/install/config/gnome/hotkeys.sh @@ -18,6 +18,12 @@ gsettings set org.gnome.desktop.wm.keybindings toggle-fullscreen "['F11'] # Open File Manager (Nautilus) with Super+F (for File) gsettings set org.gnome.settings-daemon.plugins.media-keys home "['f']" +# Open Web Browser (Chromium) with Super+B (for Browser) +gsettings set org.gnome.settings-daemon.plugins.media-keys www "['b']" + +# Remove terminal keybinding (usually Ctrl+Alt+T) to avoid conflicts +gsettings set org.gnome.settings-daemon.plugins.media-keys terminal "[]" + # Use alt for pinned apps gsettings set org.gnome.shell.keybindings switch-to-application-1 "['1']" gsettings set org.gnome.shell.keybindings switch-to-application-2 "['2']" @@ -37,56 +43,41 @@ gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['4 gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['5']" gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['6']" -# Reserve slots for custom keybindings -gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8/', '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9/']" +# Reserve slots for input source switching +gsettings set org.gnome.desktop.wm.keybindings switch-input-source "@as []" + +# Empty the custom keybindings to start fresh +gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "[]" # Set apps launcher (wofi) to Super+Space -gsettings set org.gnome.desktop.wm.keybindings switch-input-source "@as []" -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ name 'Apps Launcher' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ command 'omakub-apps' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/ binding 'space' +omakub-keybinding-add 'Apps Launcher' 'omakub-apps' 'space' # Set flameshot (with the sh fix for starting under Wayland) on alternate print screen key -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ name 'Flameshot' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ command 'sh -c -- "flameshot gui"' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/ binding 'Print' +omakub-keybinding-add 'Flameshot' 'sh -c -- "flameshot gui"' 'Print' + +# Start a new terminal window +omakub-keybinding-add 'New Terminal Window' 'omakub-launch-terminal' 't' -# Start a new alacritty window (rather than just switch to the already open one) -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ name 'New Alacritty Window' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ command 'alacritty' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/ binding '2' +# Start a new gnome-terminal window +omakub-keybinding-add 'New Gnome Terminal Window' 'gnome-terminal --window' 't' -# Start a new Chromium window (rather than just switch to the already open one) -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ name 'New Chromium Window' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ command 'chromium --new-window' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom3/ binding '1' +# Start a new Browser Window (rather than just switch to the already open one) +omakub-keybinding-add 'New Browser Window' 'omakub-launch-browser --new-window' 'b' # Turn brightness down on Apple monitor (requires ASDControl installed) -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/ name 'Apple Brightness Down (ASDControl)' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/ binding 'F1' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom4/ command "sh -c 'asdcontrol \$(asdcontrol --detect /dev/usb/hiddev* 2>/dev/null | grep ^/dev/usb/hiddev | cut -d: -f1) -- -5000'" +omakub-keybinding-add 'Apple Brightness Down (ASDControl)' "sh -c 'asdcontrol \$(asdcontrol --detect /dev/usb/hiddev* 2>/dev/null | grep ^/dev/usb/hiddev | cut -d: -f1) -- -5000'" 'F1' # Turn brightness up on Apple monitor (requires ASDControl installed) -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/ name 'Apple Brightness Up (ASDControl)' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/ binding 'F2' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom5/ command "sh -c 'asdcontrol \$(asdcontrol --detect /dev/usb/hiddev* 2>/dev/null | grep ^/dev/usb/hiddev | cut -d: -f1) -- +5000'" +omakub-keybinding-add 'Apple Brightness Up (ASDControl)' "sh -c 'asdcontrol \$(asdcontrol --detect /dev/usb/hiddev* 2>/dev/null | grep ^/dev/usb/hiddev | cut -d: -f1) -- +5000'" 'F2' # Turn brightness up to max on Apple monitor (requires ASDControl installed) -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/ name 'Apple Brightness Max (ASDControl)' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/ binding 'F2' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom6/ command "sh -c 'asdcontrol \$(asdcontrol --detect /dev/usb/hiddev* 2>/dev/null | grep ^/dev/usb/hiddev | cut -d: -f1) -- +60000'" +omakub-keybinding-add 'Apple Brightness Max (ASDControl)' "sh -c 'asdcontrol \$(asdcontrol --detect /dev/usb/hiddev* 2>/dev/null | grep ^/dev/usb/hiddev | cut -d: -f1) -- +60000'" 'F2' # Set omakub menu to Alt+Super+Space -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7/ name 'Omakub Menu' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7/ command 'omakub-menu' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom7/ binding 'space' +omakub-keybinding-add 'Omakub Menu' 'omakub-menu' 'space' # Set omakub theme switcher to Super+Shift+Control+Space -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8/ name 'Omakub Themes' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8/ command 'omakub-menu theme' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom8/ binding 'space' - -# Set omakub next backgroun to Super+Shift+Control -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9/ name 'Omakub Background Next' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9/ command 'omakub-theme-bg-next' -gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom9/ binding 'space' \ No newline at end of file +omakub-keybinding-add 'Omakub Themes' 'omakub-menu theme' 'space' + +# Set omakub next background to Super+Shift+Control +omakub-keybinding-add 'Omakub Background Next' 'omakub-theme-bg-next' 'space' \ No newline at end of file diff --git a/install/config/gnome/request-confirm.sh b/install/config/gnome/request-confirm.sh new file mode 100644 index 000000000..cd25ebc93 --- /dev/null +++ b/install/config/gnome/request-confirm.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Pause to assure user is ready to accept confirmations +gum confirm "To install Gnome extensions, you need to accept some confirmations. Ready?" diff --git a/install/config/hardware/framework-text-scaling.sh b/install/config/hardware/fix-framework-text-scaling.sh similarity index 100% rename from install/config/hardware/framework-text-scaling.sh rename to install/config/hardware/fix-framework-text-scaling.sh diff --git a/install/config/localdb.sh b/install/config/localdb.sh new file mode 100644 index 000000000..73721488c --- /dev/null +++ b/install/config/localdb.sh @@ -0,0 +1,2 @@ +# Update localdb so that locate will find everything installed +sudo updatedb diff --git a/install/config/mimetypes.sh b/install/config/mimetypes.sh new file mode 100644 index 000000000..6ad0615a9 --- /dev/null +++ b/install/config/mimetypes.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Refresh applications .desktop files +omakub-refresh-applications +update-desktop-database ~/.local/share/applications + +# Make alacritty default terminal emulator +sudo update-alternatives --set x-terminal-emulator /usr/bin/alacritty + +# Open PDFs with the Document Viewer +xdg-mime default org.gnome.Evince.desktop application/pdf + +# Use Chromium as the default browser +xdg-settings set default-web-browser chromium.desktop +xdg-mime default chromium.desktop x-scheme-handler/http +xdg-mime default chromium.desktop x-scheme-handler/https + +# Open video files with mpv +xdg-mime default mpv.desktop video/mp4 +xdg-mime default mpv.desktop video/x-msvideo +xdg-mime default mpv.desktop video/x-matroska +xdg-mime default mpv.desktop video/x-flv +xdg-mime default mpv.desktop video/x-ms-wmv +xdg-mime default mpv.desktop video/mpeg +xdg-mime default mpv.desktop video/ogg +xdg-mime default mpv.desktop video/webm +xdg-mime default mpv.desktop video/quicktime +xdg-mime default mpv.desktop video/3gpp +xdg-mime default mpv.desktop video/3gpp2 +xdg-mime default mpv.desktop video/x-ms-asf +xdg-mime default mpv.desktop video/x-ogm+ogg +xdg-mime default mpv.desktop video/x-theora+ogg +xdg-mime default mpv.desktop application/ogg diff --git a/install/config/mise-work.sh b/install/config/mise-work.sh new file mode 100644 index 000000000..a9062c3f9 --- /dev/null +++ b/install/config/mise-work.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Add ./bin to path for all items in ~/Work +mkdir -p "$HOME/Work" + +cat >"$HOME/Work/.mise.toml" <<'EOF' +[env] +_.path = "{{ cwd }}/bin" +EOF + +mise trust ~/Work/.mise.toml diff --git a/install/config/theme.sh b/install/config/theme.sh index 4a7b14b99..ada2526d5 100644 --- a/install/config/theme.sh +++ b/install/config/theme.sh @@ -30,13 +30,20 @@ gsettings set org.gnome.desktop.background picture-uri-dark "$HOME/.config/omaku gsettings set org.gnome.desktop.background picture-options 'zoom' # Set specific app links for current theme -[ -e ~/.config/nvim/lua/plugins/theme.lua ] && rm ~/.config/nvim/lua/plugins/theme.lua ln -snf ~/.config/omakub/current/theme/neovim.lua ~/.config/nvim/lua/plugins/theme.lua -[ -e ~/.config/btop/themes/current.theme ] && rm ~/.config/btop/themes/current.theme mkdir -p ~/.config/btop/themes ln -snf ~/.config/omakub/current/theme/btop.theme ~/.config/btop/themes/current.theme -[ -e ~/.config/zellij/themes/current.kdl ] && rm ~/.config/zellij/themes/current.kdl mkdir -p ~/.config/zellij/themes ln -snf ~/.config/omakub/current/theme/zellij.kdl ~/.config/zellij/themes/current.kdl + +mkdir -p ~/.config/eza +ln -snf ~/.config/omakub/current/theme/eza.yml ~/.config/eza/theme.yml + +# Add managed policy directories for Chromium and Brave for theme changes +sudo mkdir -p /etc/chromium/policies/managed +sudo chmod a+rw /etc/chromium/policies/managed + +sudo mkdir -p /etc/brave/policies/managed +sudo chmod a+rw /etc/brave/policies/managed diff --git a/install/helpers/all.sh b/install/helpers/all.sh new file mode 100644 index 000000000..86e648b7d --- /dev/null +++ b/install/helpers/all.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +source $OMAKUB_INSTALL/helpers/presentation.sh +source $OMAKUB_INSTALL/helpers/errors.sh +source $OMAKUB_INSTALL/helpers/logging.sh diff --git a/install/helpers/errors.sh b/install/helpers/errors.sh new file mode 100644 index 000000000..8cfdf22ef --- /dev/null +++ b/install/helpers/errors.sh @@ -0,0 +1,92 @@ +# Track if we're already handling an error to prevent double-trapping +ERROR_HANDLING=false + +# Display recent log lines from the install log +show_log_tail() { + if [[ -f $OMAKUB_INSTALL_LOG_FILE ]]; then + echo "Recent installation log:" + tail -10 "$OMAKUB_INSTALL_LOG_FILE" | sed 's/\x1b\[[0-9;]*m//g' | while IFS= read -r line; do + echo " $line" + done + echo + fi +} + +# Display the failed command or script name +show_failed_script_or_command() { + if [[ -n ${CURRENT_SCRIPT:-} ]]; then + gum style "Failed script: $CURRENT_SCRIPT" + else + gum style "Failed command: $BASH_COMMAND" + fi +} + +# Simple output restoration +restore_outputs() { + exec 1>/dev/tty 2>/dev/tty +} + +# Error handler +catch_errors() { + # Prevent recursive error handling + if [[ $ERROR_HANDLING == true ]]; then + return + else + ERROR_HANDLING=true + fi + + # Store exit code immediately before it gets overwritten + local exit_code=$? + + restore_outputs + clear_logo + + gum style --foreground 1 "Omakub installation stopped!" + show_log_tail + + gum style "This command halted with exit code $exit_code:" + show_failed_script_or_command + + # Offer options menu + while true; do + options=() + + # Base options + options+=("Retry installation") + options+=("View full log") + options+=("Exit") + + choice=$(gum choose "${options[@]}" --header "What would you like to do?" --height 6) + + case "$choice" in + "Retry installation") + bash ~/.local/share/omakub/install.sh + break + ;; + "View full log") + if command -v less &>/dev/null; then + less "$OMAKUB_INSTALL_LOG_FILE" + else + tail "$OMAKUB_INSTALL_LOG_FILE" + fi + ;; + "Exit" | "") + exit 1 + ;; + esac + done +} + +# Exit handler - ensures cleanup happens on any exit +exit_handler() { + local exit_code=$? + + # Only run if we're exiting with an error and haven't already handled it + if [[ $exit_code -ne 0 && $ERROR_HANDLING != true ]]; then + catch_errors + fi +} + +# Set up traps +trap catch_errors ERR INT TERM +trap exit_handler EXIT diff --git a/install/helpers/logging.sh b/install/helpers/logging.sh new file mode 100644 index 000000000..20379cbf6 --- /dev/null +++ b/install/helpers/logging.sh @@ -0,0 +1,87 @@ +start_install_log() { + sudo touch "$OMAKUB_INSTALL_LOG_FILE" + sudo chmod 666 "$OMAKUB_INSTALL_LOG_FILE" + + export OMAKUB_START_TIME=$(date '+%Y-%m-%d %H:%M:%S') + echo "=== Omakub Installation Started: $OMAKUB_START_TIME ===" >>"$OMAKUB_INSTALL_LOG_FILE" +} + +stop_install_log() { + if [[ -n ${OMAKUB_INSTALL_LOG_FILE:-} ]]; then + OMAKUB_END_TIME=$(date '+%Y-%m-%d %H:%M:%S') + echo "=== Omakub Installation Completed: $OMAKUB_END_TIME ===" >>"$OMAKUB_INSTALL_LOG_FILE" + echo "" >>"$OMAKUB_INSTALL_LOG_FILE" + echo "=== Installation Time Summary ===" >>"$OMAKUB_INSTALL_LOG_FILE" + + if [ -n "$OMAKUB_START_TIME" ]; then + OMAKUB_START_EPOCH=$(date -d "$OMAKUB_START_TIME" +%s) + OMAKUB_END_EPOCH=$(date -d "$OMAKUB_END_TIME" +%s) + OMAKUB_DURATION=$((OMAKUB_END_EPOCH - OMAKUB_START_EPOCH)) + + OMAKUB_MINS=$((OMAKUB_DURATION / 60)) + OMAKUB_SECS=$((OMAKUB_DURATION % 60)) + + echo "Omakub: ${OMAKUB_MINS}m ${OMAKUB_SECS}s" >>"$OMAKUB_INSTALL_LOG_FILE" + + if [ -n "$ARCH_DURATION" ]; then + TOTAL_DURATION=$((ARCH_DURATION + OMAKUB_DURATION)) + TOTAL_MINS=$((TOTAL_DURATION / 60)) + TOTAL_SECS=$((TOTAL_DURATION % 60)) + echo "Total: ${TOTAL_MINS}m ${TOTAL_SECS}s" >>"$OMAKUB_INSTALL_LOG_FILE" + fi + fi + echo "=================================" >>"$OMAKUB_INSTALL_LOG_FILE" + fi +} + +run_logged() { + local script="$1" + local script_name=$(basename "$script" .sh) + export CURRENT_SCRIPT="$script" + + # ANSI escape codes + local ANSI_CLEAR_LINE="\033[K" # Clear from cursor to end of line + local ANSI_CARRIAGE_RETURN="\r" # Return to start of line + local ANSI_GREEN="\033[32m" # Green color + local ANSI_RED="\033[31m" # Red color + local ANSI_RESET="\033[0m" # Reset all attributes + + # Check if there are any PATH updates to apply + if [[ -f "$HOME/.local/state/omakub/.env_update" ]]; then + source "$HOME/.local/state/omakub/.env_update" + fi + + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >>"$OMAKUB_INSTALL_LOG_FILE" + # Create a temporary file to capture the exit code + local temp_exit_file=$(mktemp) + # Execute the script in background with updated environment + ( + # Source environment updates in the subshell too + [[ -f "$HOME/.local/state/omakub/.env_update" ]] && source "$HOME/.local/state/omakub/.env_update" + bash -c "source '$script'" >"$OMAKUB_INSTALL_LOG_FILE" 2>&1 + echo $? > "$temp_exit_file" + ) & + local bg_pid=$! + # Show spinner while script runs + gum spin --spinner dot --title "Installing $script_name..." -- bash -c " + while kill -0 $bg_pid 2>/dev/null; do + sleep 0.1 + done + " + # Wait for background process to complete and get exit code + wait $bg_pid 2>/dev/null + local exit_code=$(cat "$temp_exit_file") + rm -f "$temp_exit_file" + if [ $exit_code -eq 0 ]; then + # Success - replace the spinner line with completion status + printf "${ANSI_CARRIAGE_RETURN}${ANSI_CLEAR_LINE}${PADDING_LEFT_SPACES}${ANSI_GREEN}✓${ANSI_RESET} Completed $script_name\n" + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >>"$OMAKUB_INSTALL_LOG_FILE" + unset CURRENT_SCRIPT + return 0 + else + # Failure - replace the spinner line with error status + printf "${ANSI_CARRIAGE_RETURN}${ANSI_CLEAR_LINE}${PADDING_LEFT_SPACES}${ANSI_RED}✗${ANSI_RESET} Failed $script_name\n" + echo "[$(date '+%Y-%m-%d %H:%M:%S')] Failed: $script (exit code: $exit_code)" >>"$OMAKUB_INSTALL_LOG_FILE" + return $exit_code + fi +} \ No newline at end of file diff --git a/install/helpers/presentation.sh b/install/helpers/presentation.sh new file mode 100644 index 000000000..a661d83f6 --- /dev/null +++ b/install/helpers/presentation.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# Ensure we have gum available +if ! command -v gum &> /dev/null; then + cd /tmp + GUM_VERSION="0.17.0" + wget -qO gum.deb "https://github.com/charmbracelet/gum/releases/download/v${GUM_VERSION}/gum_${GUM_VERSION}_amd64.deb" + sudo apt-get install -y --allow-downgrades ./gum.deb + rm gum.deb + cd - +fi + + +export LOGO_PATH="$OMAKUB_PATH/logo.txt" + +# Minimal padding for desktop terminal +export PADDING_LEFT=2 +export PADDING_LEFT_SPACES=$(printf "%*s" $PADDING_LEFT "") + +# Tokyo Night theme for gum confirm +export GUM_CONFIRM_PROMPT_FOREGROUND="6" # Cyan for prompt +export GUM_CONFIRM_SELECTED_FOREGROUND="0" # Black text on selected +export GUM_CONFIRM_SELECTED_BACKGROUND="2" # Green background for selected +export GUM_CONFIRM_UNSELECTED_FOREGROUND="7" # White for unselected +export GUM_CONFIRM_UNSELECTED_BACKGROUND="0" # Black background for unselected +export PADDING="0 0 0 $PADDING_LEFT" # Gum Style +export GUM_CHOOSE_PADDING="$PADDING" +export GUM_FILTER_PADDING="$PADDING" +export GUM_INPUT_PADDING="$PADDING" +export GUM_SPIN_PADDING="$PADDING" +export GUM_TABLE_PADDING="$PADDING" +export GUM_CONFIRM_PADDING="$PADDING" + +clear_logo() { + printf "\033[H\033[2J" + gum style --foreground 2 --padding "1 0 0 $PADDING_LEFT" "$(<"$LOGO_PATH")" +} \ No newline at end of file diff --git a/install/login/all.sh b/install/login/all.sh new file mode 100644 index 000000000..f5ca1cf98 --- /dev/null +++ b/install/login/all.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +run_logged $OMAKUB_INSTALL/login/plymouth.sh +run_logged $OMAKUB_INSTALL/login/alt-bootloaders.sh +run_logged $OMAKUB_INSTALL/login/gdm3.sh diff --git a/install/login/alt-bootloaders.sh b/install/login/alt-bootloaders.sh index bff32721b..a2e6d1a84 100644 --- a/install/login/alt-bootloaders.sh +++ b/install/login/alt-bootloaders.sh @@ -1,28 +1,7 @@ #!/bin/bash # Add kernel parameters for Plymouth -if [ -d "/boot/loader/entries" ]; then # systemd-boot - echo "Detected systemd-boot" - - for entry in /boot/loader/entries/*.conf; do - if [ -f "$entry" ]; then - # Skip fallback entries - if [[ "$(basename "$entry")" == *"fallback"* ]]; then - echo "Skipped: $(basename "$entry") (fallback entry)" - continue - fi - - # Skip if splash it already present for some reason - if ! grep -q "splash" "$entry"; then - sudo sed -i '/^options/ s/$/ splash quiet/' "$entry" - else - echo "Skipped: $(basename "$entry") (splash already present)" - fi - fi - done -elif [ -f "/etc/default/grub" ]; then # Grub - echo "Detected grub" - +if [ -f "/etc/default/grub" ]; then # Grub # Backup GRUB config before modifying backup_timestamp=$(date +"%Y%m%d%H%M%S") sudo cp /etc/default/grub "/etc/default/grub.bak.${backup_timestamp}" @@ -48,49 +27,5 @@ elif [ -f "/etc/default/grub" ]; then # Grub # Regenerate grub config sudo grub-mkconfig -o /boot/grub/grub.cfg - else - echo "GRUB already configured with splash kernel parameters" - fi -elif [ -d "/etc/cmdline.d" ]; then # UKI - echo "Detected a UKI setup" - # Relying on mkinitcpio to assemble a UKI - # https://wiki.archlinux.org/title/Unified_kernel_image - if ! grep -q splash /etc/cmdline.d/*.conf; then - # Need splash, create the omakub file - echo "splash" | sudo tee -a /etc/cmdline.d/omakub.conf - fi - if ! grep -q quiet /etc/cmdline.d/*.conf; then - # Need quiet, create or append the omakub file - echo "quiet" | sudo tee -a /etc/cmdline.d/omakub.conf - fi -elif [ -f "/etc/kernel/cmdline" ]; then # UKI Alternate - # Alternate UKI kernel cmdline location - echo "Detected a UKI setup" - - # Backup kernel cmdline config before modifying - backup_timestamp=$(date +"%Y%m%d%H%M%S") - sudo cp /etc/kernel/cmdline "/etc/kernel/cmdline.bak.${backup_timestamp}" - - current_cmdline=$(cat /etc/kernel/cmdline) - - # Add splash and quiet if not present - new_cmdline="$current_cmdline" - if [[ ! "$current_cmdline" =~ splash ]]; then - new_cmdline="$new_cmdline splash" fi - if [[ ! "$current_cmdline" =~ quiet ]]; then - new_cmdline="$new_cmdline quiet" - fi - - # Trim any leading/trailing spaces - new_cmdline=$(echo "$new_cmdline" | xargs) - - # Write new file - echo $new_cmdline | sudo tee /etc/kernel/cmdline -else - echo "" - echo " None of systemd-boot, GRUB, or UKI detected. Please manually add these kernel parameters:" - echo " - splash (to see the graphical splash screen)" - echo " - quiet (for silent boot)" - echo "" fi \ No newline at end of file diff --git a/install/omakub-base.packages b/install/omakub-base.packages new file mode 100644 index 000000000..ac74ee78b --- /dev/null +++ b/install/omakub-base.packages @@ -0,0 +1,64 @@ +# Omakub core package list installed via install/packaging/base.sh + +alacritty +apache2-utils +autoconf +bat +bison +btop +build-essential +cargo +clang +cmake +curl +eza +fd-find +ffmpeg +ffmpegthumbnailer +flatpak +fzf +gir1.2-clutter-1.0 +gir1.2-gtop-2.0 +gnome-shell-extension-manager +gnome-software-plugin-flatpak +gnome-sushi +gnome-tweak-tool +gpg +imagemagick +imv +jq +libffi-dev +libgdbm-dev +libjemalloc2 +libmagickwand-dev +libmysqlclient-dev +libncurses5-dev +libpq-dev +libreadline-dev +libreadline-dev +libsqlite3-0 +libssl-dev +libvips +libyaml-dev +mpv +mupdf +mupdf-tools +pipx +pkg-config +plocate +postgresql-client +postgresql-client-common +python3-nautilus +python3-pip +redis-tools +ripgrep +rustc +sqlite3 +systemd-container +ufw +unzip +wget +wl-clipboard +wofi +zlib1g-dev +zoxide \ No newline at end of file diff --git a/install/packages.sh b/install/packages.sh deleted file mode 100644 index f8a505d06..000000000 --- a/install/packages.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -# Base Packages -packages=( - alacritty - apache2-utils - autoconf - bat - bison - btop - build-essential - cargo - clang - cmake - curl - eza - fd-find - ffmpeg - ffmpegthumbnailer - flatpak - fzf - gir1.2-clutter-1.0 - gir1.2-gtop-2.0 - gnome-shell-extension-manager - gnome-software-plugin-flatpak - gnome-sushi - gnome-tweak-tool - gpg - imagemagick - libffi-dev - libgdbm-dev - libjemalloc2 - libmagickwand-dev - libmysqlclient-dev - libncurses5-dev - libpq-dev - libreadline-dev - libreadline-dev - libsqlite3-0 - libssl-dev - libvips - libyaml-dev - mupdf - mupdf-tools - pipx - pkg-config - plocate - postgresql-client - postgresql-client-common - python3-nautilus - python3-pip - redis-tools - ripgrep - rustc - sqlite3 - systemd-container - ufw - unzip - wget - wl-clipboard - wofi - zlib1g-dev - zoxide -) - -# Install packages -sudo apt install -y "${packages[@]}" \ No newline at end of file diff --git a/install/packaging/all.sh b/install/packaging/all.sh new file mode 100644 index 000000000..060104101 --- /dev/null +++ b/install/packaging/all.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +run_logged $OMAKUB_INSTALL/packaging/base.sh +run_logged $OMAKUB_INSTALL/packaging/remove-snap.sh +run_logged $OMAKUB_INSTALL/packaging/pipx.sh +run_logged $OMAKUB_INSTALL/packaging/fonts.sh +run_logged $OMAKUB_INSTALL/packaging/nvim.sh +run_logged $OMAKUB_INSTALL/packaging/tools.sh +run_logged $OMAKUB_INSTALL/packaging/icons.sh +run_logged $OMAKUB_INSTALL/packaging/apps.sh +run_logged $OMAKUB_INSTALL/packaging/webapps.sh +run_logged $OMAKUB_INSTALL/packaging/tuis.sh + diff --git a/install/packaging/apps.sh b/install/packaging/apps.sh index f2767253a..19bb5cdea 100644 --- a/install/packaging/apps.sh +++ b/install/packaging/apps.sh @@ -8,14 +8,8 @@ apps=( "Flameshot" "LocalSend" "LibreOffice" - "Obsidian" "Pinta" - "Signal" - "Typora" - "VLC" "Xournalpp" - "1password" - "Spotify" ) # Install optional apps diff --git a/install/packaging/base.sh b/install/packaging/base.sh new file mode 100644 index 000000000..bf6e183a5 --- /dev/null +++ b/install/packaging/base.sh @@ -0,0 +1,3 @@ +# Install all base packages +mapfile -t packages < <(grep -v '^#' "$OMAKUB_INSTALL/omakub-base.packages" | grep -v '^$') +sudo apt install -y "${packages[@]}" diff --git a/install/packaging/icons.sh b/install/packaging/icons.sh new file mode 100644 index 000000000..692f395da --- /dev/null +++ b/install/packaging/icons.sh @@ -0,0 +1,4 @@ +# Copy all bundled icons to the applications/icons directory +ICON_DIR="$HOME/.local/share/applications/icons" +mkdir -p "$ICON_DIR" +cp ~/.local/share/omakub/applications/desktop/icons/*.png "$ICON_DIR/" diff --git a/install/packaging/nvim.sh b/install/packaging/nvim.sh index 7d29b4d84..e4f990393 100644 --- a/install/packaging/nvim.sh +++ b/install/packaging/nvim.sh @@ -1,4 +1,4 @@ #!/bin/bash -# Install Neovim +# Install Neovim + LazyVim source ~/.local/share/omakub/applications/install/neovim.sh \ No newline at end of file diff --git a/install/packaging/pipx.sh b/install/packaging/pipx.sh new file mode 100644 index 000000000..8c43285fd --- /dev/null +++ b/install/packaging/pipx.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Install terminaltexteffects +pipx install terminaltexteffects + +# Install gnome-extensions-cli +pipx install gnome-extensions-cli --system-site-packages + +# Install tldr +pipx install tldr + +# Ensure pipx binaries are in PATH +pipx ensurepath + +# Add pipx binaries to PATH for current and future sessions +export PATH="$HOME/.local/bin:$PATH" + +# Also update PATH in the parent shell environment by writing to a temp file +# that can be sourced by the main installation script +mkdir -p "$HOME/.local/state/omakub" +echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >> "$HOME/.local/state/omakub/.env_update" \ No newline at end of file diff --git a/install/packaging/remove-snap.sh b/install/packaging/remove-snap.sh index 6ba020c15..933106291 100644 --- a/install/packaging/remove-snap.sh +++ b/install/packaging/remove-snap.sh @@ -1,29 +1,41 @@ #!/bin/bash -# Remove Snap packages if they exist +# Remove snap packages if they exist remove_snaps() { - snap_pkgs=$(snap list | awk 'NR>1 {print $1}') + local max_attempts=5 + local attempt=0 - for pkg in $snap_pkgs; do - if [[ "$pkg" != "snapd" ]]; then - sudo snap remove --purge "$pkg" 2>/dev/null || true + while [ $attempt -lt $max_attempts ]; do + # Get current snap packages (excluding header line and snapd initially) + local snap_pkgs=$(snap list 2>/dev/null | awk 'NR>1 && $1!="snapd" {print $1}') + + # If no packages found, try to remove snapd itself + if [ -z "$snap_pkgs" ]; then + snap_pkgs=$(snap list 2>/dev/null | awk 'NR>1 && $1=="snapd" {print $1}') fi - done - for pkg in $(snap list | awk 'NR>1 {print $1}'); do - sudo snap remove --purge "$pkg" 2>/dev/null || true - done + # If no packages left, we're done + if [ -z "$snap_pkgs" ]; then + break + fi + + # Remove packages in batch + for pkg in $snap_pkgs; do + sudo snap remove --purge "$pkg" 2>/dev/null || true + done - if [ "$(snap list | wc -l)" -gt 1 ]; then - remove_snaps - fi + ((attempt++)) + # Small delay to let snap system settle + sleep 1 + done } +# Check if snap is installed if command -v snap >/dev/null 2>&1; then remove_snaps >/dev/null - # Remove snapd and gnome-software-plugin-snap without autoremove to avoid removing GNOME packages - sudo apt remove --purge snapd gnome-software-plugin-snap -y >/dev/null 2>&1 || echo -e "\nFailed to remove snapd and gnome-software-plugin-snap. Please remove them manually.\n" + # Remove snapd and gnome-software-plugin-snap + sudo apt remove --purge snapd gnome-software-plugin-snap -y >/dev/null 2>&1 sudo apt clean sudo rm -rf /var/cache/snapd/ /var/lib/snapd/ /var/snap/ /snap /etc/snap >/dev/null 2>&1 rm -rf ~/snap >/dev/null 2>&1 diff --git a/install/packaging/tools.sh b/install/packaging/tools.sh index 87b70f4de..836d473e7 100644 --- a/install/packaging/tools.sh +++ b/install/packaging/tools.sh @@ -5,7 +5,7 @@ sudo add-apt-repository -y ppa:zhangsongcui3371/fastfetch sudo apt update -y sudo apt install -y fastfetch -# Install mise for managing multiple versions of languages. See https://mise.jdx.dev/ +# Install mise sudo install -dm 755 /etc/apt/keyrings wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1>/dev/null echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=$(dpkg --print-architecture)] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list @@ -20,11 +20,31 @@ sudo install zellij /usr/local/bin rm zellij.tar.gz zellij cd - -# Install Starship -source ~/.local/share/omakub/applications/install/starship.sh - # Install Docker source ~/.local/share/omakub/applications/install/docker.sh +# Install LazyDocker +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 +sudo install lazydocker /usr/local/bin +rm lazydocker.tar.gz lazydocker +cd - + # Install GitHub CLI -source ~/.local/share/omakub/applications/install/github-cli.sh \ No newline at end of file +source ~/.local/share/omakub/applications/install/github-cli.sh + +# Install LazyGit +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 +sudo install lazygit /usr/local/bin +rm lazygit.tar.gz lazygit +mkdir -p ~/.config/lazygit/ +touch ~/.config/lazygit/config.yml +cd - + +# Install Starship +source ~/.local/share/omakub/applications/install/starship.sh \ No newline at end of file diff --git a/install/packaging/tuis.sh b/install/packaging/tuis.sh index d72ad31dd..3456eccc8 100644 --- a/install/packaging/tuis.sh +++ b/install/packaging/tuis.sh @@ -1,21 +1,4 @@ #!/bin/bash +ICON_DIR="$HOME/.local/share/applications/icons" -# LazyDocker -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 -sudo install lazydocker /usr/local/bin -rm lazydocker.tar.gz lazydocker -cd - - -# LazyGit -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 -sudo install lazygit /usr/local/bin -rm lazygit.tar.gz lazygit -mkdir -p ~/.config/lazygit/ -touch ~/.config/lazygit/config.yml -cd - \ No newline at end of file +omakub-tui-install "Docker" "lazydocker" "$ICON_DIR/Docker.png" diff --git a/install/packaging/webapps.sh b/install/packaging/webapps.sh index f0a9ee9b3..c8c95d836 100644 --- a/install/packaging/webapps.sh +++ b/install/packaging/webapps.sh @@ -1,12 +1,7 @@ #!/bin/bash -omakub-webapp-install "HEY" https://app.hey.com https://www.hey.com/assets/images/general/hey.png -omakub-webapp-install "Basecamp" https://launchpad.37signals.com https://basecamp.com/assets/images/general/basecamp.png -omakub-webapp-install "WhatsApp" https://web.whatsapp.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/whatsapp.png -omakub-webapp-install "Google Photos" https://photos.google.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/google-photos.png -omakub-webapp-install "Google Contacts" https://contacts.google.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/google-contacts.png -omakub-webapp-install "Google Messages" https://messages.google.com/web/conversations https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/google-messages.png -omakub-webapp-install "ChatGPT" https://chatgpt.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/chatgpt.png -omakub-webapp-install "YouTube" https://youtube.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/youtube.png -omakub-webapp-install "GitHub" https://github.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/github-light.png -omakub-webapp-install "X" https://x.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/x-light.png \ No newline at end of file +omakub-webapp-install "WhatsApp" https://web.whatsapp.com/ WhatsApp.png +omakub-webapp-install "ChatGPT" https://chatgpt.com/ ChatGPT.png +omakub-webapp-install "YouTube" https://youtube.com/ YouTube.png +omakub-webapp-install "GitHub" https://github.com/ GitHub.png +omakub-webapp-install "X" https://x.com/ X.png diff --git a/install/post-install/all.sh b/install/post-install/all.sh new file mode 100644 index 000000000..2cc3b6f3f --- /dev/null +++ b/install/post-install/all.sh @@ -0,0 +1,4 @@ +#!/bin/bash +run_logged $OMAKUB_INSTALL/post-install/revert-no-sleep.sh +run_logged $OMAKUB_INSTALL/post-install/warnings.sh +source $OMAKUB_INSTALL/post-install/finished.sh diff --git a/install/post-install/finished.sh b/install/post-install/finished.sh new file mode 100644 index 000000000..cfe76fd00 --- /dev/null +++ b/install/post-install/finished.sh @@ -0,0 +1,37 @@ +stop_install_log + +# Clean up temporary environment file +rm -f "$HOME/.local/state/omakub/.env_update" + +echo_in_style() { + echo "$1" | tte --canvas-width 0 --anchor-text c --frame-rate 640 print +} + +clear +echo +tte -i ~/.local/share/omakub/logo.txt --canvas-width 0 --anchor-text c --frame-rate 920 laseretch +echo + +# Display installation time if available +if [[ -f $OMAKUB_INSTALL_LOG_FILE ]] && grep -q "Total:" "$OMAKUB_INSTALL_LOG_FILE" 2>/dev/null; then + echo + TOTAL_TIME=$(tail -n 20 "$OMAKUB_INSTALL_LOG_FILE" | grep "^Total:" | sed 's/^Total:[[:space:]]*//') + if [ -n "$TOTAL_TIME" ]; then + echo_in_style "Installed in $TOTAL_TIME" + fi +else + echo_in_style "Finished installing" +fi + +# Exit gracefully if user chooses not to reboot +if gum confirm --padding "0 0 0 $((PADDING_LEFT + 32))" --show-help=false --default --affirmative "Reboot Now" --negative "" ""; then + # Clear screen to hide any shutdown messages + clear + + # Use systemctl if available, otherwise fallback to reboot command + if command -v systemctl &>/dev/null; then + sudo systemctl reboot --no-wall 2>/dev/null + else + sudo reboot 2>/dev/null + fi +fi diff --git a/install/post-install/revert-no-sleep.sh b/install/post-install/revert-no-sleep.sh new file mode 100644 index 000000000..1afc44b68 --- /dev/null +++ b/install/post-install/revert-no-sleep.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# Revert to normal idle and lock settings +gsettings set org.gnome.desktop.screensaver lock-enabled true +gsettings set org.gnome.desktop.session idle-delay 300 \ No newline at end of file diff --git a/install/reboot.sh b/install/post-install/warnings.sh similarity index 60% rename from install/reboot.sh rename to install/post-install/warnings.sh index f64808540..06161e237 100644 --- a/install/reboot.sh +++ b/install/post-install/warnings.sh @@ -1,15 +1,8 @@ #!/bin/bash -# Revert to normal idle and lock settings -gsettings set org.gnome.desktop.screensaver lock-enabled true -gsettings set org.gnome.desktop.session idle-delay 300 - # Warning on x11 sessions to use Wayland instead if [ "$XDG_SESSION_TYPE" = "x11" ]; then echo -e "\e[33m\nWarning: You are currently using an X11 session. It is recommended to switch to a Wayland session for the best experience with Omakub.\e[0m" echo -e "\e[33mYou can select the Wayland session at the login screen by clicking on the gear icon and choosing 'Ubuntu (Wayland)'.\e[0m" echo -fi - -# Logout to pickup changes -gum confirm "Ready to reboot for all settings to take effect?" && sudo reboot \ No newline at end of file +fi \ No newline at end of file diff --git a/install/preflight/all.sh b/install/preflight/all.sh new file mode 100644 index 000000000..b117773c5 --- /dev/null +++ b/install/preflight/all.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +source $OMAKUB_INSTALL/preflight/guard.sh +source $OMAKUB_INSTALL/preflight/begin.sh +source $OMAKUB_INSTALL/preflight/no-sleep.sh +source $OMAKUB_INSTALL/preflight/identification.sh +run_logged $OMAKUB_INSTALL/preflight/migrations.sh diff --git a/install/preflight/begin.sh b/install/preflight/begin.sh new file mode 100644 index 000000000..243e8eaba --- /dev/null +++ b/install/preflight/begin.sh @@ -0,0 +1,5 @@ +clear_logo +gum style --foreground 3 --padding "1 0 0 $PADDING_LEFT" "Installing Omakub..." +gum style --foreground 4 "Logging to: /var/log/omakub-install.log" +echo +start_install_log diff --git a/install/preflight/guard.sh b/install/preflight/guard.sh index 223e2a059..01995e8c8 100644 --- a/install/preflight/guard.sh +++ b/install/preflight/guard.sh @@ -1,7 +1,5 @@ #!/bin/bash -#!/bin/bash - abort() { echo -e "\e[31mOmakub install requires: $1\e[0m" echo diff --git a/install/preflight/presentation.sh b/install/preflight/presentation.sh deleted file mode 100644 index 8293daff4..000000000 --- a/install/preflight/presentation.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -export PATH="$PATH:$HOME/.local/bin" - -# Gum is used for the Omakub commands for tailoring Omakub after the initial install -if ! command -v gum &> /dev/null; then - cd /tmp - GUM_VERSION="0.16.2" # Tested Version - wget -qO gum.deb "https://github.com/charmbracelet/gum/releases/download/v${GUM_VERSION}/gum_${GUM_VERSION}_amd64.deb" - sudo apt-get install -y --allow-downgrades ./gum.deb - rm gum.deb - cd - -fi diff --git a/install/preflight/trap-errors.sh b/install/preflight/trap-errors.sh deleted file mode 100755 index 384931e3c..000000000 --- a/install/preflight/trap-errors.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -# Give people a chance to retry running the installation -catch_errors() { - echo -e "\n\e[31mOmakub installation failed!\e[0m" - echo - echo "This command halted with exit code $?:" - echo "$BASH_COMMAND" - echo - - if command -v gum >/dev/null && gum confirm "Retry installation?"; then - bash ~/.local/share/omakub/install.sh - else - echo "You can retry later by running: bash ~/.local/share/omakub/install.sh" - fi -} - -trap catch_errors ERR diff --git a/migrations/1757320291.sh b/migrations/1757320291.sh index 361e343b1..fe7ded4ed 100644 --- a/migrations/1757320291.sh +++ b/migrations/1757320291.sh @@ -4,12 +4,17 @@ echo -e "\e[32m\nUpdating gum...\e[0m" echo cd /tmp -GUM_VERSION="0.16.2" # Tested Version +GUM_VERSION="0.17.0" # Tested Version wget -qO gum.deb "https://github.com/charmbracelet/gum/releases/download/v${GUM_VERSION}/gum_${GUM_VERSION}_amd64.deb" sudo apt-get install -y --allow-downgrades ./gum.deb rm gum.deb cd - +# Install terminaltexteffects and tdlr via pipx +echo -e "\e[32m\nInstalling terminaltexteffects and tldr via pipx...\e[0m" +echo +pipx install terminaltexteffects tldr + # Install Wofi echo -e "\e[32m\nInstalling wofi...\e[0m" echo @@ -54,6 +59,13 @@ if command -v ulauncher &> /dev/null; then rm -rf ~/.local/share/ulauncher fi +# Remove snap packages +if command -v snap &> /dev/null; then + echo -e "\e[32m\nRemoving snap packages...\e[0m" + echo + source ~/.local/share/omakub/install/packaging/remove-snap.sh +fi + # Configs echo -e "\e[32m\nApplying new Omakub configurations...\e[0m" echo @@ -73,9 +85,9 @@ omakub-refresh-config brave-flags.conf omakub-refresh-config chromium-flags.conf omakub-refresh-config starship.toml +# Wofi and Neovim configs mkdir -p ~/.config/wofi cp -R ~/.local/share/omakub/config/wofi/* ~/.config/wofi - cp -R ~/.local/share/omakub/config/nvim/* ~/.config/nvim/ # Applications @@ -83,19 +95,20 @@ echo -e "\e[32m\nApplying application configurations...\e[0m" echo rm -rf ~/.local/share/applications/About.desktop +rm -rf ~/.local/share/applications/Activity.desktop rm -rf ~/.local/share/applications/Basecamp.desktop +rm -rf ~/.local/share/applications/Docker.desktop rm -rf ~/.local/share/applications/Hey.desktop rm -rf ~/.local/share/applications/Neovim.desktop rm -rf ~/.local/share/applications/Omakub.desktop rm -rf ~/.local/share/applications/WhatsApp.desktop rm -rf ~/.local/share/applications/icons +source ~/.local/share/omakub/install/packaging/icons.sh +source ~/.local/share/omakub/install/packaging/webapps.sh +source ~/.local/share/omakub/install/packaging/tuis.sh source ~/.local/share/omakub/install/config/defaults.sh -omakub-webapp-install "HEY" https://app.hey.com https://www.hey.com/assets/images/general/hey.png -omakub-webapp-install "Basecamp" https://launchpad.37signals.com https://basecamp.com/assets/images/general/basecamp.png -omakub-webapp-install "WhatsApp" https://web.whatsapp.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/whatsapp.png - # Firewall echo -e "\e[32m\nApplying Firewall...\e[0m" echo @@ -103,10 +116,11 @@ echo source ~/.local/share/omakub/install/config/firewall.sh # Hotkeys -echo -e "\e[32m\nApplying Hotkey...\e[0m" +echo -e "\e[32m\nApplying Gnome Settings...\e[0m" echo - +source ~/.local/share/omakub/install/config/gnome/extensions.sh source ~/.local/share/omakub/install/config/gnome/hotkeys.sh +source ~/.local/share/omakub/install/config/gnome/settings.sh # Theme echo -e "\e[32m\nApplying Theme...\e[0m" @@ -124,7 +138,15 @@ source ~/.local/share/omakub/install/login/alt-bootloaders.sh # Migrations echo -e "\e[32m\nTurning off previous migrations...\e[0m" echo -source ~/.local/share/omakub/install/preflight/migrations.sh +MIGRATION_STATE_PATH=~/.local/state/omakub/migrations +CURRENT_MIGRATION=1757320291 + +mkdir -p $MIGRATION_STATE_PATH +for file in ~/.local/share/omakub/migrations/*.sh; do + if [ "$(basename "$file" .sh)" -le "$CURRENT_MIGRATION" ]; then + touch "$MIGRATION_STATE_PATH/$(basename "$file")" + fi +done # Warning on x11 sessions to use Wayland instead if [ "$XDG_SESSION_TYPE" = "x11" ]; then diff --git a/migrations/1761037946.sh b/migrations/1761037946.sh new file mode 100644 index 000000000..73d3ee09c --- /dev/null +++ b/migrations/1761037946.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Update themes with flexoki-light +omakub-refresh-theme diff --git a/migrations/1761047894.sh b/migrations/1761047894.sh new file mode 100644 index 000000000..e92ec8900 --- /dev/null +++ b/migrations/1761047894.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +echo "Copy configs for kitty so they're available as alternative terminal options" + +if [[ ! -f ~/.config/kitty/kitty.conf ]]; then + mkdir -p ~/.config/kitty + cp -Rpf $OMAKUB_PATH/config/kitty/kitty.conf ~/.config/kitty/kitty.conf +fi + +echo "Fix opening in nvim from files manager" +cp -f $OMAKUB_PATH/applications/nvim.desktop ~/.local/share/applications/nvim.desktop + +echo "Install Omakub theme on Obsidian vaults" +omakub-theme-set-obsidian + +echo "Copy over updated application icons" +cp -f $OMAKUB_PATH/applications/desktop/icons/GitHub.png ~/.local/share/applications/icons/ +cp -f $OMAKUB_PATH/applications/desktop/icons/ChatGPT.png ~/.local/share/applications/icons/ +cp -f $OMAKUB_PATH/applications/desktop/icons/X.png ~/.local/share/applications/icons/ + +echo "Remove any active eza theme" +rm -f ~/.config/eza/theme.yml + +echo "Add shift+insert for kitty" +# Add shift+insert paste keybinding to kitty.conf if it doesn't exist +KITTY_CONF="$HOME/.config/kitty/kitty.conf" + +if ! grep -q "map shift+insert paste_from_clipboard" "$KITTY_CONF"; then + sed -i '/map ctrl+insert copy_to_clipboard/a map shift+insert paste_from_clipboard' "$KITTY_CONF" +fi + +echo "Copy hooks examples" +cp -r $OMAKUB_PATH/config/omakub/* $HOME/.config/omakub/ \ No newline at end of file diff --git a/themes/catppuccin-latte/kitty.conf b/themes/catppuccin-latte/kitty.conf new file mode 100644 index 000000000..43cba927b --- /dev/null +++ b/themes/catppuccin-latte/kitty.conf @@ -0,0 +1,78 @@ +## name: Catppuccin Latte 🐑 +## author: Pocco81 (https://github.com/Pocco81) +## license: MIT +## upstream: https://github.com/catppuccin/kitty/blob/main/latte.conf +## blurb: Soothing pastel theme for the high-spirited! + + + +# The basic colors +foreground #4C4F69 +background #EFF1F5 +selection_foreground #EFF1F5 +selection_background #DC8A78 + +# Cursor colors +cursor #DC8A78 +cursor_text_color #EFF1F5 + +# URL underline color when hovering with mouse +url_color #7287FD + +# Kitty window border colors +active_border_color #8839EF +inactive_border_color #7C7F93 +bell_border_color #E64553 + +# OS Window titlebar colors +wayland_titlebar_color system +macos_titlebar_color system + +# Tab bar colors +active_tab_foreground #EFF1F5 +active_tab_background #8839EF +inactive_tab_foreground #4C4F69 +inactive_tab_background #9CA0B0 +tab_bar_background #BCC0CC + +# Colors for marks (marked text in the terminal) +mark1_foreground #EFF1F5 +mark1_background #1E66F5 +mark2_foreground #EFF1F5 +mark2_background #8839EF +mark3_foreground #EFF1F5 +mark3_background #209FB5 + +# The 16 terminal colors + +# black +color0 #4C4F69 +color8 #6C6F85 + +# red +color1 #D20F39 +color9 #D20F39 + +# green +color2 #40A02B +color10 #40A02B + +# yellow +color3 #DF8E1D +color11 #DF8E1D + +# blue +color4 #1E66F5 +color12 #1E66F5 + +# magenta +color5 #EA76CB +color13 #EA76CB + +# cyan +color6 #179299 +color14 #179299 + +# white +color7 #ACB0BE +color15 #ACB0BE diff --git a/themes/catppuccin-latte/neovim.lua b/themes/catppuccin-latte/neovim.lua index 07a53cf8c..d35e0f900 100644 --- a/themes/catppuccin-latte/neovim.lua +++ b/themes/catppuccin-latte/neovim.lua @@ -1,15 +1,4 @@ return { - { - "catppuccin/nvim", - name = "catppuccin", - priority = 1000, - config = function() - require("catppuccin").setup({ - flavour = "latte", -- other options: "mocha", "frappe", "macchiato" - }) - vim.cmd.colorscheme("catppuccin-latte") - end, - }, { "LazyVim/LazyVim", opts = { diff --git a/themes/catppuccin-latte/vscode.json b/themes/catppuccin-latte/vscode.json new file mode 100644 index 000000000..98d111381 --- /dev/null +++ b/themes/catppuccin-latte/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Catppuccin Latte", + "extension": "catppuccin.catppuccin-vsc" +} diff --git a/themes/catppuccin-latte/vscode.theme b/themes/catppuccin-latte/vscode.theme deleted file mode 100644 index 5820f04e5..000000000 --- a/themes/catppuccin-latte/vscode.theme +++ /dev/null @@ -1,2 +0,0 @@ -vscode[theme]="Catppuccin Latte" -vscode[extension]="Catppuccin.catppuccin-vsc" \ No newline at end of file diff --git a/themes/catppuccin/alacritty.toml b/themes/catppuccin/alacritty.toml index 05cc7011a..7762dcdbd 100644 --- a/themes/catppuccin/alacritty.toml +++ b/themes/catppuccin/alacritty.toml @@ -1,75 +1,65 @@ [colors.primary] -background = "#24273a" -foreground = "#cad3f5" -dim_foreground = "#8087a2" -bright_foreground = "#cad3f5" +background = "#1e1e2e" +foreground = "#cdd6f4" +dim_foreground = "#7f849c" +bright_foreground = "#cdd6f4" [colors.cursor] -text = "#24273a" -cursor = "#f4dbd6" +text = "#1e1e2e" +cursor = "#f5e0dc" [colors.vi_mode_cursor] -text = "#24273a" -cursor = "#b7bdf8" +text = "#1e1e2e" +cursor = "#b4befe" [colors.search.matches] -foreground = "#24273a" -background = "#a5adcb" +foreground = "#1e1e2e" +background = "#a6adc8" [colors.search.focused_match] -foreground = "#24273a" -background = "#a6da95" +foreground = "#1e1e2e" +background = "#a6e3a1" [colors.footer_bar] -foreground = "#24273a" -background = "#a5adcb" +foreground = "#1e1e2e" +background = "#a6adc8" [colors.hints.start] -foreground = "#24273a" -background = "#eed49f" +foreground = "#1e1e2e" +background = "#f9e2af" [colors.hints.end] -foreground = "#24273a" -background = "#a5adcb" +foreground = "#1e1e2e" +background = "#a6adc8" [colors.selection] -text = "#24273a" -background = "#f4dbd6" +text = "#1e1e2e" +background = "#f5e0dc" [colors.normal] -black = "#494d64" -red = "#ed8796" -green = "#a6da95" -yellow = "#eed49f" -blue = "#8aadf4" -magenta = "#f5bde6" -cyan = "#8bd5ca" -white = "#b8c0e0" +black = "#45475a" +red = "#f38ba8" +green = "#a6e3a1" +yellow = "#f9e2af" +blue = "#89b4fa" +magenta = "#f5c2e7" +cyan = "#94e2d5" +white = "#bac2de" [colors.bright] -black = "#5b6078" -red = "#ed8796" -green = "#a6da95" -yellow = "#eed49f" -blue = "#8aadf4" -magenta = "#f5bde6" -cyan = "#8bd5ca" -white = "#a5adcb" - -[colors.dim] -black = "#494d64" -red = "#ed8796" -green = "#a6da95" -yellow = "#eed49f" -blue = "#8aadf4" -magenta = "#f5bde6" -cyan = "#8bd5ca" -white = "#b8c0e0" +black = "#585b70" +red = "#f38ba8" +green = "#a6e3a1" +yellow = "#f9e2af" +blue = "#89b4fa" +magenta = "#f5c2e7" +cyan = "#94e2d5" +white = "#a6adc8" [[colors.indexed_colors]] index = 16 -color = "#f5a97f" +color = "#fab387" [[colors.indexed_colors]] index = 17 -color = "#f4dbd6" +color = "#f5e0dc" diff --git a/themes/catppuccin/kitty.conf b/themes/catppuccin/kitty.conf new file mode 100644 index 000000000..e8ee9a1aa --- /dev/null +++ b/themes/catppuccin/kitty.conf @@ -0,0 +1,78 @@ +## name: Catppuccin Mocha 🌿 +## author: Pocco81 (https://github.com/Pocco81) +## license: MIT +## upstream: https://github.com/catppuccin/kitty/blob/main/mocha.conf +## blurb: Soothing pastel theme for the high-spirited! + + + +# The basic colors +foreground #CDD6F4 +background #1E1E2E +selection_foreground #1E1E2E +selection_background #F5E0DC + +# Cursor colors +cursor #F5E0DC +cursor_text_color #1E1E2E + +# URL underline color when hovering with mouse +url_color #B4BEFE + +# Kitty window border colors +active_border_color #CBA6F7 +inactive_border_color #8E95B3 +bell_border_color #EBA0AC + +# OS Window titlebar colors +wayland_titlebar_color system +macos_titlebar_color system + +# Tab bar colors +active_tab_foreground #11111B +active_tab_background #CBA6F7 +inactive_tab_foreground #CDD6F4 +inactive_tab_background #181825 +tab_bar_background #11111B + +# Colors for marks (marked text in the terminal) +mark1_foreground #1E1E2E +mark1_background #87B0F9 +mark2_foreground #1E1E2E +mark2_background #CBA6F7 +mark3_foreground #1E1E2E +mark3_background #74C7EC + +# The 16 terminal colors + +# black +color0 #43465A +color8 #43465A + +# red +color1 #F38BA8 +color9 #F38BA8 + +# green +color2 #A6E3A1 +color10 #A6E3A1 + +# yellow +color3 #F9E2AF +color11 #F9E2AF + +# blue +color4 #87B0F9 +color12 #87B0F9 + +# magenta +color5 #F5C2E7 +color13 #F5C2E7 + +# cyan +color6 #94E2D5 +color14 #94E2D5 + +# white +color7 #CDD6F4 +color15 #A1A8C9 diff --git a/themes/catppuccin/neovim.lua b/themes/catppuccin/neovim.lua index dbe34f5ee..8d1e00707 100644 --- a/themes/catppuccin/neovim.lua +++ b/themes/catppuccin/neovim.lua @@ -1,4 +1,15 @@ return { + { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + config = function() + require("catppuccin").setup({ + flavour = "latte", + }) + vim.cmd.colorscheme("catppuccin-latte") + end, + }, { "LazyVim/LazyVim", opts = { diff --git a/themes/catppuccin/vscode.json b/themes/catppuccin/vscode.json new file mode 100644 index 000000000..a94d2cf8f --- /dev/null +++ b/themes/catppuccin/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Catppuccin Mocha", + "extension": "catppuccin.catppuccin-vsc" +} diff --git a/themes/catppuccin/vscode.theme b/themes/catppuccin/vscode.theme deleted file mode 100644 index eacd1bfa0..000000000 --- a/themes/catppuccin/vscode.theme +++ /dev/null @@ -1,2 +0,0 @@ -vscode[theme]="Catppuccin Macchiato" -vscode[extension]="Catppuccin.catppuccin-vsc" \ No newline at end of file diff --git a/themes/everforest/kitty.conf b/themes/everforest/kitty.conf new file mode 100644 index 000000000..07cea61f9 --- /dev/null +++ b/themes/everforest/kitty.conf @@ -0,0 +1,69 @@ +## name: Everforest Dark Hard +## author: Sainnhe Park +## license: MIT +## upstream: https://github.com/ewal/kitty-everforest/blob/master/themes/everforest_dark_hard.conf +## blurb: A green based color scheme designed to be warm and soft + +foreground #d3c6aa +background #272e33 +selection_foreground #9da9a0 +selection_background #464e53 + +cursor #d3c6aa +cursor_text_color #2e383c + +url_color #7fbbb3 + +active_border_color #a7c080 +inactive_border_color #4f5b58 +bell_border_color #e69875 +visual_bell_color none + +wayland_titlebar_color system +macos_titlebar_color system + +active_tab_background #272e33 +active_tab_foreground #d3c6aa +inactive_tab_background #374145 +inactive_tab_foreground #9da9a0 +tab_bar_background #2e383c +tab_bar_margin_color none + +mark1_foreground #272e33 +mark1_background #7fbbb3 +mark2_foreground #272e33 +mark2_background #d3c6aa +mark3_foreground #272e33 +mark3_background #d699b6 + +#: black +color0 #343f44 +color8 #868d80 + +#: red +color1 #e67e80 +color9 #e67e80 + +#: green +color2 #a7c080 +color10 #a7c080 + +#: yellow +color3 #dbbc7f +color11 #dbbc7f + +#: blue +color4 #7fbbb3 +color12 #7fbbb3 + +#: magenta +color5 #d699b6 +color13 #d699b6 + +#: cyan +color6 #83c092 +color14 #83c092 + +#: white +color7 #859289 +color15 #9da9a0 diff --git a/themes/everforest/vscode.json b/themes/everforest/vscode.json new file mode 100644 index 000000000..02b107d06 --- /dev/null +++ b/themes/everforest/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Everforest Dark", + "extension": "sainnhe.everforest" +} diff --git a/themes/everforest/vscode.theme b/themes/everforest/vscode.theme deleted file mode 100644 index 5ead15b5b..000000000 --- a/themes/everforest/vscode.theme +++ /dev/null @@ -1,2 +0,0 @@ -vscode[theme]="Everforest Dark" -vscode[extension]="sainnhe.everforest" \ No newline at end of file diff --git a/themes/flexoki-light/alacritty.toml b/themes/flexoki-light/alacritty.toml new file mode 100644 index 000000000..e59fce8b9 --- /dev/null +++ b/themes/flexoki-light/alacritty.toml @@ -0,0 +1,39 @@ +[colors.bright] +black = "#100F0F" +blue = "#205EA6" +cyan = "#3AA99F" +green = "#879A39" +magenta = "#CE5D97" +red = "#D14D41" +white = "#FFFCF0" +yellow = "#D0A215" + +[colors.cursor] +cursor = "#100F0F" +text = "#FFFCF0" + +[colors.dim] +black = "#100F0F" +blue = "#205EA6" +cyan = "#3AA99F" +green = "#879A39" +magenta = "#CE5D97" +red = "#D14D41" +white = "#FFFCF0" +yellow = "#D0A215" + +[colors.normal] +black = "#100F0F" +blue = "#205EA6" +cyan = "#3AA99F" +green = "#879A39" +magenta = "#CE5D97" +red = "#D14D41" +white = "#FFFCF0" +yellow = "#D0A215" + +[colors.primary] +background = "#FFFCF0" +bright_foreground = "#100F0F" +dim_foreground = "#100F0F" +foreground = "#100F0F" diff --git a/themes/flexoki-light/backgrounds/1-flexoki-light-orb.png b/themes/flexoki-light/backgrounds/1-flexoki-light-orb.png new file mode 100644 index 000000000..a564a176e Binary files /dev/null and b/themes/flexoki-light/backgrounds/1-flexoki-light-orb.png differ diff --git a/themes/flexoki-light/backgrounds/2-flexoki-light-omarchy.png b/themes/flexoki-light/backgrounds/2-flexoki-light-omarchy.png new file mode 100644 index 000000000..cc755b1f9 Binary files /dev/null and b/themes/flexoki-light/backgrounds/2-flexoki-light-omarchy.png differ diff --git a/themes/flexoki-light/btop.theme b/themes/flexoki-light/btop.theme new file mode 100644 index 000000000..0caf9c654 --- /dev/null +++ b/themes/flexoki-light/btop.theme @@ -0,0 +1,78 @@ +# Main bg +theme[main_bg]="#FFFCF0" + +# Main text color +theme[main_fg]="#100F0F" + +# Title color for boxes +theme[title]="#100F0F" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#205EA6" + +# Background color of selected item in processes box +theme[selected_bg]="#414868" + +# Foreground color of selected item in processes box +theme[selected_fg]="#100F0F" + +# Color of inactive/disabled text +theme[inactive_fg]="#6F6E69" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#205EA6" + +# Cpu box outline color +theme[cpu_box]="#6F6E69" + +# Memory/disks box outline color +theme[mem_box]="#6F6E69" + +# Net up/down box outline color +theme[net_box]="#6F6E69" + +# Processes box outline color +theme[proc_box]="#6F6E69" + +# Box divider line and small boxes line color +theme[div_line]="#6F6E69" + +# Temperature graph colors +theme[temp_start]="#66800B" +theme[temp_mid]="#BC5215" +theme[temp_end]="#AF3029" + +# CPU graph colors +theme[cpu_start]="#66800B" +theme[cpu_mid]="#BC5215" +theme[cpu_end]="#AF3029" + +# Mem/Disk free meter +theme[free_start]="#66800B" +theme[free_mid]="#BC5215" +theme[free_end]="#AF3029" + +# Mem/Disk cached meter +theme[cached_start]="#66800B" +theme[cached_mid]="#BC5215" +theme[cached_end]="#AF3029" + +# Mem/Disk available meter +theme[available_start]="#66800B" +theme[available_mid]="#BC5215" +theme[available_end]="#AF3029" + +# Mem/Disk used meter +theme[used_start]="#66800B" +theme[used_mid]="#BC5215" +theme[used_end]="#AF3029" + +# Download graph colors +theme[download_start]="#66800B" +theme[download_mid]="#BC5215" +theme[download_end]="#AF3029" + +# Upload graph colors +theme[upload_start]="#66800B" +theme[upload_mid]="#BC5215" +theme[upload_end]="#AF3029" diff --git a/themes/flexoki-light/chromium.theme b/themes/flexoki-light/chromium.theme new file mode 100644 index 000000000..31cd573a7 --- /dev/null +++ b/themes/flexoki-light/chromium.theme @@ -0,0 +1 @@ +242,240,229 \ No newline at end of file diff --git a/themes/flexoki-light/gnome.theme b/themes/flexoki-light/gnome.theme new file mode 100644 index 000000000..f5ac3db8c --- /dev/null +++ b/themes/flexoki-light/gnome.theme @@ -0,0 +1 @@ +blue \ No newline at end of file diff --git a/themes/flexoki-light/icons.theme b/themes/flexoki-light/icons.theme new file mode 100644 index 000000000..6ce2f147c --- /dev/null +++ b/themes/flexoki-light/icons.theme @@ -0,0 +1 @@ +Yaru-blue diff --git a/themes/flexoki-light/kitty.conf b/themes/flexoki-light/kitty.conf new file mode 100644 index 000000000..c8ee01420 --- /dev/null +++ b/themes/flexoki-light/kitty.conf @@ -0,0 +1,67 @@ +# vim:ft=kitty + +## name: Flexoki (Light) +## author: Kepano +## license: MIT +## upstream: https://raw.githubusercontent.com/kepano/flexoki/main/kitty/flexoki_light.conf +## blurb: An inky color scheme for prose and code + +# The basic colors +foreground #100F0F +background #FFFCF0 +selection_foreground #100F0F +selection_background #CECDC3 + +# Cursor colors +cursor #100F0F +cursor_text_color #FFFCF0 + +# kitty window border colors +active_border_color #D14D41 +inactive_border_color #CECDC3 + +# Tab bar colors +active_tab_foreground #100F0F +active_tab_background #CECDC3 +inactive_tab_foreground #6F6E69 +inactive_tab_background #E6E4D9 + +# The basic 16 colors +# black +color0 #100F0F +color8 #6F6E69 + + +# red +color1 #D14D41 +color9 #AF3029 + + +# green +color2 #879A39 +color10 #66800B + + +# yellow +color3 #D0A215 +color11 #AD8301 + + +# blue +color4 #4385BE +color12 #205EA6 + + +# magenta +color5 #CE5D97 +color13 #A02F6F + + +# cyan +color6 #3AA99F +color14 #24837B + + +# white +color7 #FFFCF0 +color15 #F2F0E5 \ No newline at end of file diff --git a/themes/flexoki-light/light.mode b/themes/flexoki-light/light.mode new file mode 100644 index 000000000..e65461b9b --- /dev/null +++ b/themes/flexoki-light/light.mode @@ -0,0 +1 @@ +# This will set "prefer-light" and use "Adwaita" as the theme \ No newline at end of file diff --git a/themes/flexoki-light/neovim.lua b/themes/flexoki-light/neovim.lua new file mode 100644 index 000000000..381cf5559 --- /dev/null +++ b/themes/flexoki-light/neovim.lua @@ -0,0 +1,15 @@ +return { + { + "kepano/flexoki-neovim", + name = "flexoki", + config = function() + vim.api.nvim_set_option_value("background", "light", {}) + end, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "flexoki-light", + }, + }, +} diff --git a/themes/flexoki-light/tophat.theme b/themes/flexoki-light/tophat.theme new file mode 100644 index 000000000..e3d2f31ad --- /dev/null +++ b/themes/flexoki-light/tophat.theme @@ -0,0 +1 @@ +#205EA6 \ No newline at end of file diff --git a/themes/flexoki-light/vscode.json b/themes/flexoki-light/vscode.json new file mode 100644 index 000000000..00a204567 --- /dev/null +++ b/themes/flexoki-light/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "flexoki-light", + "extension": "shadesOfBuntu.flexoki-light" +} diff --git a/themes/flexoki-light/wofi.css b/themes/flexoki-light/wofi.css new file mode 100644 index 000000000..eab5c59a2 --- /dev/null +++ b/themes/flexoki-light/wofi.css @@ -0,0 +1,6 @@ +@define-color selected-text #205EA6; +@define-color text #100F0F; +@define-color base #FFFCF0; +@define-color base-rgba rgba(255, 252, 240, 0.95); +@define-color border #205EA6; +@define-color foreground #100F0F; diff --git a/themes/flexoki-light/zellij.kdl b/themes/flexoki-light/zellij.kdl new file mode 100644 index 000000000..fc6f264c6 --- /dev/null +++ b/themes/flexoki-light/zellij.kdl @@ -0,0 +1,128 @@ +themes { + current { + text_unselected { + base 28 27 26 + background 255 252 240 + emphasis_0 218 112 44 + emphasis_1 36 131 123 + emphasis_2 102 128 11 + emphasis_3 206 93 151 + } + text_selected { + base 28 27 26 + background 206 205 195 + emphasis_0 218 112 44 + emphasis_1 36 131 123 + emphasis_2 102 128 11 + emphasis_3 206 93 151 + } + ribbon_selected { + base 255 252 240 + background 102 128 11 + emphasis_0 209 77 65 + emphasis_1 218 112 44 + emphasis_2 160 47 111 + emphasis_3 58 169 159 + } + ribbon_unselected { + base 87 86 83 + background 230 228 217 + emphasis_0 218 112 44 + emphasis_1 183 181 172 + emphasis_2 102 128 11 + emphasis_3 206 93 151 + } + table_title { + base 102 128 11 + background 52 51 49 + emphasis_0 218 112 44 + emphasis_1 36 131 123 + emphasis_2 102 128 11 + emphasis_3 206 93 151 + } + table_cell_selected { + base 28 27 26 + background 206 205 195 + emphasis_0 218 112 44 + emphasis_1 36 131 123 + emphasis_2 102 128 11 + emphasis_3 206 93 151 + } + table_cell_unselected { + base 28 27 26 + background 255 252 240 + emphasis_0 218 112 44 + emphasis_1 36 131 123 + emphasis_2 102 128 11 + emphasis_3 206 93 151 + } + list_selected { + base 28 27 26 + background 206 205 195 + emphasis_0 175 48 41 + emphasis_1 188 82 21 + emphasis_2 36 131 123 + emphasis_3 160 47 111 + } + list_unselected { + base 28 27 26 + background 255 252 240 + emphasis_0 175 48 41 + emphasis_1 188 82 21 + emphasis_2 36 131 123 + emphasis_3 160 47 111 + } + frame_selected { + base 102 128 11 + background 255 252 240 + emphasis_0 175 48 41 + emphasis_1 188 82 21 + emphasis_2 36 131 123 + emphasis_3 0 0 0 + } + frame_highlight { + base 188 82 21 + background 255 252 240 + emphasis_0 175 48 41 + emphasis_1 160 47 111 + emphasis_2 36 131 123 + emphasis_3 32 94 166 + } + frame_unselected { + base 183 181 172 + background 0 + emphasis_0 239 159 118 + emphasis_1 153 209 219 + emphasis_2 244 184 228 + emphasis_3 0 + } + exit_code_success { + base 102 128 11 + background 255 252 240 + emphasis_0 36 131 123 + emphasis_1 255 252 240 + emphasis_2 160 47 111 + emphasis_3 32 94 166 + } + exit_code_error { + base 175 48 41 + background 255 252 240 + emphasis_0 188 82 21 + emphasis_1 0 0 0 + emphasis_2 0 0 0 + emphasis_3 0 0 0 + } + multiplayer_user_colors { + player_1 160 47 111 + player_2 32 94 166 + player_3 36 131 123 + player_4 188 82 21 + player_5 102 128 11 + player_6 94 64 157 + player_7 175 48 41 + player_8 173 131 1 + player_9 0 0 0 + player_10 0 0 0 + } + } +} \ No newline at end of file diff --git a/themes/gruvbox/kitty.conf b/themes/gruvbox/kitty.conf new file mode 100644 index 000000000..38b015cc3 --- /dev/null +++ b/themes/gruvbox/kitty.conf @@ -0,0 +1,40 @@ +## name: Gruvbox Dark +## author: Pavel Pertsev +## license: MIT/X11 +## upstream: https://raw.githubusercontent.com/gruvbox-community/gruvbox-contrib/master/kitty/gruvbox-dark.conf + +selection_foreground #ebdbb2 +selection_background #d65d0e + +background #282828 +foreground #ebdbb2 + +color0 #3c3836 +color1 #cc241d +color2 #98971a +color3 #d79921 +color4 #458588 +color5 #b16286 +color6 #689d6a +color7 #a89984 +color8 #928374 +color9 #fb4934 +color10 #b8bb26 +color11 #fabd2f +color12 #83a598 +color13 #d3869b +color14 #8ec07c +color15 #fbf1c7 + +cursor #bdae93 +cursor_text_color #665c54 + +url_color #458588 + +# START_AUTOGENERATED_TAB_STYLE +# Feel free to update these colors manually and remove these comments. +active_tab_foreground #eeeeee +active_tab_background #d65d0e +inactive_tab_foreground #ebdbb2 +inactive_tab_background #202020 +# END_AUTOGENERATED_TAB_STYLE diff --git a/themes/gruvbox/vscode.json b/themes/gruvbox/vscode.json new file mode 100644 index 000000000..e75a9b9fa --- /dev/null +++ b/themes/gruvbox/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Gruvbox Dark Medium", + "extension": "jdinhlife.gruvbox" +} diff --git a/themes/gruvbox/vscode.theme b/themes/gruvbox/vscode.theme deleted file mode 100644 index dc00b2900..000000000 --- a/themes/gruvbox/vscode.theme +++ /dev/null @@ -1,2 +0,0 @@ -vscode[theme]="Gruvbox Dark Medium" -vscode[extension]="jdinhlife.gruvbox" \ No newline at end of file diff --git a/themes/kanagawa/kitty.conf b/themes/kanagawa/kitty.conf new file mode 100644 index 000000000..7122cea5a --- /dev/null +++ b/themes/kanagawa/kitty.conf @@ -0,0 +1,68 @@ +## name: Kanagawa +## author: Tommaso Laurenzi +## license: MIT +## upstream: https://github.com/rebelot/kanagawa.nvim/ +## blurb: NeoVim dark colorscheme inspired by the colors of the famous painting +## by Katsushika Hokusai. + +#: The basic colors + +foreground #dcd7ba +background #1f1f28 +selection_foreground #c8c093 +selection_background #2d4f67 + +#: Cursor colors + +cursor #c8c093 + +#: URL underline color when overing with mouse + +url_color #72a7bc + +#: Tab bar colors + +active_tab_foreground #c8c093 +active_tab_background #1f1f28 +inactive_tab_foreground #727169 +inactive_tab_background #1f1f28 + +#: The basic 16 colors + +#: black +color0 #16161d +color8 #727169 + +#: red +color1 #c34043 +color9 #e82424 + +#: green +color2 #76946a +color10 #98bb6c + +#: yellow +color3 #c0a36e +color11 #e6c384 + +#: blue +color4 #7e9cd8 +color12 #7fb4ca + +#: magenta +color5 #957fb8 +color13 #938aa9 + +#: cyan +color6 #6a9589 +color14 #7aa89f + +#: white +color7 #c8c093 +color15 #dcd7ba + + +#: You can set the remaining 240 colors as color16 to color255. + +color16 #ffa066 +color17 #ff5d62 diff --git a/themes/kanagawa/vscode.json b/themes/kanagawa/vscode.json new file mode 100644 index 000000000..91f753960 --- /dev/null +++ b/themes/kanagawa/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Kanagawa", + "extension": "qufiwefefwoyn.kanagawa" +} diff --git a/themes/kanagawa/vscode.theme b/themes/kanagawa/vscode.theme deleted file mode 100644 index 3bb272590..000000000 --- a/themes/kanagawa/vscode.theme +++ /dev/null @@ -1,2 +0,0 @@ -vscode[theme]="Kanagawa" -vscode[extension]="qufiwefefwoyn.kanagawa" \ No newline at end of file diff --git a/themes/matte-black/backgrounds/2-matte-black-hands.jpg b/themes/matte-black/backgrounds/2-matte-black-hands.jpg new file mode 100644 index 000000000..b76792cb8 Binary files /dev/null and b/themes/matte-black/backgrounds/2-matte-black-hands.jpg differ diff --git a/themes/matte-black/kitty.conf b/themes/matte-black/kitty.conf new file mode 100644 index 000000000..b5ee1da10 --- /dev/null +++ b/themes/matte-black/kitty.conf @@ -0,0 +1,54 @@ +## name: Matte Black + +foreground #bebebe +background #121212 +selection_foreground #121212 +selection_background #333333 + +cursor #eaeaea +cursor_text_color #121212 + +# URL underline color when hovering with mouse +url_color #bebebe + +# Kitty window border colors +active_border_color #595959 +inactive_border_color #595959 +bell_border_color #595959 + +# OS Window titlebar colors +wayland_titlebar_color system +macos_titlebar_color system + +# Tab bar colors +active_tab_foreground #bebebe +active_tab_background #121212 +inactive_tab_foreground #bebebe +inactive_tab_background #121212 +tab_bar_background #bebebe + +# Colors for marks (marked text in the terminal) +mark1_foreground #121212 +mark1_background #404040 +mark2_foreground #121212 +mark2_background #121212 +mark3_foreground #121212 +mark3_background #a6a6a6 + +color0 #333333 +color8 #8a8a8d +color1 #D35F5F +color9 #B91C1C +color2 #FFC107 +color10 #FFC107 +color3 #b91c1c +color11 #b90a0a +color4 #e68e0d +color12 #f59e0b +color5 #D35F5F +color13 #B91C1C +color6 #bebebe +color14 #eaeaea +color7 #bebebe +color15 #ffffff + diff --git a/themes/matte-black/neovim.lua b/themes/matte-black/neovim.lua index 7b3f72b21..183cf555b 100644 --- a/themes/matte-black/neovim.lua +++ b/themes/matte-black/neovim.lua @@ -1,5 +1,5 @@ return { - { "tahayvr/matteblack.nvim", lazy = false, priority = 1000 }, + { "tahayvr/matteblack.nvim", lazy = false, priority = 1000 }, { "LazyVim/LazyVim", opts = { diff --git a/themes/matte-black/vscode.json b/themes/matte-black/vscode.json new file mode 100644 index 000000000..7786fc790 --- /dev/null +++ b/themes/matte-black/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Matte Black", + "extension": "TahaYVR.matteblack" +} diff --git a/themes/matte-black/vscode.theme b/themes/matte-black/vscode.theme deleted file mode 100644 index 3666c58b1..000000000 --- a/themes/matte-black/vscode.theme +++ /dev/null @@ -1,2 +0,0 @@ -vscode[theme]="Matte Black Theme" -vscode[extension]="CleanThemes.matte-black-theme" \ No newline at end of file diff --git a/themes/nord/kitty.conf b/themes/nord/kitty.conf new file mode 100644 index 000000000..91b570ffc --- /dev/null +++ b/themes/nord/kitty.conf @@ -0,0 +1,40 @@ +# Nord Colorscheme for Kitty + +foreground #D8DEE9 +background #2E3440 +selection_foreground #000000 +selection_background #FFFACD +url_color #0087BD +cursor #81A1C1 + +# black +color0 #3B4252 +color8 #4C566A + +# red +color1 #BF616A +color9 #BF616A + +# green +color2 #A3BE8C +color10 #A3BE8C + +# yellow +color3 #EBCB8B +color11 #EBCB8B + +# blue +color4 #81A1C1 +color12 #81A1C1 + +# magenta +color5 #B48EAD +color13 #B48EAD + +# cyan +color6 #88C0D0 +color14 #8FBCBB + +# white +color7 #E5E9F0 +color15 #ECEFF4 diff --git a/themes/nord/vscode.json b/themes/nord/vscode.json new file mode 100644 index 000000000..897b8ba16 --- /dev/null +++ b/themes/nord/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Nord", + "extension": "arcticicestudio.nord-visual-studio-code" +} diff --git a/themes/osaka-jade/alacritty.toml b/themes/osaka-jade/alacritty.toml index 6229daa0b..3cb8513a4 100644 --- a/themes/osaka-jade/alacritty.toml +++ b/themes/osaka-jade/alacritty.toml @@ -16,7 +16,7 @@ white = "#F6F5DD" [colors.bright] black = "#53685B" red = "#db9f9c" -green = "#143614" +green = "#63b07a" yellow = "#E5C736" blue = "#ACD4CF" magenta = "#75bbb3" diff --git a/themes/osaka-jade/kitty.conf b/themes/osaka-jade/kitty.conf new file mode 100644 index 000000000..cd6c84e55 --- /dev/null +++ b/themes/osaka-jade/kitty.conf @@ -0,0 +1,44 @@ +## name :osaka-jade +foreground #C1C497 +background #111C18 +selection_foreground #111C18 +selection_background #C1C497 +cursor #D7C995 +cursor_text_color #000000 +active_tab_foreground #111C18 +active_tab_background #C1C497 +inactive_tab_foreground #C1C497 +inactive_tab_background #111C18 + +# black +color0 #23372B +color8 #53685B + +# red +color1 #FF5345 +color9 #DB9F9C + +# green +color2 #549E6A +color10 #63b07a + +# yellow +color3 #459451 +color11 #E5C736 + +# blue +color4 #509475 +color12 #ACD4CF + +# magenta +color5 #D2689C +color13 #75BBB3 + +# cyan +color6 #2DD5B7 +color14 #8CD3CB + +# white +color7 #F6F5DD +color15 #9EEBB3 + diff --git a/themes/osaka-jade/vscode.json b/themes/osaka-jade/vscode.json new file mode 100644 index 000000000..efe2d63b6 --- /dev/null +++ b/themes/osaka-jade/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Ocean Green: Dark", + "extension": "jovejonovski.ocean-green" +} diff --git a/themes/ristretto/kitty.conf b/themes/ristretto/kitty.conf new file mode 100644 index 000000000..7640e7cc7 --- /dev/null +++ b/themes/ristretto/kitty.conf @@ -0,0 +1,53 @@ +## name : Ristretto + +foreground #e6d9db +background #2c2525 + +selection_foreground #e6d9db +selection_background #403e41 + +cursor #c3b7b8 +cursor_text_color #c3b7b8 + +url_color #e6d9db + +active_border_color #e6d9db +inactive_border_color #595959 +bell_border_color #595959 + +active_tab_foreground #2c2525 +active_tab_background #f9cc6c +inactive_tab_foreground #e6d9db +inactive_tab_background #2c2525 +tab_bar_background #404040 + +mark1_foreground #2c2525 +mark1_background #404040 +mark2_foreground #2c2525 +mark2_background #2c2525 +mark3_foreground #2c2525 +mark3_background #a6a6a6 + +color0 #72696a +color8 #948a8b + +color1 #fd6883 +color9 #ff8297 + +color2 #adda78 +color10 #c8e292 + +color3 #f9cc6c +color11 #fcd675 + +color4 #f38d70 +color12 #f8a788 + +color5 #a8a9eb +color13 #bebffd + +color6 #85dacc +color14 #9bf1e1 + +color7 #e6d9db +color15 #f1e5e7 diff --git a/themes/ristretto/neovim.lua b/themes/ristretto/neovim.lua index 8fae3b8ae..4263da701 100644 --- a/themes/ristretto/neovim.lua +++ b/themes/ristretto/neovim.lua @@ -1,22 +1,31 @@ return { - { - "gthelding/monokai-pro.nvim", - config = function() - require("monokai-pro").setup({ - filter = "ristretto", - override = function() - return { - NonText = { fg = "#948a8b" }, - } - end, - }) - vim.cmd([[colorscheme monokai-pro]]) - end, - }, - { - "LazyVim/LazyVim", - opts = { - colorscheme = "monokai-pro", - }, - }, + { + "gthelding/monokai-pro.nvim", + config = function() + require("monokai-pro").setup({ + filter = "ristretto", + override = function() + return { + NonText = { fg = "#948a8b" }, + MiniIconsGrey = { fg = "#948a8b" }, + MiniIconsRed = { fg = "#fd6883" }, + MiniIconsBlue = { fg = "#85dacc" }, + MiniIconsGreen = { fg = "#adda78" }, + MiniIconsYellow = { fg = "#f9cc6c" }, + MiniIconsOrange = { fg = "#f38d70" }, + MiniIconsPurple = { fg = "#a8a9eb" }, + MiniIconsAzure = { fg = "#a8a9eb" }, + MiniIconsCyan = { fg = "#85dacc" }, -- same value as MiniIconsBlue for consistency + } + end, + }) + vim.cmd([[colorscheme monokai-pro]]) + end, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "monokai-pro", + }, + }, } diff --git a/themes/ristretto/vscode.json b/themes/ristretto/vscode.json new file mode 100644 index 000000000..41a587e1f --- /dev/null +++ b/themes/ristretto/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Monokai Pro (Filter Ristretto)", + "extension": "monokai.theme-monokai-pro-vscode" +} diff --git a/themes/ristretto/vscode.theme b/themes/ristretto/vscode.theme deleted file mode 100644 index a99631939..000000000 --- a/themes/ristretto/vscode.theme +++ /dev/null @@ -1,2 +0,0 @@ -vscode[theme]="Monokai Pro (Filter Ristretto)" -vscode[extension]="monokai.theme-monokai-pro-vscode" \ No newline at end of file diff --git a/themes/rose-pine/kitty.conf b/themes/rose-pine/kitty.conf new file mode 100644 index 000000000..6c021dcaf --- /dev/null +++ b/themes/rose-pine/kitty.conf @@ -0,0 +1,51 @@ +## name: Rose-Pine + +foreground #575279 +background #faf4ed + +selection_foreground #575279 +selection_background #dfdad9 + +cursor #cecacd +cursor_text_color #575279 + +url_color #575279 + +active_border_color #595959 +inactive_border_color #595959 +bell_border_color #595959 + +active_tab_foreground #575279 +active_tab_background #fffaf3 +inactive_tab_foreground #575279 +inactive_tab_background #fffaf3 +tab_bar_background #575279 + +mark1_foreground #faf4ed +mark1_background #fffaf3 +mark2_foreground #9893a5 +mark2_background #fffaf3 + +color0 #f2e9e1 +color8 #9893a5 + +color1 #b4637a +color9 #b4637a + +color2 #286983 +color10 #286983 + +color3 #ea9d34 +color11 #ea9d34 + +color4 #56949f +color12 #56949f + +color5 #907aa9 +color13 #907aa9 + +color6 #d7827e +color14 #d7827e + +color7 #575279 +color15 #575279 diff --git a/themes/rose-pine/vscode.json b/themes/rose-pine/vscode.json new file mode 100644 index 000000000..07e0050d8 --- /dev/null +++ b/themes/rose-pine/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Rosé Pine Dawn", + "extension": "mvllow.rose-pine" +} diff --git a/themes/rose-pine/vscode.theme b/themes/rose-pine/vscode.theme deleted file mode 100644 index dc098e80c..000000000 --- a/themes/rose-pine/vscode.theme +++ /dev/null @@ -1,2 +0,0 @@ -vscode[theme]="Rosé Pine Dawn" -vscode[extension]="mvllow.rose-pine" \ No newline at end of file diff --git a/themes/tokyo-night/kitty.conf b/themes/tokyo-night/kitty.conf new file mode 100644 index 000000000..37a5bd270 --- /dev/null +++ b/themes/tokyo-night/kitty.conf @@ -0,0 +1,48 @@ +## name: Tokyo Night +## license: MIT +## author: Folke Lemaitre +## upstream: https://github.com/folke/tokyonight.nvim/raw/main/extras/kitty/tokyonight_night.conf + + +background #1a1b26 +foreground #c0caf5 +selection_background #283457 +selection_foreground #c0caf5 +url_color #73daca +cursor #c0caf5 +cursor_text_color #1a1b26 + +# Tabs +active_tab_background #7aa2f7 +active_tab_foreground #16161e +inactive_tab_background #292e42 +inactive_tab_foreground #545c7e +#tab_bar_background #15161e + +# Windows +active_border_color #7aa2f7 +inactive_border_color #292e42 + +# normal +color0 #15161e +color1 #f7768e +color2 #9ece6a +color3 #e0af68 +color4 #7aa2f7 +color5 #bb9af7 +color6 #7dcfff +color7 #a9b1d6 + +# bright +color8 #414868 +color9 #f7768e +color10 #9ece6a +color11 #e0af68 +color12 #7aa2f7 +color13 #bb9af7 +color14 #7dcfff +color15 #c0caf5 + +# extended colors +color16 #ff9e64 +color17 #db4b4b diff --git a/themes/tokyo-night/vscode.json b/themes/tokyo-night/vscode.json new file mode 100644 index 000000000..89af98c17 --- /dev/null +++ b/themes/tokyo-night/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Tokyo Night", + "extension": "enkia.tokyo-night" +} diff --git a/themes/tokyo-night/vscode.theme b/themes/tokyo-night/vscode.theme deleted file mode 100644 index eac952bf1..000000000 --- a/themes/tokyo-night/vscode.theme +++ /dev/null @@ -1,2 +0,0 @@ -vscode[theme]="Tokyo Night" -vscode[extension]="enkia.tokyo-night" \ No newline at end of file diff --git a/version b/version new file mode 100644 index 000000000..71927a588 --- /dev/null +++ b/version @@ -0,0 +1 @@ +1.0.0-rc1 \ No newline at end of file