diff --git a/bin/omakub-menu b/bin/omakub-menu index 6ed491333..521380592 100755 --- a/bin/omakub-menu +++ b/bin/omakub-menu @@ -122,7 +122,6 @@ show_toggle_menu() { esac } - show_style_menu() { case $(menu "Style" "󰸌 Theme\n Font\n Background") in *Theme*) show_theme_menu ;; @@ -172,7 +171,7 @@ show_setup_menu() { show_setup_system_menu() { local options="" - if [[ -f ~/.local/state/omakub/toggles/suspend-off ]]; then + if omakub-toggle-enable suspend-off; then options="$options󰒲 Enable Suspend" else options="$options󰒲 Disable Suspend" diff --git a/bin/omakub-migrate b/bin/omakub-migrate index 576a95864..da5d55278 100755 --- a/bin/omakub-migrate +++ b/bin/omakub-migrate @@ -10,7 +10,7 @@ mkdir -p "$STATE_DIR" mkdir -p "$STATE_DIR/skipped" # Run any pending migrations -for file in ~/.local/share/omakub/migrations/*.sh; do +for file in $OMAKUB_PATH/migrations/*.sh; do filename=$(basename "$file") if [[ ! -f $STATE_DIR/$filename && ! -f $STATE_DIR/skipped/$filename ]]; then diff --git a/bin/omakub-theme-install b/bin/omakub-theme-install index 6be61e184..fdb73f265 100755 --- a/bin/omakub-theme-install +++ b/bin/omakub-theme-install @@ -15,7 +15,7 @@ if [[ -z $REPO_URL ]]; then fi THEMES_DIR="$HOME/.config/omakub/themes" -THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^(omakub|omakasui)-//; s/-theme$//') +THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^(omakub|omakasui)-//; s/-theme$//' | tr '[:upper:]' '[:lower:]') THEME_PATH="$THEMES_DIR/$THEME_NAME" # Remove existing theme if present diff --git a/bin/omakub-theme-set-vscode b/bin/omakub-theme-set-vscode index af22583f5..0eacd41ec 100755 --- a/bin/omakub-theme-set-vscode +++ b/bin/omakub-theme-set-vscode @@ -7,9 +7,8 @@ VS_CODE_THEME="$HOME/.config/omakub/current/theme/vscode.json" set_theme() { local editor_cmd="$1" local settings_path="$2" - local skip_flag="$3" - omakub-cmd-present "$editor_cmd" && [[ ! -f $skip_flag ]] || return 0 + omakub-cmd-present "$editor_cmd" || return 0 if [[ -f $VS_CODE_THEME ]]; then theme_name=$(jq -r '.name' "$VS_CODE_THEME") @@ -34,7 +33,7 @@ set_theme() { fi } -set_theme "code" "$HOME/.config/Code/User/settings.json" "$HOME/.local/state/omakub/toggles/skip-vscode-theme-changes" -set_theme "code-insiders" "$HOME/.config/Code - Insiders/User/settings.json" "$HOME/.local/state/omakub/toggles/skip-vscode-insiders-theme-changes" -set_theme "codium" "$HOME/.config/VSCodium/User/settings.json" "$HOME/.local/state/omakub/toggles/skip-codium-theme-changes" -set_theme "cursor" "$HOME/.config/Cursor/User/settings.json" "$HOME/.local/state/omakub/toggles/skip-cursor-theme-changes" \ No newline at end of file +! omakub-toggle-enabled skip-vscode-theme-changes && set_theme "code" "$HOME/.config/Code/User/settings.json" "$HOME/.local/state/omakub/toggles/skip-vscode-theme-changes" +! omakub-toggle-enabled skip-vscode-insiders-theme-changes && set_theme "code-insiders" "$HOME/.config/Code - Insiders/User/settings.json" "$HOME/.local/state/omakub/toggles/skip-vscode-insiders-theme-changes" +! omakub-toggle-enabled skip-codium-theme-changes && set_theme "codium" "$HOME/.config/VSCodium/User/settings.json" "$HOME/.local/state/omakub/toggles/skip-codium-theme-changes" +! omakub-toggle-enabled skip-cursor-theme-changes && set_theme "cursor" "$HOME/.config/Cursor/User/settings.json" "$HOME/.local/state/omakub/toggles/skip-cursor-theme-changes" \ No newline at end of file diff --git a/bin/omakub-toggle b/bin/omakub-toggle new file mode 100644 index 000000000..c405317ad --- /dev/null +++ b/bin/omakub-toggle @@ -0,0 +1,28 @@ +#!/bin/bash + +# Toggle Omakub features between enabled and disabled + +ENABLED_NOTIFICATION="" +DISABLED_NOTIFICATION="" +NOTIFICATION_SUMMARY="" + +while [[ $# -gt 1 ]]; do + case $1 in + --notification-summary) NOTIFICATION_SUMMARY="$2"; shift 2 ;; + --enabled-notification) ENABLED_NOTIFICATION="$2"; shift 2 ;; + --disabled-notification) DISABLED_NOTIFICATION="$2"; shift 2 ;; + *) break ;; + esac +done + +FLAG_NAME="$1" +FLAG="$HOME/.local/state/omakub/toggles/$FLAG_NAME" + +if [[ -f $FLAG ]]; then + rm $FLAG + [[ -n $DISABLED_NOTIFICATION ]] && omakub-notify "$NOTIFICATION_SUMMARY" "$DISABLED_NOTIFICATION" +else + mkdir -p "$(dirname $FLAG)" + touch $FLAG + [[ -n $ENABLED_NOTIFICATION ]] && omakub-notify "$NOTIFICATION_SUMMARY" "$ENABLED_NOTIFICATION" +fi diff --git a/bin/omakub-toggle-enable b/bin/omakub-toggle-enable new file mode 100644 index 000000000..c75e0ea5e --- /dev/null +++ b/bin/omakub-toggle-enable @@ -0,0 +1,4 @@ +#!/bin/bash + +# Check if a toggle is enabled (flag file exists) +[[ -f "$HOME/.local/state/omakub/toggles/$1" ]] diff --git a/bin/omakub-toggle-nightlight b/bin/omakub-toggle-nightlight index d1d6e3ae7..d73f990f0 100755 --- a/bin/omakub-toggle-nightlight +++ b/bin/omakub-toggle-nightlight @@ -1,14 +1,13 @@ #!/bin/bash -# Toggle night light feature in GNOME -current_state=$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled) +omakub-toggle \ + --notification-summary "Night Light" \ + --enabled-notification " Nightlight screen temperature" \ + --disabled-notification " Daylight screen temperature" \ + night-light -if [[ $current_state == "true" ]]; then - gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false - sleep 0.5 # Wait for the setting to apply - omakub-notify -u low "Night Light" " Daylight screen temperature" -else +if omakub-toggle-enable night-light; then gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true - sleep 0.5 # Wait for the setting to apply - omakub-notify -u low "Night Light" " Nightlight screen temperature" +else + gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false fi \ No newline at end of file diff --git a/bin/omakub-toggle-suspend b/bin/omakub-toggle-suspend index db47f2458..015866a66 100755 --- a/bin/omakub-toggle-suspend +++ b/bin/omakub-toggle-suspend @@ -1,12 +1,7 @@ #!/bin/bash -STATE_FILE=~/.local/state/omakub/toggles/suspend-off - -if [[ -f $STATE_FILE ]]; then - rm -f $STATE_FILE - omakub-notify -u low "Suspend" "󰒲 Suspend now available in system menu" -else - mkdir -p "$(dirname $STATE_FILE)" - touch $STATE_FILE - omakub-notify -u low "Suspend" "󰒲 Suspend removed from system menu" -fi \ No newline at end of file +omakub-toggle \ + --notification-summary "Suspend" \ + --enabled-notification "󰒲 Suspend removed from system menu" \ + --disabled-notification "󰒲 Suspend now available in system menu" \ + suspend-off \ No newline at end of file diff --git a/config/typora/ia_typora.css b/config/Typora/themes/ia_typora.css similarity index 96% rename from config/typora/ia_typora.css rename to config/Typora/themes/ia_typora.css index 4440439a3..231ca177f 100644 --- a/config/typora/ia_typora.css +++ b/config/Typora/themes/ia_typora.css @@ -1,14 +1,14 @@ :root { --accent-color: #aeb1b5; /* #'s before H1-3 */ --background-color: white; - --border-color: #ddd; - --code-bg-color: #f8f8f8; + --border-color: #ddd; + --code-bg-color: #f8f8f8; --font-color: #42464c; --header-color: #222324; --link-color: #2077b2; --control-text-color: #667176; --side-bar-bg-color: #fafafa; - --body-font: iAWriterMonoS-Regular, monospace, Roboto; + --body-font: "iA Writer Mono S"; --border-radius: 2px; --document-horizontal-margin: 80px; --document-padding-x: 10ch; @@ -21,7 +21,7 @@ --main-content-margin: 0 auto; --main-content-max-width: 85ch; --monospace-font-size: 20px; - --monospace-font: iAWriterMonoS-Regular, monospace; + --monospace-font: "iA Writer Mono S"; --monospace-line-height: 1.6; --monospace: var(--monospace-font); /* Fixes source code mode */ --nav-width: 200px; diff --git a/config/typora/ia_typora_night.css b/config/Typora/themes/ia_typora_night.css similarity index 98% rename from config/typora/ia_typora_night.css rename to config/Typora/themes/ia_typora_night.css index d783d2036..ac0b6c043 100644 --- a/config/typora/ia_typora_night.css +++ b/config/Typora/themes/ia_typora_night.css @@ -8,7 +8,7 @@ --light-header-color: #dbdbdb; /* H1-H3 */ --select-text-bg-color: #186a9a; --accent-color: #4f525a; - --background-color: #101010; + --background-color: #000000; --font-color: #bbbcbc; --header-color: #bebebe; /* H4-H6 */ --border-color: #232629; diff --git a/default/bashrc b/default/bashrc index 844c7acbe..b6bd5fc78 100644 --- a/default/bashrc +++ b/default/bashrc @@ -6,7 +6,7 @@ source ~/.local/share/omakub/default/bash/rc # # Make an alias for invoking commands you use constantly # alias p='python' -# alias cx="claude --permission-mode=plan --allow-dangerously-skip-permissions" +# alias cx="claude --permission-mode=plan --permission-mode bypassPermissions" # # Use VSCode instead of neovim as your default editor # export EDITOR="code" diff --git a/default/elephant/omakub_themes.lua b/default/elephant/omakub_themes.lua index bacdccacd..5fd8acfe3 100644 --- a/default/elephant/omakub_themes.lua +++ b/default/elephant/omakub_themes.lua @@ -28,6 +28,15 @@ local function first_image_in_dir(dir) return nil end +-- Find preview.png, preview.jpg, or first backgrounds/ image in a theme dir +local function find_preview_path(dir) + local png = dir .. "/preview.png" + local jpg = dir .. "/preview.jpg" + if file_exists(png) then return png end + if file_exists(jpg) then return jpg end + return first_image_in_dir(dir .. "/backgrounds") +end + -- The main function elephant will call function GetEntries() local entries = {} @@ -51,19 +60,10 @@ function GetEntries() if theme_name and not seen_themes[theme_name] then seen_themes[theme_name] = true - -- Check for preview images directly (no subprocess) - local preview_path = nil - local preview_png = theme_path .. "/preview.png" - local preview_jpg = theme_path .. "/preview.jpg" - - if file_exists(preview_png) then - preview_path = preview_png - elseif file_exists(preview_jpg) then - preview_path = preview_jpg - else - -- Fallback: get first image from backgrounds (one ls call) - preview_path = first_image_in_dir(theme_path .. "/backgrounds") - end + -- Check the theme dir, then fall back to the default theme dir + -- (for partial user customizations that don't ship a preview) + local preview_path = find_preview_path(theme_path) + or find_preview_path(default_theme_dir .. "/" .. theme_name) if preview_path and preview_path ~= "" then local display_name = theme_name:gsub("_", " "):gsub("%-", " ") diff --git a/install/omakub-base.packages b/install/omakub-base.packages index b912e5ae0..384e8d0d2 100644 --- a/install/omakub-base.packages +++ b/install/omakub-base.packages @@ -78,6 +78,7 @@ rustc sqlite3 starship +tlp tmux ufw diff --git a/install/packaging/base.sh b/install/packaging/base.sh index d3bd2081c..28579892b 100644 --- a/install/packaging/base.sh +++ b/install/packaging/base.sh @@ -1,5 +1,5 @@ #!/bin/bash # Install all base packages -mapfile -t packages < <(grep -v '^#' "$OMAKUB_INSTALL/omakub-base.packages" | grep -v '^$') +mapfile -t packages < <(grep -v '^#' "$OMAKUB_PATH/install/omakub-base.packages" | grep -v '^$') omakub-pkg-add "${packages[@]}" diff --git a/migrations/1776436972.sh b/migrations/1776436972.sh new file mode 100644 index 000000000..333d17a6e --- /dev/null +++ b/migrations/1776436972.sh @@ -0,0 +1,9 @@ +echo "Generate current nightlight toggle..." + +CURRENT_STATE=$(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled) + +if [[ $CURRENT_STATE == "true" ]]; then + touch "$HOME/.local/state/omakub/toggles/night-light" +else + rm -f "$HOME/.local/state/omakub/toggles/night-light" +fi \ No newline at end of file diff --git a/migrations/1776892546.sh b/migrations/1776892546.sh new file mode 100644 index 000000000..1fe20aaa2 --- /dev/null +++ b/migrations/1776892546.sh @@ -0,0 +1,2 @@ +echo "Installing TLP for better battery management..." +omakub-pkg-add tlp \ No newline at end of file diff --git a/themes/lumon/colors.toml b/themes/lumon/colors.toml index b94e758e2..1ddfcb142 100644 --- a/themes/lumon/colors.toml +++ b/themes/lumon/colors.toml @@ -1,5 +1,5 @@ # Accent and UI colors -accent = "#f2fcff" +accent = "#8bc9eb" active_border_color = "#f2fcff" active_tab_background = "#6fb8e3" diff --git a/version b/version index 1892b9267..31e5c8434 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.3.2 +1.3.3