diff --git a/bin/omarchy-menu b/bin/omarchy-menu index e600644e..fc6bd63f 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -204,8 +204,9 @@ show_hardware_menu() { } show_style_menu() { - case $(menu "Style" "󰸌 Theme\n Font\n Background\n Hyprland\n󱄄 Screensaver\n About") in + case $(menu "Style" "󰸌 Theme\n󰟵 Unlock\n Font\n Background\n Hyprland\n󱄄 Screensaver\n About") in *Theme*) show_theme_menu ;; + *Unlock*) omarchy-launch-walker -m menus:omarchyunlocks --width 800 --minheight 400 ;; *Font*) show_font_menu ;; *Background*) show_background_menu ;; *Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;; diff --git a/bin/omarchy-plymouth-preview b/bin/omarchy-plymouth-preview new file mode 100755 index 00000000..0b83a956 --- /dev/null +++ b/bin/omarchy-plymouth-preview @@ -0,0 +1,72 @@ +#!/bin/bash + +# Render a Plymouth login-screen preview PNG by compositing the staged omarchy +# theme assets (recolored with the given text color) onto the background. + +if [[ $# -ne 4 ]]; then + echo "Usage: omarchy-plymouth-preview " >&2 + exit 1 +fi + +bg_hex="${1#\#}" +text_hex="${2#\#}" +logo_path="$3" +output_path="$4" + +if ! [[ $bg_hex =~ ^[0-9a-fA-F]{6}$ ]]; then + echo "Invalid background color: $1 (expected #RRGGBB)" >&2 + exit 1 +fi + +if ! [[ $text_hex =~ ^[0-9a-fA-F]{6}$ ]]; then + echo "Invalid text color: $2 (expected #RRGGBB)" >&2 + exit 1 +fi + +if [[ ! -f $logo_path ]]; then + echo "Logo file not found: $logo_path" >&2 + exit 1 +fi + +staging_dir=$(mktemp -d) +trap 'rm -rf "$staging_dir"' EXIT + +find ~/.local/share/omarchy/default/plymouth -maxdepth 1 -type f -exec cp -t "$staging_dir/" {} + +cp "$logo_path" "$staging_dir/logo.png" + +for asset in bullet.png entry.png lock.png; do + magick "$staging_dir/$asset" -channel RGB +level-colors "#$text_hex","#$text_hex" "$staging_dir/$asset" +done + +canvas_w=1920 +canvas_h=1080 + +logo_w=$(magick identify -format '%w' "$staging_dir/logo.png") +logo_h=$(magick identify -format '%h' "$staging_dir/logo.png") +entry_w=$(magick identify -format '%w' "$staging_dir/entry.png") +entry_h=$(magick identify -format '%h' "$staging_dir/entry.png") +lock_h=$(awk "BEGIN{print int($entry_h * 0.8)}") +lock_w=$(awk "BEGIN{print int(84 * $lock_h / 96)}") + +logo_x=$(( (canvas_w - logo_w) / 2 )) +logo_y=$(( (canvas_h - logo_h) / 2 )) +entry_x=$(( (canvas_w - entry_w) / 2 )) +entry_y=$(( logo_y + logo_h + 40 )) +lock_x=$(( entry_x - lock_w - 15 )) +lock_y=$(( entry_y + entry_h/2 - lock_h/2 )) +bullet_y=$(( entry_y + entry_h/2 - 4 )) + +bullet_args=() +for i in 0 1 2 3; do + bx=$(( entry_x + 20 + i * 12 )) + bullet_args+=( '(' "$staging_dir/bullet.png" -resize 7x7 ')' -geometry +${bx}+${bullet_y} -composite ) +done + +magick -size ${canvas_w}x${canvas_h} "xc:#$bg_hex" \ + "$staging_dir/logo.png" -geometry +${logo_x}+${logo_y} -composite \ + "$staging_dir/entry.png" -geometry +${entry_x}+${entry_y} -composite \ + \( "$staging_dir/lock.png" -resize ${lock_w}x${lock_h} \) -geometry +${lock_x}+${lock_y} -composite \ + "${bullet_args[@]}" \ + "$output_path" + +imv -f "$output_path" diff --git a/bin/omarchy-plymouth-reset b/bin/omarchy-plymouth-reset new file mode 100755 index 00000000..8ecd0ea7 --- /dev/null +++ b/bin/omarchy-plymouth-reset @@ -0,0 +1,18 @@ +#!/bin/bash + +# Restore the Plymouth boot theme and the SDDM login screen to the omarchy +# defaults — copies the shipped assets into /usr/share, rebuilds the initramfs, +# and refreshes the SDDM theme. + +theme_dir="/usr/share/plymouth/themes/omarchy" + +sudo find ~/.local/share/omarchy/default/plymouth -maxdepth 1 -type f -exec cp -t "$theme_dir/" {} + +sudo plymouth-set-default-theme omarchy + +if omarchy-cmd-present limine-mkinitcpio; then + sudo limine-mkinitcpio +else + sudo mkinitcpio -P +fi + +omarchy-refresh-sddm diff --git a/bin/omarchy-plymouth-set b/bin/omarchy-plymouth-set new file mode 100755 index 00000000..94c4ff4a --- /dev/null +++ b/bin/omarchy-plymouth-set @@ -0,0 +1,72 @@ +#!/bin/bash + +# Configure the Plymouth boot theme with a custom background color, text color, and logo. +# Stages the change in a temp dir, then commits the staged files to /usr/share and +# rebuilds the initramfs. Also syncs the SDDM login screen (the post-logout +# screen) with the same colors and logo so boot/login stay visually unified. + +if [[ $# -ne 3 ]]; then + echo "Usage: omarchy-plymouth-set " >&2 + exit 1 +fi + +bg_hex="${1#\#}" +text_hex="${2#\#}" +logo_path="$3" + +if ! [[ $bg_hex =~ ^[0-9a-fA-F]{6}$ ]]; then + echo "Invalid background color: $1 (expected #RRGGBB)" >&2 + exit 1 +fi + +if ! [[ $text_hex =~ ^[0-9a-fA-F]{6}$ ]]; then + echo "Invalid text color: $2 (expected #RRGGBB)" >&2 + exit 1 +fi + +if [[ ! -f $logo_path ]]; then + echo "Logo file not found: $logo_path" >&2 + exit 1 +fi + +bg_r=$(awk -v n=$((16#${bg_hex:0:2})) 'BEGIN{printf "%.3f", n/255}') +bg_g=$(awk -v n=$((16#${bg_hex:2:2})) 'BEGIN{printf "%.3f", n/255}') +bg_b=$(awk -v n=$((16#${bg_hex:4:2})) 'BEGIN{printf "%.3f", n/255}') + +theme_dir="/usr/share/plymouth/themes/omarchy" +staging_dir=$(mktemp -d) +trap 'rm -rf "$staging_dir"' EXIT + +find ~/.local/share/omarchy/default/plymouth -maxdepth 1 -type f -exec cp -t "$staging_dir/" {} + +cp "$logo_path" "$staging_dir/logo.png" + +sed -i \ + -e "s/^Window.SetBackgroundTopColor.*/Window.SetBackgroundTopColor($bg_r, $bg_g, $bg_b);/" \ + -e "s/^Window.SetBackgroundBottomColor.*/Window.SetBackgroundBottomColor($bg_r, $bg_g, $bg_b);/" \ + "$staging_dir/omarchy.script" + +for asset in bullet.png entry.png lock.png progress_bar.png; do + magick "$staging_dir/$asset" -channel RGB +level-colors "#$text_hex","#$text_hex" "$staging_dir/$asset" +done + +sudo cp -a "$staging_dir/." "$theme_dir/" +sudo plymouth-set-default-theme omarchy + +if omarchy-cmd-present limine-mkinitcpio; then + sudo limine-mkinitcpio +else + sudo mkinitcpio -P +fi + +# Sync the SDDM login screen with the same colors and logo. +sddm_dir="/usr/share/sddm/themes/omarchy" +sddm_template="$HOME/.local/share/omarchy/default/sddm/omarchy/Main.qml" + +sed \ + -e "s/#000000/#$bg_hex/g" \ + -e "s/#ffffff/#$text_hex/g" \ + -e 's|source: "logo.svg"|source: "logo.png"|' \ + "$sddm_template" | sudo tee "$sddm_dir/Main.qml" >/dev/null + +sudo cp "$logo_path" "$sddm_dir/logo.png" +sudo rm -f "$sddm_dir/logo.svg" diff --git a/bin/omarchy-plymouth-set-by-theme b/bin/omarchy-plymouth-set-by-theme new file mode 100755 index 00000000..6f1f7fb0 --- /dev/null +++ b/bin/omarchy-plymouth-set-by-theme @@ -0,0 +1,22 @@ +#!/bin/bash + +# Resolve a theme by name and apply its unlock.png + colors.toml as the +# Plymouth boot screen via omarchy-plymouth-set. + +if [[ $# -ne 1 ]]; then + echo "Usage: omarchy-plymouth-set-by-theme " >&2 + exit 1 +fi + +theme=$1 + +if [[ -d ~/.config/omarchy/themes/$theme ]]; then + theme_dir=~/.config/omarchy/themes/$theme +else + theme_dir="$OMARCHY_PATH/themes/$theme" +fi + +bg=$(awk -F'"' '/^background/{print $2}' "$theme_dir/colors.toml") +text=$(awk -F'"' '/^foreground/{print $2}' "$theme_dir/colors.toml") + +exec omarchy-plymouth-set "$bg" "$text" "$theme_dir/unlock.png" diff --git a/bin/omarchy-theme-set-plymouth b/bin/omarchy-theme-set-plymouth deleted file mode 100755 index 11f4a446..00000000 --- a/bin/omarchy-theme-set-plymouth +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/bash - -# Configure the Plymouth boot theme with a custom background color, accent color, and logo. -# Stages the change in a temp dir, previews it as a composited image, then optionally -# commits the staged files to /usr/share and rebuilds the initramfs. - -if [[ $# -ne 3 ]]; then - echo "Usage: omarchy-theme-set-plymouth " >&2 - exit 1 -fi - -bg_hex="${1#\#}" -accent_hex="${2#\#}" -logo_path="$3" - -if ! [[ $bg_hex =~ ^[0-9a-fA-F]{6}$ ]]; then - echo "Invalid background color: $1 (expected #RRGGBB)" >&2 - exit 1 -fi - -if ! [[ $accent_hex =~ ^[0-9a-fA-F]{6}$ ]]; then - echo "Invalid accent color: $2 (expected #RRGGBB)" >&2 - exit 1 -fi - -if [[ ! -f $logo_path ]]; then - echo "Logo file not found: $logo_path" >&2 - exit 1 -fi - -bg_r=$(awk -v n=$((16#${bg_hex:0:2})) 'BEGIN{printf "%.3f", n/255}') -bg_g=$(awk -v n=$((16#${bg_hex:2:2})) 'BEGIN{printf "%.3f", n/255}') -bg_b=$(awk -v n=$((16#${bg_hex:4:2})) 'BEGIN{printf "%.3f", n/255}') - -theme_dir="/usr/share/plymouth/themes/omarchy" -staging_dir=$(mktemp -d) -preview_png=$(mktemp --suffix=.png) -trap 'rm -rf "$staging_dir" "$preview_png"' EXIT - -cp ~/.local/share/omarchy/default/plymouth/* "$staging_dir/" -cp "$logo_path" "$staging_dir/logo.png" - -sed -i \ - -e "s/^Window.SetBackgroundTopColor.*/Window.SetBackgroundTopColor($bg_r, $bg_g, $bg_b);/" \ - -e "s/^Window.SetBackgroundBottomColor.*/Window.SetBackgroundBottomColor($bg_r, $bg_g, $bg_b);/" \ - "$staging_dir/omarchy.script" - -for asset in bullet.png entry.png lock.png progress_bar.png; do - magick "$staging_dir/$asset" -channel RGB +level-colors "#$accent_hex","#$accent_hex" "$staging_dir/$asset" -done - -if gum confirm "Preview new login screen?"; then - canvas_w=1920 - canvas_h=1080 - - logo_w=$(magick identify -format '%w' "$staging_dir/logo.png") - logo_h=$(magick identify -format '%h' "$staging_dir/logo.png") - entry_w=$(magick identify -format '%w' "$staging_dir/entry.png") - entry_h=$(magick identify -format '%h' "$staging_dir/entry.png") - lock_h=$(awk "BEGIN{print int($entry_h * 0.8)}") - lock_w=$(awk "BEGIN{print int(84 * $lock_h / 96)}") - - logo_x=$(( (canvas_w - logo_w) / 2 )) - logo_y=$(( (canvas_h - logo_h) / 2 )) - entry_x=$(( (canvas_w - entry_w) / 2 )) - entry_y=$(( logo_y + logo_h + 40 )) - lock_x=$(( entry_x - lock_w - 15 )) - lock_y=$(( entry_y + entry_h/2 - lock_h/2 )) - bullet_y=$(( entry_y + entry_h/2 - 4 )) - - bullet_args=() - for i in 0 1 2 3; do - bx=$(( entry_x + 20 + i * 12 )) - bullet_args+=( '(' "$staging_dir/bullet.png" -resize 7x7 ')' -geometry +${bx}+${bullet_y} -composite ) - done - - magick -size ${canvas_w}x${canvas_h} "xc:#$bg_hex" \ - "$staging_dir/logo.png" -geometry +${logo_x}+${logo_y} -composite \ - "$staging_dir/entry.png" -geometry +${entry_x}+${entry_y} -composite \ - \( "$staging_dir/lock.png" -resize ${lock_w}x${lock_h} \) -geometry +${lock_x}+${lock_y} -composite \ - "${bullet_args[@]}" \ - "$preview_png" - - imv -f "$preview_png" -fi - -if gum confirm "Apply new login screen?"; then - sudo cp -a "$staging_dir/." "$theme_dir/" - sudo plymouth-set-default-theme omarchy - - if omarchy-cmd-present limine-mkinitcpio; then - sudo limine-mkinitcpio - else - sudo mkinitcpio -P - fi -fi diff --git a/default/bash/aliases b/default/bash/aliases index b3f6ad22..656d145f 100644 --- a/default/bash/aliases +++ b/default/bash/aliases @@ -48,7 +48,9 @@ alias cx='printf "\033[2J\033[3J\033[H" && claude --permission-mode bypassPermis alias d='docker' alias r='rails' alias t='tmux attach || tmux new -s Work' -alias i='tdl c cx' +alias ic='tdl c' +alias ix='tdl cx' +alias icx='tdl c cx' n() { if [ "$#" -eq 0 ]; then command nvim . ; else command nvim "$@"; fi; } # Git diff --git a/default/elephant/omarchy_unlocks.lua b/default/elephant/omarchy_unlocks.lua new file mode 100644 index 00000000..8aacaccd --- /dev/null +++ b/default/elephant/omarchy_unlocks.lua @@ -0,0 +1,92 @@ +-- +-- Dynamic Omarchy Unlocks Menu for Elephant/Walker +-- +-- A "Default" entry restores the omarchy-shipped Plymouth via +-- omarchy-plymouth-reset. After that, every theme that has a preview-unlock.png +-- appears as a customised unlock; picking one runs omarchy-plymouth-set-by-theme +-- . Both run in a floating terminal so sudo can prompt. +-- +Name = "omarchyunlocks" +NamePretty = "Omarchy Unlocks" +HideFromProviderlist = true +FixedOrder = true + +local function file_exists(path) + local f = io.open(path, "r") + if f then + f:close() + return true + end + return false +end + +local function shell_escape(s) + return "'" .. s:gsub("'", "'\\''") .. "'" +end + +function GetEntries() + local entries = {} + local home = os.getenv("HOME") + local user_themes_dir = home .. "/.config/omarchy/themes" + local omarchy_path = os.getenv("OMARCHY_PATH") or "" + local default_themes_dir = omarchy_path .. "/themes" + local default_preview = omarchy_path .. "/default/plymouth/preview-unlock.png" + + local seen_themes = {} + + local function process_themes_from_dir(themes_dir) + local handle = io.popen("find -L '" .. themes_dir .. "' -mindepth 1 -maxdepth 1 -type d 2>/dev/null") + if not handle then + return + end + + for theme_path in handle:lines() do + local theme_name = theme_path:match(".*/(.+)$") + + if theme_name and not seen_themes[theme_name] then + seen_themes[theme_name] = true + + local preview_path = theme_path .. "/preview-unlock.png" + + if file_exists(preview_path) then + local display_name = theme_name:gsub("_", " "):gsub("%-", " ") + display_name = display_name:gsub("(%a)([%w_']*)", function(first, rest) + return first:upper() .. rest:lower() + end) + display_name = display_name .. " " + + table.insert(entries, { + Text = display_name, + Preview = preview_path, + PreviewType = "file", + Actions = { + activate = "omarchy-launch-floating-terminal-with-presentation " + .. shell_escape("omarchy-plymouth-set-by-theme " .. shell_escape(theme_name)), + }, + }) + end + end + end + + handle:close() + end + + process_themes_from_dir(user_themes_dir) + process_themes_from_dir(default_themes_dir) + + -- Default entry last — restores the shipped Plymouth. + local default_entry = { + Text = "Default ", + Actions = { + activate = "omarchy-launch-floating-terminal-with-presentation " + .. shell_escape("omarchy-plymouth-reset"), + }, + } + if file_exists(default_preview) then + default_entry.Preview = default_preview + default_entry.PreviewType = "file" + end + table.insert(entries, default_entry) + + return entries +end diff --git a/default/limine/default.conf b/default/limine/default.conf index ff5ae56d..9beedcd4 100644 --- a/default/limine/default.conf +++ b/default/limine/default.conf @@ -3,7 +3,7 @@ TARGET_OS_NAME="Omarchy" ESP_PATH="/boot" KERNEL_CMDLINE[default]+="@@CMDLINE@@" -KERNEL_CMDLINE[default]+=" quiet splash" +KERNEL_CMDLINE[default]+=" quiet splash loglevel=0 systemd.show_status=false rd.udev.log_level=0 vt.global_cursor_default=0" ENABLE_UKI=yes CUSTOM_UKI_NAME="omarchy" diff --git a/default/plymouth/logos/oma.png b/default/plymouth/logos/oma.png new file mode 100644 index 00000000..87d2cecb Binary files /dev/null and b/default/plymouth/logos/oma.png differ diff --git a/default/plymouth/preview-unlock.png b/default/plymouth/preview-unlock.png new file mode 100644 index 00000000..78c3e9c5 Binary files /dev/null and b/default/plymouth/preview-unlock.png differ diff --git a/default/walker/themes/omarchy-default/style.css b/default/walker/themes/omarchy-default/style.css index 0dc824fb..81ff4e00 100644 --- a/default/walker/themes/omarchy-default/style.css +++ b/default/walker/themes/omarchy-default/style.css @@ -78,6 +78,10 @@ child:selected .item-box * { color: @selected-text; } +child:selected { + background: alpha(@text, 0.07); +} + .item-box { padding-left: 14px; } @@ -114,3 +118,4 @@ child:selected .item-box * { .preview { } + diff --git a/default/wayland-sessions/omarchy.desktop b/default/wayland-sessions/omarchy.desktop new file mode 100644 index 00000000..760181af --- /dev/null +++ b/default/wayland-sessions/omarchy.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Omarchy (Hyprland uwsm) +Comment=Omarchy Hyprland session managed by uwsm +Exec=uwsm start -g -1 -e -D Hyprland hyprland.desktop +TryExec=uwsm +Type=Application diff --git a/install/config/walker-elephant.sh b/install/config/walker-elephant.sh index ad071dc9..a06f8c39 100644 --- a/install/config/walker-elephant.sh +++ b/install/config/walker-elephant.sh @@ -28,3 +28,4 @@ EOF mkdir -p ~/.config/elephant/menus ln -snf $OMARCHY_PATH/default/elephant/omarchy_themes.lua ~/.config/elephant/menus/omarchy_themes.lua ln -snf $OMARCHY_PATH/default/elephant/omarchy_background_selector.lua ~/.config/elephant/menus/omarchy_background_selector.lua +ln -snf $OMARCHY_PATH/default/elephant/omarchy_unlocks.lua ~/.config/elephant/menus/omarchy_unlocks.lua diff --git a/install/login/sddm.sh b/install/login/sddm.sh index a0366b3b..21696b48 100644 --- a/install/login/sddm.sh +++ b/install/login/sddm.sh @@ -2,16 +2,21 @@ omarchy-refresh-sddm # Setup SDDM login service +sudo mkdir -p /usr/local/share/wayland-sessions +sudo cp "$OMARCHY_PATH/default/wayland-sessions/omarchy.desktop" /usr/local/share/wayland-sessions/omarchy.desktop + sudo mkdir -p /etc/sddm.conf.d if [[ ! -f /etc/sddm.conf.d/autologin.conf ]]; then cat <