diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..c0c87cb3 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,67 @@ +# Style + +- Two spaces for indentation, no tabs +- Use bash 5 conditionals: use `[[ ]]` for string/file tests and `(( ))` for numeric tests +- In `[[ ]]`, don't quote variables, but do quote string literals when comparing values (e.g., `[[ $branch == "dev" ]]`) +- Prefer `(( ))` over numeric operators inside `[[ ]]` (e.g., `(( count < 50 ))`, not `[[ $count -lt 50 ]]`) +- For strings/paths with spaces, quote them instead of escaping spaces with `\ ` (e.g., `"$APP_DIR/Disk Usage.desktop"`, not `$APP_DIR/Disk\ Usage.desktop`) +- Shebangs must use `#!/bin/bash` consistently (never `#!/usr/bin/env bash`) + +# Command Naming + +All commands start with `omarchy-`. Prefixes indicate purpose: + +- `cmd-` - check if commands exist, misc utility commands +- `pkg-` - package management helpers +- `hw-` - hardware detection (return exit codes for use in conditionals) +- `refresh-` - copy default config to user's `~/.config/` +- `restart-` - restart a component +- `launch-` - open applications +- `install-` - install optional software +- `setup-` - interactive setup wizards +- `toggle-` - toggle features on/off +- `theme-` - theme management +- `update-` - update components + +# Helper Commands + +Use these instead of raw shell commands: + +- `omarchy-cmd-missing` / `omarchy-cmd-present` - check for commands +- `omarchy-pkg-missing` / `omarchy-pkg-present` - check for packages +- `omarchy-pkg-add` - install packages (handles both pacman and AUR) +- `omarchy-hw-asus-rog` - detect ASUS ROG hardware (and similar `hw-*` commands) + +# Config Structure + +- `config/` - default configs copied to `~/.config/` +- `default/themed/*.tpl` - templates with `{{ variable }}` placeholders for theme colors +- `themes/*/colors.toml` - theme color definitions (accent, background, foreground, color0-15) + +# Refresh Pattern + +To copy a default config to user config with automatic backup: + +```bash +omarchy-refresh-config hypr/hyprlock.conf +``` + +This copies `~/.local/share/omarchy/config/hypr/hyprlock.conf` to `~/.config/hypr/hyprlock.conf`. + +# Migrations + +To create a new migration, run `omarchy-dev-add-migration --no-edit`. This creates a migration file named after the unix timestamp of the last commit. + +Migration format: +- No shebang line +- Start with an `echo` describing what the migration does +- Use `$OMARCHY_PATH` to reference the omarchy directory + +Example: +```bash +echo "Disable fingerprint in hyprlock if fingerprint auth is not configured" + +if omarchy-cmd-missing fprintd-list || ! fprintd-list "$USER" 2>/dev/null | grep -q "finger"; then + sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf +fi +``` diff --git a/applications/Alacritty.desktop b/applications/Alacritty.desktop new file mode 100644 index 00000000..f53c813e --- /dev/null +++ b/applications/Alacritty.desktop @@ -0,0 +1,21 @@ +[Desktop Entry] +Type=Application +TryExec=alacritty +Exec=alacritty +Icon=Alacritty +Terminal=false +Categories=System;TerminalEmulator; +Name=Alacritty +GenericName=Terminal +Comment=A fast, cross-platform, OpenGL terminal emulator +StartupNotify=true +StartupWMClass=Alacritty +Actions=New; +X-TerminalArgExec=-e +X-TerminalArgAppId=--class= +X-TerminalArgTitle=--title= +X-TerminalArgDir=--working-directory= + +[Desktop Action New] +Name=New Terminal +Exec=alacritty diff --git a/applications/hidden/limine-snapper-restore.desktop b/applications/hidden/limine-snapper-restore.desktop new file mode 100644 index 00000000..e1e3e173 --- /dev/null +++ b/applications/hidden/limine-snapper-restore.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/applications/hidden/wiremix.desktop b/applications/hidden/wiremix.desktop new file mode 100644 index 00000000..e1e3e173 --- /dev/null +++ b/applications/hidden/wiremix.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/bin/omarchy-battery-monitor b/bin/omarchy-battery-monitor index 84c42974..b0da0d9e 100755 --- a/bin/omarchy-battery-monitor +++ b/bin/omarchy-battery-monitor @@ -11,8 +11,8 @@ send_notification() { notify-send -u critical "󱐋 Time to recharge!" "Battery is down to ${1}%" -i battery-caution -t 30000 } -if [[ -n "$BATTERY_LEVEL" && "$BATTERY_LEVEL" =~ ^[0-9]+$ ]]; then - if [[ $BATTERY_STATE == "discharging" && $BATTERY_LEVEL -le $BATTERY_THRESHOLD ]]; then +if [[ -n $BATTERY_LEVEL && $BATTERY_LEVEL =~ ^[0-9]+$ ]]; then + if [[ $BATTERY_STATE == "discharging" ]] && (( BATTERY_LEVEL <= BATTERY_THRESHOLD )); then if [[ ! -f $NOTIFICATION_FLAG ]]; then send_notification $BATTERY_LEVEL touch $NOTIFICATION_FLAG diff --git a/bin/omarchy-battery-present b/bin/omarchy-battery-present new file mode 100755 index 00000000..2b052a7a --- /dev/null +++ b/bin/omarchy-battery-present @@ -0,0 +1,13 @@ +#!/bin/bash + +# Returns true if a battery is present on the system. +# Used by the battery monitor and other battery-related checks. + +for bat in /sys/class/power_supply/BAT*; do + [[ -r $bat/present ]] && + [[ $(cat $bat/present) == "1" ]] && + [[ $(cat $bat/type) == "Battery" ]] && + exit 0 +done + +exit 1 diff --git a/bin/omarchy-battery-remaining b/bin/omarchy-battery-remaining index a6083352..26ea718f 100755 --- a/bin/omarchy-battery-remaining +++ b/bin/omarchy-battery-remaining @@ -3,10 +3,7 @@ # Returns the battery percentage remaining as an integer. # Used by the battery monitor and the Ctrl + Shift + Super + B hotkey. -upower -i $(upower -e | grep BAT) \ -| awk -F: '/percentage/ { - gsub(/[%[:space:]]/, "", $2); - val=$2; - printf("%d\n", (val+0.5)) +upower -i $(upower -e | grep BAT) | awk '/percentage/ { + print int($2) exit - }' +}' diff --git a/bin/omarchy-branch-set b/bin/omarchy-branch-set index f67d9174..87d19bda 100755 --- a/bin/omarchy-branch-set +++ b/bin/omarchy-branch-set @@ -3,14 +3,15 @@ # Set the branch for Omarchy's git repository. if (($# == 0)); then - echo "Usage: omarchy-branch-set [master|dev]" + echo "Usage: omarchy-branch-set [master|rc|dev]" exit 1 else branch="$1" fi -case "$branch" in - "master") git -C $OMARCHY_PATH switch master ;; - "dev") git -C $OMARCHY_PATH switch dev ;; - *) echo "Unknown branch: $branch"; exit 1; ;; -esac +if [[ $branch != "master" && $branch != "rc" && $branch != "dev" ]]; then + echo "Error: Invalid branch '$branch'. Must be one of: master, rc, dev" + exit 1 +fi + +git -C $OMARCHY_PATH switch $branch diff --git a/bin/omarchy-brightness-display b/bin/omarchy-brightness-display new file mode 100755 index 00000000..493265d4 --- /dev/null +++ b/bin/omarchy-brightness-display @@ -0,0 +1,21 @@ +#!/bin/bash + +# Adjust brightness on the most likely display device. +# Usage: omarchy-brightness-display + +step="${1:-+5%}" + +# Start with the first possible output, then refine to the most likely given an order heuristic. +device="$(ls -1 /sys/class/backlight 2>/dev/null | head -n1)" +for candidate in amdgpu_bl* intel_backlight acpi_video*; do + if [[ -e /sys/class/backlight/$candidate ]]; then + device="$candidate" + break + fi +done + +# Set the actual brightness of the display device. +brightnessctl -d "$device" set "$step" >/dev/null + +# Use SwayOSD to display the new brightness setting. +omarchy-swayosd-brightness "$(brightnessctl -d "$device" -m | cut -d',' -f4 | tr -d '%')" diff --git a/bin/omarchy-brightness-display-apple b/bin/omarchy-brightness-display-apple new file mode 100755 index 00000000..64006820 --- /dev/null +++ b/bin/omarchy-brightness-display-apple @@ -0,0 +1,12 @@ +#!/bin/bash + +# Adjust the brightness on Apple Studio Displays and Apple XDR Displays using asdcontrol. + +if (( $# == 0 )); then + echo "Adjust Apple Display Brightness by passing +5000 or -5000 (or any range from 0-60000)" +else + device="$(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1)" + sudo asdcontrol "$device" -- "$1" >/dev/null + value="$(sudo asdcontrol "$device" | awk -F= '/BRIGHTNESS=/{print $2+0}')" + omarchy-swayosd-brightness "$(( value * 100 / 60000 ))" +fi diff --git a/bin/omarchy-brightness-keyboard b/bin/omarchy-brightness-keyboard new file mode 100755 index 00000000..8c35b0ee --- /dev/null +++ b/bin/omarchy-brightness-keyboard @@ -0,0 +1,42 @@ +#!/bin/bash + +# Adjust keyboard backlight brightness using available steps. +# Usage: omarchy-brightness-keyboard + +direction="${1:-up}" + +# Find keyboard backlight device (look for *kbd_backlight* pattern in leds class). +device="" +for candidate in /sys/class/leds/*kbd_backlight*; do + if [[ -e $candidate ]]; then + device="$(basename "$candidate")" + break + fi +done + +if [[ -z $device ]]; then + echo "No keyboard backlight device found" >&2 + exit 1 +fi + +# Get current and max brightness to determine step size. +max_brightness="$(brightnessctl -d "$device" max)" +current_brightness="$(brightnessctl -d "$device" get)" + +# Calculate step as one unit (keyboards typically have discrete levels like 0-3). +if [[ $direction == "cycle" ]]; then + new_brightness=$(( (current_brightness + 1) % (max_brightness + 1) )) +elif [[ $direction == "up" ]]; then + new_brightness=$((current_brightness + 1)) + (( new_brightness > max_brightness )) && new_brightness=$max_brightness +else + new_brightness=$((current_brightness - 1)) + (( new_brightness < 0 )) && new_brightness=0 +fi + +# Set the new brightness. +brightnessctl -d "$device" set "$new_brightness" >/dev/null + +# Use SwayOSD to display the new brightness setting. +percent=$((new_brightness * 100 / max_brightness)) +omarchy-swayosd-kbd-brightness "$percent" diff --git a/bin/omarchy-channel-set b/bin/omarchy-channel-set index 342ee2e2..8494f973 100755 --- a/bin/omarchy-channel-set +++ b/bin/omarchy-channel-set @@ -14,14 +14,15 @@ # and people with a lot of experience managing Linux systems. if (($# == 0)); then - echo "Usage: omarchy-channel-set [stable|edge|dev]" + echo "Usage: omarchy-channel-set [stable|rc|edge|dev]" exit 1 else channel="$1" fi case "$channel" in -"stable") omarchy-branch-set "master" && omarchy-refresh-pacman "stable" && sudo pacman -Suu --noconfirm ;; +"stable") omarchy-branch-set "master" && omarchy-refresh-pacman "stable" ;; +"rc") omarchy-branch-set "rc" && omarchy-refresh-pacman "rc" ;; "edge") omarchy-branch-set "master" && omarchy-refresh-pacman "edge" ;; "dev") omarchy-branch-set "dev" && omarchy-refresh-pacman "edge" ;; *) echo "Unknown channel: $channel"; exit 1; ;; diff --git a/bin/omarchy-cmd-apple-display-brightness b/bin/omarchy-cmd-apple-display-brightness deleted file mode 100755 index d4d7968e..00000000 --- a/bin/omarchy-cmd-apple-display-brightness +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -# Adjust the brightness on Apple Studio Displays and Apple XDR Displays using asdcontrol. - -if [[ $# -eq 0 ]]; then - echo "Adjust Apple Display Brightness by passing +5000 or -5000 (or any range from 0-60000)" -else - DEVICE="$(sudo asdcontrol --detect /dev/usb/hiddev* | grep ^/dev/usb/hiddev | cut -d: -f1)" - sudo asdcontrol "$DEVICE" -- "$1" >/dev/null - VALUE="$(sudo asdcontrol "$DEVICE" | awk -F= '/BRIGHTNESS=/{print $2+0}')" - swayosd-client \ - --monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \ - --custom-icon display-brightness \ - --custom-progress "$(awk -v v="$VALUE" 'BEGIN{printf "%.2f", v/60000}')" \ - --custom-progress-text "$(( VALUE * 100 / 60000 ))%" -fi diff --git a/bin/omarchy-cmd-audio-switch b/bin/omarchy-cmd-audio-switch index 299eeb19..1cb51086 100755 --- a/bin/omarchy-cmd-audio-switch +++ b/bin/omarchy-cmd-audio-switch @@ -7,7 +7,7 @@ focused_monitor="$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).n sinks=$(pactl -f json list sinks | jq '[.[] | select((.ports | length == 0) or ([.ports[]? | .availability != "not available"] | any))]') sinks_count=$(echo "$sinks" | jq '. | length') -if [ "$sinks_count" -eq 0 ]; then +if (( sinks_count == 0 )); then swayosd-client \ --monitor "$focused_monitor" \ --custom-message "No audio devices found" @@ -17,7 +17,7 @@ fi current_sink_name=$(pactl get-default-sink) current_sink_index=$(echo "$sinks" | jq -r --arg name "$current_sink_name" 'map(.name) | index($name)') -if [ "$current_sink_index" != "null" ]; then +if [[ $current_sink_index != "null" ]]; then next_sink_index=$(((current_sink_index + 1) % sinks_count)) else next_sink_index=0 @@ -27,20 +27,28 @@ next_sink=$(echo "$sinks" | jq -r ".[$next_sink_index]") next_sink_name=$(echo "$next_sink" | jq -r '.name') next_sink_description=$(echo "$next_sink" | jq -r '.description') -if [ "$next_sink_description" = "(null)" ] || [ "$next_sink_description" = "null" ] || [ -z "$next_sink_description" ]; then - sink_id=$(echo "$next_sink" | jq -r '.properties."object.id"') - next_sink_description=$(wpctl status | grep -E "\s+\*?\s+${sink_id}\." | sed -E 's/^.*[0-9]+\.\s+//' | sed -E 's/\s+\[.*$//') +if [[ $next_sink_description == "(null)" ]] || [[ $next_sink_description == "null" ]] || [[ -z $next_sink_description ]]; then + # For Bluetooth devices, the friendly name is on the Device entry (device.id), not the Sink entry (object.id) + device_id=$(echo "$next_sink" | jq -r '.properties."device.id"') + if [[ $device_id != "null" ]] && [[ -n $device_id ]]; then + next_sink_description=$(wpctl status | grep -E "^\s*│?\s+${device_id}\." | sed -E 's/^.*[0-9]+\.\s+//' | sed -E 's/\s+\[.*$//') + fi + # Fall back to object.id lookup if device.id didn't yield a result + if [[ -z $next_sink_description ]]; then + sink_id=$(echo "$next_sink" | jq -r '.properties."object.id"') + next_sink_description=$(wpctl status | grep -E "\s+\*?\s+${sink_id}\." | sed -E 's/^.*[0-9]+\.\s+//' | sed -E 's/\s+\[.*$//') + fi fi next_sink_volume=$(echo "$next_sink" | jq -r \ '.volume | to_entries[0].value.value_percent | sub("%"; "")') next_sink_is_muted=$(echo "$next_sink" | jq -r '.mute') -if [ "$next_sink_is_muted" = "true" ] || [ "$next_sink_volume" -eq 0 ]; then +if [[ $next_sink_is_muted = "true" ]] || (( next_sink_volume == 0 )); then icon_state="muted" -elif [ "$next_sink_volume" -le 33 ]; then +elif (( next_sink_volume <= 33 )); then icon_state="low" -elif [ "$next_sink_volume" -le 66 ]; then +elif (( next_sink_volume <= 66 )); then icon_state="medium" else icon_state="high" @@ -48,7 +56,7 @@ fi next_sink_volume_icon="sink-volume-${icon_state}-symbolic" -if [ "$next_sink_name" != "$current_sink_name" ]; then +if [[ $next_sink_name != $current_sink_name ]]; then pactl set-default-sink "$next_sink_name" fi diff --git a/bin/omarchy-cmd-first-run b/bin/omarchy-cmd-first-run index db3b229b..830bef54 100755 --- a/bin/omarchy-cmd-first-run +++ b/bin/omarchy-cmd-first-run @@ -6,7 +6,7 @@ set -e FIRST_RUN_MODE=~/.local/state/omarchy/first-run.mode -if [[ -f "$FIRST_RUN_MODE" ]]; then +if [[ -f $FIRST_RUN_MODE ]]; then rm -f "$FIRST_RUN_MODE" bash "$OMARCHY_PATH/install/first-run/battery-monitor.sh" diff --git a/bin/omarchy-cmd-screenrecord b/bin/omarchy-cmd-screenrecord index 05c9d51f..d9dbdcc7 100755 --- a/bin/omarchy-cmd-screenrecord +++ b/bin/omarchy-cmd-screenrecord @@ -6,7 +6,7 @@ [[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs OUTPUT_DIR="${OMARCHY_SCREENRECORD_DIR:-${XDG_VIDEOS_DIR:-$HOME/Videos}}" -if [[ ! -d "$OUTPUT_DIR" ]]; then +if [[ ! -d $OUTPUT_DIR ]]; then notify-send "Screen recording directory does not exist: $OUTPUT_DIR" -u critical -t 3000 exit 1 fi @@ -35,9 +35,9 @@ start_webcam_overlay() { cleanup_webcam # Auto-detect first available webcam if none specified - if [[ -z "$WEBCAM_DEVICE" ]]; then + if [[ -z $WEBCAM_DEVICE ]]; then WEBCAM_DEVICE=$(v4l2-ctl --list-devices 2>/dev/null | grep -m1 "^\s*/dev/video" | tr -d '\t') - if [[ -z "$WEBCAM_DEVICE" ]]; then + if [[ -z $WEBCAM_DEVICE ]]; then notify-send "No webcam devices found" -u critical -t 3000 return 1 fi @@ -76,26 +76,38 @@ start_screenrecording() { local audio_devices="" local audio_args="" - [[ "$DESKTOP_AUDIO" == "true" ]] && audio_devices+="default_output" + [[ $DESKTOP_AUDIO == "true" ]] && audio_devices+="default_output" - if [[ "$MICROPHONE_AUDIO" == "true" ]]; then + if [[ $MICROPHONE_AUDIO == "true" ]]; then # Merge audio tracks into one - separate tracks only play one at a time in most players - [[ -n "$audio_devices" ]] && audio_devices+="|" + [[ -n $audio_devices ]] && audio_devices+="|" audio_devices+="default_input" fi - [[ -n "$audio_devices" ]] && audio_args+="-a $audio_devices" + [[ -n $audio_devices ]] && audio_args+="-a $audio_devices" - gpu-screen-recorder -w portal -f 60 -fallback-cpu-encoding yes -o "$filename" $audio_args -ac aac & + gpu-screen-recorder -w portal -k h264 -f 60 -fallback-cpu-encoding yes -o "$filename" $audio_args -ac aac & toggle_screenrecording_indicator } +trim_first_frame() { + local latest=$(ls -t "$OUTPUT_DIR"/screenrecording-*.mp4 2>/dev/null | head -1) + if [[ -n $latest ]]; then + local trimmed="${latest%.mp4}-trimmed.mp4" + if ffmpeg -y -ss 0.1 -i "$latest" -c copy "$trimmed" -loglevel quiet 2>/dev/null; then + mv "$trimmed" "$latest" + else + rm -f "$trimmed" + fi + fi +} + stop_screenrecording() { pkill -SIGINT -f "^gpu-screen-recorder" # SIGINT required to save video properly # Wait a maximum of 5 seconds to finish before hard killing local count=0 - while pgrep -f "^gpu-screen-recorder" >/dev/null && [ $count -lt 50 ]; do + while pgrep -f "^gpu-screen-recorder" >/dev/null && (( count < 50 )); do sleep 0.1 count=$((count + 1)) done @@ -106,6 +118,7 @@ stop_screenrecording() { notify-send "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." -u critical -t 5000 else cleanup_webcam + trim_first_frame notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000 fi toggle_screenrecording_indicator @@ -125,8 +138,8 @@ if screenrecording_active; then else stop_screenrecording fi -elif [[ "$STOP_RECORDING" == "false" ]]; then - [[ "$WEBCAM" == "true" ]] && start_webcam_overlay +elif [[ $STOP_RECORDING == "false" ]]; then + [[ $WEBCAM == "true" ]] && start_webcam_overlay start_screenrecording || cleanup_webcam else diff --git a/bin/omarchy-cmd-screenshot b/bin/omarchy-cmd-screenshot index b988a3b7..90555a23 100755 --- a/bin/omarchy-cmd-screenshot +++ b/bin/omarchy-cmd-screenshot @@ -2,85 +2,129 @@ # Take a screenshot of the whole screen, a specific window, or a user-drawn region. # Saves to ~/Pictures by default, but that can be changed via OMARCHY_SCREENSHOT_DIR or XDG_PICTURES_DIR ENVs. +# Editor defaults to Satty but can be changed via --editor= or OMARCHY_SCREENSHOT_EDITOR env [[ -f ~/.config/user-dirs.dirs ]] && source ~/.config/user-dirs.dirs OUTPUT_DIR="${OMARCHY_SCREENSHOT_DIR:-${XDG_PICTURES_DIR:-$HOME/Pictures}}" -if [[ ! -d "$OUTPUT_DIR" ]]; then +if [[ ! -d $OUTPUT_DIR ]]; then notify-send "Screenshot directory does not exist: $OUTPUT_DIR" -u critical -t 3000 exit 1 fi pkill slurp && exit 0 +SCREENSHOT_EDITOR="${OMARCHY_SCREENSHOT_EDITOR:-satty}" + +# Parse --editor flag from any position +ARGS=() +for arg in "$@"; do + if [[ $arg == --editor=* ]]; then + SCREENSHOT_EDITOR="${arg#--editor=}" + else + ARGS+=("$arg") + fi +done +set -- "${ARGS[@]}" + +open_editor() { + local filepath="$1" + if [[ $SCREENSHOT_EDITOR == "satty" ]]; then + satty --filename "$filepath" \ + --output-filename "$filepath" \ + --actions-on-enter save-to-clipboard \ + --save-after-copy \ + --copy-command 'wl-copy' + else + $SCREENSHOT_EDITOR "$filepath" + fi +} + MODE="${1:-smart}" PROCESSING="${2:-slurp}" +# accounting for portrait/transformed displays +JQ_MONITOR_GEO=' + def format_geo: + .x as $x | .y as $y | + (.width / .scale | floor) as $w | + (.height / .scale | floor) as $h | + .transform as $t | + if $t == 1 or $t == 3 then + "\($x),\($y) \($h)x\($w)" + else + "\($x),\($y) \($w)x\($h)" + end; +' + get_rectangles() { local active_workspace=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .activeWorkspace.id') - hyprctl monitors -j | jq -r --arg ws "$active_workspace" '.[] | select(.activeWorkspace.id == ($ws | tonumber)) | "\(.x),\(.y) \((.width / .scale) | floor)x\((.height / .scale) | floor)"' + hyprctl monitors -j | jq -r --arg ws "$active_workspace" "${JQ_MONITOR_GEO} .[] | select(.activeWorkspace.id == (\$ws | tonumber)) | format_geo" hyprctl clients -j | jq -r --arg ws "$active_workspace" '.[] | select(.workspace.id == ($ws | tonumber)) | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' } # Select based on mode case "$MODE" in region) - wayfreeze & PID=$! + hyprpicker -r -z >/dev/null 2>&1 & PID=$! sleep .1 SELECTION=$(slurp 2>/dev/null) kill $PID 2>/dev/null ;; windows) - wayfreeze & PID=$! + hyprpicker -r -z >/dev/null 2>&1 & PID=$! sleep .1 SELECTION=$(get_rectangles | slurp -r 2>/dev/null) kill $PID 2>/dev/null ;; fullscreen) - SELECTION=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.x),\(.y) \((.width / .scale) | floor)x\((.height / .scale) | floor)"') + SELECTION=$(hyprctl monitors -j | jq -r "${JQ_MONITOR_GEO} .[] | select(.focused == true) | format_geo") ;; smart|*) RECTS=$(get_rectangles) - wayfreeze & PID=$! + hyprpicker -r -z >/dev/null 2>&1 & PID=$! sleep .1 SELECTION=$(echo "$RECTS" | slurp 2>/dev/null) kill $PID 2>/dev/null - # If the selction area is L * W < 20, we'll assume you were trying to select whichever - # window or output it was inside of to prevent accidental 2px snapshots - if [[ "$SELECTION" =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+)$ ]]; then - if (( ${BASH_REMATCH[3]} * ${BASH_REMATCH[4]} < 20 )); then - click_x="${BASH_REMATCH[1]}" - click_y="${BASH_REMATCH[2]}" + # If the selection area is L * W < 20, we'll assume you were trying to select whichever + # window or output it was inside of to prevent accidental 2px snapshots + if [[ $SELECTION =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+)$ ]]; then + if ((${BASH_REMATCH[3]} * ${BASH_REMATCH[4]} < 20)); then + click_x="${BASH_REMATCH[1]}" + click_y="${BASH_REMATCH[2]}" - while IFS= read -r rect; do - if [[ "$rect" =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+) ]]; then - rect_x="${BASH_REMATCH[1]}" - rect_y="${BASH_REMATCH[2]}" - rect_width="${BASH_REMATCH[3]}" - rect_height="${BASH_REMATCH[4]}" + while IFS= read -r rect; do + if [[ $rect =~ ^([0-9]+),([0-9]+)[[:space:]]([0-9]+)x([0-9]+) ]]; then + rect_x="${BASH_REMATCH[1]}" + rect_y="${BASH_REMATCH[2]}" + rect_width="${BASH_REMATCH[3]}" + rect_height="${BASH_REMATCH[4]}" - if (( click_x >= rect_x && click_x < rect_x+rect_width && click_y >= rect_y && click_y < rect_y+rect_height )); then - SELECTION="${rect_x},${rect_y} ${rect_width}x${rect_height}" - break - fi + if ((click_x >= rect_x && click_x < rect_x + rect_width && click_y >= rect_y && click_y < rect_y + rect_height)); then + SELECTION="${rect_x},${rect_y} ${rect_width}x${rect_height}" + break fi - done <<< "$RECTS" - fi + fi + done <<<"$RECTS" fi - ;; + fi + ;; esac -[ -z "$SELECTION" ] && exit 0 +[[ -z $SELECTION ]] && exit 0 + +FILENAME="screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png" +FILEPATH="$OUTPUT_DIR/$FILENAME" if [[ $PROCESSING == "slurp" ]]; then -grim -g "$SELECTION" - | - satty --filename - \ - --output-filename "$OUTPUT_DIR/screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png" \ - --early-exit \ - --actions-on-enter save-to-clipboard \ - --save-after-copy \ - --copy-command 'wl-copy' + grim -g "$SELECTION" "$FILEPATH" || exit 1 + wl-copy <"$FILEPATH" + + ( + ACTION=$(notify-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" -t 10000 -i "$FILEPATH" -A "default=edit") + [[ $ACTION == "default" ]] && open_editor "$FILEPATH" + ) & else grim -g "$SELECTION" - | wl-copy fi diff --git a/bin/omarchy-cmd-share b/bin/omarchy-cmd-share index 96fd3d38..81535549 100755 --- a/bin/omarchy-cmd-share +++ b/bin/omarchy-cmd-share @@ -25,7 +25,7 @@ else # Pick one or more files from home directory FILES=$(find "$HOME" -type f 2>/dev/null | fzf --multi) fi - [ -z "$FILES" ] && exit 0 + [[ -z $FILES ]] && exit 0 fi fi diff --git a/bin/omarchy-config-direct-boot b/bin/omarchy-config-direct-boot new file mode 100755 index 00000000..6bb82123 --- /dev/null +++ b/bin/omarchy-config-direct-boot @@ -0,0 +1,45 @@ +#!/bin/bash + +# Add an EFI boot entry for the Omarchy UKI, allowing the system to boot directly +# without a bootloader like Limine. Requires UEFI firmware and a built UKI. + +if [[ ! -d /sys/firmware/efi ]]; then + echo "Error: System is not booted in UEFI mode" >&2 + exit 1 +fi + +if ! efibootmgr &>/dev/null; then + echo "Error: efibootmgr is not available or not functional" >&2 + exit 1 +fi + +if cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "American Megatrends"; then + echo "Error: American Megatrends firmware may not safely support custom EFI entries" >&2 + exit 1 +fi + +if cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "Apple"; then + echo "Error: Apple firmware uses its own boot manager" >&2 + exit 1 +fi + +uki_file=$(find /boot/EFI/Linux/ -name "omarchy*.efi" -printf "%f\n" 2>/dev/null | head -1) + +if [[ -z $uki_file ]]; then + echo "Error: No Omarchy UKI found in /boot/EFI/Linux/" >&2 + exit 1 +fi + +boot_source=$(findmnt -n -o SOURCE /boot) +disk=$(echo "$boot_source" | sed 's/p\?[0-9]*$//') +part=$(echo "$boot_source" | grep -o 'p\?[0-9]*$' | sed 's/^p//') + +if gum confirm "Setup direct boot (so snapshot booting must be done via bios)?"; then + echo "Creating EFI boot entry for $uki_file" + + sudo efibootmgr --create \ + --disk "$disk" \ + --part "$part" \ + --label "Omarchy" \ + --loader "\\EFI\\Linux\\$uki_file" +fi diff --git a/bin/omarchy-debug b/bin/omarchy-debug index e63057ae..23b6630d 100755 --- a/bin/omarchy-debug +++ b/bin/omarchy-debug @@ -5,7 +5,7 @@ NO_SUDO=false PRINT_ONLY=false -while [[ $# -gt 0 ]]; do +while (( $# > 0 )); do case "$1" in --no-sudo) NO_SUDO=true @@ -25,7 +25,7 @@ done LOG_FILE="/tmp/omarchy-debug.log" -if [ "$NO_SUDO" = true ]; then +if [[ $NO_SUDO = "true" ]]; then DMESG_OUTPUT="(skipped - --no-sudo flag used)" else DMESG_OUTPUT="$(sudo dmesg)" @@ -47,7 +47,7 @@ DMESG $DMESG_OUTPUT ========================================= -JOURNALCTL (CURRENT BOOT, ERRORS ONLY) +JOURNALCTL (CURRENT BOOT, WARNINGS+ERRORS) ========================================= $(journalctl -b -p 4..1) @@ -57,7 +57,7 @@ INSTALLED PACKAGES $({ expac -S '%n %v (%r)' $(pacman -Qqe) 2>/dev/null; comm -13 <(pacman -Sql | sort) <(pacman -Qqe | sort) | xargs -r expac -Q '%n %v (AUR)'; } | sort) EOF -if [ "$PRINT_ONLY" = true ]; then +if [[ $PRINT_ONLY = "true" ]]; then cat "$LOG_FILE" exit 0 fi @@ -73,7 +73,7 @@ case "$ACTION" in "Upload log") echo "Uploading debug log to 0x0.st..." URL=$(curl -sF "file=@$LOG_FILE" -Fexpires=24 https://0x0.st) - if [ $? -eq 0 ] && [ -n "$URL" ]; then + if (( $? == 0 )) && [[ -n $URL ]]; then echo "✓ Log uploaded successfully!" echo "Share this URL:" echo "" diff --git a/bin/omarchy-dev-add-migration b/bin/omarchy-dev-add-migration index c662bc56..3ca47a2f 100755 --- a/bin/omarchy-dev-add-migration +++ b/bin/omarchy-dev-add-migration @@ -7,7 +7,7 @@ cd ~/.local/share/omarchy migration_file="$HOME/.local/share/omarchy/migrations/$(git log -1 --format=%cd --date=unix).sh" touch $migration_file -if [[ "$1" != "--no-edit" ]]; then +if [[ $1 != "--no-edit" ]]; then nvim $migration_file fi diff --git a/bin/omarchy-drive-info b/bin/omarchy-drive-info index 51a57692..4943975d 100755 --- a/bin/omarchy-drive-info +++ b/bin/omarchy-drive-info @@ -11,7 +11,7 @@ fi # Find the root drive in case we are looking at partitions root_drive=$(lsblk -no PKNAME "$drive" 2>/dev/null | tail -n1) -if [[ -n "$root_drive" ]]; then +if [[ -n $root_drive ]]; then root_drive="/dev/$root_drive" else root_drive="$drive" @@ -19,11 +19,31 @@ fi # Get basic disk information size=$(lsblk -dno SIZE "$drive" 2>/dev/null) -model=$(lsblk -dno MODEL "$root_drive" 2>/dev/null) +vendor=$(lsblk -dno VENDOR "$root_drive" 2>/dev/null | sed 's/ *$//') +model=$(lsblk -dno MODEL "$root_drive" 2>/dev/null | sed 's/ *$//') + +# Combine vendor and model, avoiding duplication +label="" +if [[ -n $vendor && -n $model ]]; then + if [[ $model == *$vendor* ]]; then + label="$model" + else + label="$vendor $model" + fi +elif [[ -n $model ]]; then + label="$model" +elif [[ -n $vendor ]]; then + label="$vendor" +fi # Format display string display="$drive" -[[ -n "$size" ]] && display="$display ($size)" -[[ -n "$model" ]] && display="$display - $model" +[[ -n $size ]] && display="$display ($size)" +[[ -n $label ]] && display="$display - $label" + +# Append compact partition summary +part_summary=$(lsblk -nro TYPE,NAME,FSTYPE,MOUNTPOINT "$root_drive" 2>/dev/null | \ + awk '$1=="part" { printf "%s%s%s", s, ($3==""?"unknown":$3), ($4==""?"":"("$4")"); s=", " }') +[[ -n $part_summary ]] && display+=" [$part_summary]" echo "$display" diff --git a/bin/omarchy-drive-select b/bin/omarchy-drive-select index a4b82a5e..14afcc22 100755 --- a/bin/omarchy-drive-select +++ b/bin/omarchy-drive-select @@ -10,7 +10,7 @@ fi drives_with_info="" while IFS= read -r drive; do - [[ -n "$drive" ]] || continue + [[ -n $drive ]] || continue drives_with_info+="$(omarchy-drive-info "$drive")"$'\n' done <<<"$drives" diff --git a/bin/omarchy-drive-set-password b/bin/omarchy-drive-set-password index e014f6dd..baf4d1ba 100755 --- a/bin/omarchy-drive-set-password +++ b/bin/omarchy-drive-set-password @@ -5,7 +5,7 @@ encrypted_drives=$(blkid -t TYPE=crypto_LUKS -o device) if [[ -n $encrypted_drives ]]; then - if [[ $(wc -l <<<"$encrypted_drives") -eq 1 ]]; then + if (( $(wc -l << HIBERNATION_IMAGE_SIZE )) && [[ -f /etc/mkinitcpio.conf.d/omarchy_resume.conf ]]; then exit 0 else exit 1 diff --git a/bin/omarchy-hibernation-remove b/bin/omarchy-hibernation-remove index aad216f9..2901a88a 100755 --- a/bin/omarchy-hibernation-remove +++ b/bin/omarchy-hibernation-remove @@ -6,7 +6,7 @@ MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/omarchy_resume.conf" # Check if hibernation is configured -if [ ! -f "$MKINITCPIO_CONF" ] || ! grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then +if [[ ! -f $MKINITCPIO_CONF ]] || ! grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then echo "Hibernation is not set up" exit 0 fi @@ -25,7 +25,7 @@ if swapon --show | grep -q "$SWAP_FILE"; then fi # Remove swapfile -if [ -f "$SWAP_FILE" ]; then +if [[ -f $SWAP_FILE ]]; then echo "Removing swapfile" sudo rm "$SWAP_FILE" fi diff --git a/bin/omarchy-hibernation-setup b/bin/omarchy-hibernation-setup index 8a423cbd..1d4b0d1d 100755 --- a/bin/omarchy-hibernation-setup +++ b/bin/omarchy-hibernation-setup @@ -4,22 +4,28 @@ # adds a resume hook to mkinitcpio, and configures suspend-then-hibernate. if [[ ! -f /sys/power/image_size ]]; then - echo -e "\033[31mError: Hibernation is not supported on your system\033[0m" >&2 - exit 1 + echo -e "Hibernation is not supported on your system" >&2 + exit 0 fi +if ! command -v limine-mkinitcpio &>/dev/null; then + echo "Skipping hibernation setup (requires Limine bootloader)" + exit 0 +fi MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/omarchy_resume.conf" # Check if hibernation is already configured -if [ -f "$MKINITCPIO_CONF" ] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then +if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then echo "Hibernation is already set up" exit 0 fi -MEM_TOTAL_HUMAN=$(free --human | awk '/Mem/ {print $2}') -if ! gum confirm "Use $MEM_TOTAL_HUMAN on boot drive to make hibernation available?"; then - exit 0 +if [[ $1 != "--force" ]]; then + MEM_TOTAL_HUMAN=$(free --human | awk '/Mem/ {print $2}') + if ! gum confirm "Use $MEM_TOTAL_HUMAN on boot drive to make hibernation available?"; then + exit 0 + fi fi SWAP_SUBVOLUME="/swap" @@ -57,14 +63,38 @@ sudo mkdir -p /etc/mkinitcpio.conf.d echo "Adding resume hook to $MKINITCPIO_CONF" echo "HOOKS+=(resume)" | sudo tee "$MKINITCPIO_CONF" >/dev/null -# Configure suspend-then-hibernate -echo "Configuring suspend-then-hibernate" -sudo mkdir -p /etc/systemd/logind.conf.d /etc/systemd/sleep.conf.d -sudo cp "$OMARCHY_PATH/default/systemd/lid.conf" /etc/systemd/logind.conf.d/ -sudo cp "$OMARCHY_PATH/default/systemd/hibernate.conf" /etc/systemd/sleep.conf.d/ +# Ensure keyboard backlight doesn't prevent sleep +sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/keyboard-backlight" /usr/lib/systemd/system-sleep/ -# Regenerate initramfs +# Add resume= kernel parameters so the initramfs resume hook knows where to find the +# hibernation image. Without these, resume happens late (after GPU drivers load) and fails. +RESUME_DROP_IN="/etc/limine-entry-tool.d/resume.conf" +if [[ ! -f $RESUME_DROP_IN ]]; then + echo "Adding resume kernel parameters" + sudo swapon -p 0 "$SWAP_FILE" 2>/dev/null + RESUME_DEVICE=$(findmnt -no SOURCE -T "$SWAP_FILE" | sed 's/\[.*\]//') + RESUME_OFFSET=$(btrfs inspect-internal map-swapfile -r "$SWAP_FILE") + sudo mkdir -p /etc/limine-entry-tool.d + echo "KERNEL_CMDLINE[default]+=\"resume=$RESUME_DEVICE resume_offset=$RESUME_OFFSET\"" | sudo tee "$RESUME_DROP_IN" >/dev/null +fi + +# Use ACPI alarm for RTC wakeup on s2idle systems (needed for suspend-then-hibernate) +if grep -q "\[s2idle\]" /sys/power/mem_sleep 2>/dev/null; then + LIMINE_DROP_IN="/etc/limine-entry-tool.d/rtc-alarm.conf" + if [[ ! -f $LIMINE_DROP_IN ]]; then + echo "Enabling ACPI RTC alarm for s2idle suspend" + sudo mkdir -p /etc/limine-entry-tool.d + echo 'KERNEL_CMDLINE[default]+="rtc_cmos.use_acpi_alarm=1"' | sudo tee "$LIMINE_DROP_IN" >/dev/null + fi +fi + +# Regenerate initramfs and boot entry echo "Regenerating initramfs..." sudo limine-mkinitcpio +sudo limine-update -echo "Hibernation enabled" +echo + +if [[ $1 != "--force" ]] && gum confirm "Reboot to enable hibernation?"; then + omarchy-system-reboot +fi diff --git a/bin/omarchy-hook b/bin/omarchy-hook index 75033bfc..fb670f02 100755 --- a/bin/omarchy-hook +++ b/bin/omarchy-hook @@ -4,7 +4,7 @@ set -e -if [[ $# -lt 1 ]]; then +if (( $# < 1 )); then echo "Usage: omarchy-hook [name] [args...]" exit 1 fi diff --git a/bin/omarchy-hw-asus-rog b/bin/omarchy-hw-asus-rog new file mode 100755 index 00000000..6897d734 --- /dev/null +++ b/bin/omarchy-hw-asus-rog @@ -0,0 +1,6 @@ +#!/bin/bash + +# Detect whether the computer is an Asus ROG machine. + +[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "ASUSTeK COMPUTER INC." ]] && + grep -q "ROG" /sys/class/dmi/id/product_family 2>/dev/null diff --git a/bin/omarchy-hw-framework16 b/bin/omarchy-hw-framework16 new file mode 100755 index 00000000..d1e03c1d --- /dev/null +++ b/bin/omarchy-hw-framework16 @@ -0,0 +1,6 @@ +#!/bin/bash + +# Detect whether the computer is a Framework Laptop 16. + +[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Framework" ]] && + grep -q "Laptop 16" /sys/class/dmi/id/product_name 2>/dev/null diff --git a/bin/omarchy-hw-surface b/bin/omarchy-hw-surface new file mode 100755 index 00000000..653792da --- /dev/null +++ b/bin/omarchy-hw-surface @@ -0,0 +1,6 @@ +#!/bin/bash + +# Detect whether the computer is a Microsoft Surface device. + +[[ $(cat /sys/class/dmi/id/sys_vendor 2>/dev/null) == "Microsoft Corporation" ]] && + grep -q "Surface" /sys/class/dmi/id/product_name 2>/dev/null diff --git a/bin/omarchy-hyprland-monitor-scaling-toggle b/bin/omarchy-hyprland-monitor-scaling-toggle new file mode 100755 index 00000000..00509752 --- /dev/null +++ b/bin/omarchy-hyprland-monitor-scaling-toggle @@ -0,0 +1,21 @@ +#!/bin/bash + +# Get the active monitor (the one with the cursor) +MONITOR_INFO=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true)') +ACTIVE_MONITOR=$(echo "$MONITOR_INFO" | jq -r '.name') +CURRENT_SCALE=$(echo "$MONITOR_INFO" | jq -r '.scale') + +# Cycle through scales: 1 → 1.6 → 2 → 3 → 1 +CURRENT_INT=$(awk -v s="$CURRENT_SCALE" 'BEGIN { printf "%.0f", s * 10 }') + +case "$CURRENT_INT" in +10) NEW_SCALE=1.6 ;; +16) NEW_SCALE=2 ;; +20) NEW_SCALE=3 ;; +*) NEW_SCALE=1 ;; +esac + +hyprctl keyword misc:disable_scale_notification true +hyprctl keyword monitor "$ACTIVE_MONITOR,preferred,auto,$NEW_SCALE" +hyprctl keyword misc:disable_scale_notification false +notify-send "󰍹 Display scaling set to ${NEW_SCALE}x" diff --git a/bin/omarchy-hyprland-window-single-square-aspect-toggle b/bin/omarchy-hyprland-window-single-square-aspect-toggle new file mode 100755 index 00000000..423ef0d1 --- /dev/null +++ b/bin/omarchy-hyprland-window-single-square-aspect-toggle @@ -0,0 +1,13 @@ +#!/bin/bash + +# Check current single_window_aspect_ratio setting +CURRENT_VALUE=$(hyprctl getoption "dwindle:single_window_aspect_ratio" 2>/dev/null | head -1) + +# Parse vec2 output: "vec2: [1, 1]" or "vec2: [0, 0]" +if [[ $CURRENT_VALUE == *"[1, 1]"* ]]; then + hyprctl keyword dwindle:single_window_aspect_ratio "0 0" + notify-send " Disable single-window square aspect ratio" +else + hyprctl keyword dwindle:single_window_aspect_ratio "1 1" + notify-send " Enable single-window square aspect" +fi diff --git a/bin/omarchy-hyprland-workspace-toggle-gaps b/bin/omarchy-hyprland-workspace-toggle-gaps index b9b4c928..d2cf2ffd 100755 --- a/bin/omarchy-hyprland-workspace-toggle-gaps +++ b/bin/omarchy-hyprland-workspace-toggle-gaps @@ -1,12 +1,15 @@ #!/bin/bash -# Toggles the window gaps on the active workspace between no gaps and the default 10/5/2. +# Toggles the window gaps globally between no gaps and the default 10/5/2. -workspace_id=$(hyprctl activeworkspace -j | jq -r .id) -gaps=$(hyprctl workspacerules -j | jq -r ".[] | select(.workspaceString==\"$workspace_id\") | .gapsOut[0] // 0") +gaps=$(hyprctl getoption general:gaps_out -j | jq -r '.custom' | awk '{print $1}') if [[ $gaps == "0" ]]; then - hyprctl keyword "workspace $workspace_id, gapsout:10, gapsin:5, bordersize:2" -else \ - hyprctl keyword "workspace $workspace_id, gapsout:0, gapsin:0, bordersize:0" + hyprctl keyword general:gaps_out 10 + hyprctl keyword general:gaps_in 5 + hyprctl keyword general:border_size 2 +else + hyprctl keyword general:gaps_out 0 + hyprctl keyword general:gaps_in 0 + hyprctl keyword general:border_size 0 fi diff --git a/bin/omarchy-install-dev-env b/bin/omarchy-install-dev-env index 5a80f12e..f1cd31b8 100755 --- a/bin/omarchy-install-dev-env +++ b/bin/omarchy-install-dev-env @@ -2,16 +2,16 @@ # Install one of the supported development environments. Usually called via Install > Development > * in the Omarchy Menu. -if [[ -z "$1" ]]; then - echo "Usage: omarchy-install-dev-env " >&2 +if [[ -z $1 ]]; then + echo "Usage: omarchy-install-dev-env " >&2 exit 1 fi install_php() { - sudo pacman -S php composer php-sqlite xdebug --noconfirm + omarchy-pkg-add php composer php-sqlite xdebug # Install Path for Composer - if [[ ":$PATH:" != *":$HOME/.config/composer/vendor/bin:"* ]]; then + if [[ :$PATH: != *:$HOME/.config/composer/vendor/bin:* ]]; then echo 'export PATH="$HOME/.config/composer/vendor/bin:$PATH"' >>"$HOME/.bashrc" source "$HOME/.bashrc" echo "Added Composer global bin directory to PATH." @@ -52,7 +52,8 @@ ruby) omarchy-pkg-add libyaml mise use --global ruby@latest mise settings add idiomatic_version_file_enable_tools ruby - echo "gem: --no-document" > ~/.gemrc + mise settings add ruby.compile false + echo "gem: --no-document" >~/.gemrc mise x ruby -- gem install rails --no-document echo -e "\nYou can now run: rails new myproject" ;; @@ -143,6 +144,7 @@ clojure) ;; scala) echo -e "Installing Scala...\n" + mise use --global java@latest mise use --global scala@latest mise use --global scala-cli@latest ;; diff --git a/bin/omarchy-install-docker-dbs b/bin/omarchy-install-docker-dbs index 4d29878a..abfacdc7 100755 --- a/bin/omarchy-install-docker-dbs +++ b/bin/omarchy-install-docker-dbs @@ -5,13 +5,13 @@ options=("MySQL" "PostgreSQL" "Redis" "MongoDB" "MariaDB" "MSSQL") -if [[ "$#" -eq 0 ]]; then +if (( $# == 0 )); then choices=$(printf "%s\n" "${options[@]}" | gum choose --header "Select database (return to install, esc to cancel)") || main_menu else choices="$@" fi -if [[ -n "$choices" ]]; then +if [[ -n $choices ]]; then for db in $choices; do case $db in MySQL) sudo docker run -d --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8.4 ;; diff --git a/bin/omarchy-install-geforce-now b/bin/omarchy-install-geforce-now new file mode 100755 index 00000000..4c941a9b --- /dev/null +++ b/bin/omarchy-install-geforce-now @@ -0,0 +1,17 @@ +#!/bin/bash + +# Install and launch Geforce Now. + +set -e + +omarchy-pkg-add flatpak +cd /tmp + +# Download and run GeForce NOW +curl -LO https://international.download.nvidia.com/GFNLinux/GeForceNOWSetup.bin +chmod +x GeForceNOWSetup.bin +./GeForceNOWSetup.bin + +# Ensure a separate browser process not started by GFN is available. +# If not, it seems like GFN has a tendency to hang on login. +setsid omarchy-launch-browser diff --git a/bin/omarchy-install-nordvpn b/bin/omarchy-install-nordvpn new file mode 100755 index 00000000..5811af74 --- /dev/null +++ b/bin/omarchy-install-nordvpn @@ -0,0 +1,17 @@ +#!/bin/bash + +# Install the NordVPN service with optional GUI. + +echo "Installing NordVPN..." +omarchy-pkg-aur-add nordvpn-bin + +echo "Enabling NordVPN daemon..." +sudo systemctl enable --now nordvpnd + +echo "Adding user to nordvpn group..." +sudo usermod -aG nordvpn "$USER" + +echo -e "\nNordVPN installed! After reboot, run 'nordvpn login' to authenticate." + +echo +gum confirm "Reboot now to make NordVPN usable?" && sudo reboot now diff --git a/bin/omarchy-install-tailscale b/bin/omarchy-install-tailscale index b439744c..a4e9ed5b 100755 --- a/bin/omarchy-install-tailscale +++ b/bin/omarchy-install-tailscale @@ -1,15 +1,10 @@ #!/bin/bash -# Install the Tailscale mesh VPN service, the tsui TUI management app, and a web app for the Tailscale Admin Console. +# Install the Tailscale mesh VPN service and a web app for the Tailscale Admin Console. curl -fsSL https://tailscale.com/install.sh | sh -curl -fsSL https://neuralink.com/tsui/install.sh | bash echo -e "\nStarting Tailscale..." sudo tailscale up --accept-routes -echo -e "\nAdd tsui to sudoers..." -echo "$USER ALL=(ALL) NOPASSWD: $(which tsui)" | sudo tee /etc/sudoers.d/tsui - -omarchy-tui-install "Tailscale" "sudo tsui" float https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/tailscale-light.png -omarchy-webapp-install "Tailscale Admin Console" "https://login.tailscale.com/admin/machines" https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/tailscale-light.png +omarchy-webapp-install "Tailscale" "https://login.tailscale.com/admin/machines" https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/tailscale-light.png diff --git a/bin/omarchy-install-terminal b/bin/omarchy-install-terminal index 4b051ae4..f52744f6 100755 --- a/bin/omarchy-install-terminal +++ b/bin/omarchy-install-terminal @@ -25,33 +25,11 @@ if omarchy-pkg-add $package; then # Copy custom desktop entry for alacritty with X-TerminalArg* keys if [[ $package == "alacritty" ]]; then mkdir -p ~/.local/share/applications - cat > ~/.local/share/applications/Alacritty.desktop << EOF -[Desktop Entry] -Type=Application -TryExec=alacritty -Exec=alacritty -Icon=Alacritty -Terminal=false -Categories=System;TerminalEmulator; -Name=Alacritty -GenericName=Terminal -Comment=A fast, cross-platform, OpenGL terminal emulator -StartupNotify=true -StartupWMClass=Alacritty -Actions=New; -X-TerminalArgExec=-e -X-TerminalArgAppId=--class= -X-TerminalArgTitle=--title= -X-TerminalArgDir=--working-directory= - -[Desktop Action New] -Name=New Terminal -Exec=alacritty -EOF + cp $OMARCHY_PATH/applications/Alacritty.desktop ~/.local/share/applications/ fi # Update xdg-terminals.list to prioritize the proper terminal - cat > ~/.config/xdg-terminals.list << EOF + cat >~/.config/xdg-terminals.list </dev/null diff --git a/bin/omarchy-launch-browser b/bin/omarchy-launch-browser index 0d168978..b4b3e289 100755 --- a/bin/omarchy-launch-browser +++ b/bin/omarchy-launch-browser @@ -6,7 +6,7 @@ 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|mullvad) ]]; then +if $browser_exec --help | grep -q MOZ_LOG; then private_flag="--private-window" elif [[ $browser_exec =~ edge ]]; then private_flag="--inprivate" diff --git a/bin/omarchy-launch-floating-terminal-with-presentation b/bin/omarchy-launch-floating-terminal-with-presentation index b85fed2e..eac1cbb7 100755 --- a/bin/omarchy-launch-floating-terminal-with-presentation +++ b/bin/omarchy-launch-floating-terminal-with-presentation @@ -4,4 +4,4 @@ # Used by actions such as Update System. cmd="$*" -exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.terminal --title=Omarchy -e bash -c "omarchy-show-logo; $cmd; if [ \$? -ne 130 ]; then omarchy-show-done; fi" +exec setsid uwsm-app -- xdg-terminal-exec --app-id=org.omarchy.terminal --title=Omarchy -e bash -c "omarchy-show-logo; $cmd; if (( \$? != 130 )); then omarchy-show-done; fi" diff --git a/bin/omarchy-launch-or-focus b/bin/omarchy-launch-or-focus index 85ab3d6c..1654c844 100755 --- a/bin/omarchy-launch-or-focus +++ b/bin/omarchy-launch-or-focus @@ -10,7 +10,7 @@ fi WINDOW_PATTERN="$1" LAUNCH_COMMAND="${2:-"uwsm-app -- $WINDOW_PATTERN"}" -WINDOW_ADDRESS=$(hyprctl clients -j | jq -r --arg p "$WINDOW_PATTERN" '.[]|select((.class|test("\\b" + $p + "\\b";"i")) or (.title|test("\\b" + $p + "\\b";"i")))|.address' | head -n1) +WINDOW_ADDRESS=$(hyprctl clients -j | jq -r --arg p "$WINDOW_PATTERN" '.[]|select((.class|test("\\b" + p + "\\b";"i")) or (.title|test("\\b" + $p + "\\b";"i")))|.address' | head -n1) if [[ -n $WINDOW_ADDRESS ]]; then hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS" diff --git a/bin/omarchy-launch-walker b/bin/omarchy-launch-walker index 3d92b6b0..8b239f10 100755 --- a/bin/omarchy-launch-walker +++ b/bin/omarchy-launch-walker @@ -1,6 +1,6 @@ #!/bin/bash -# Launch the Walker application launcher while ensuring that it's data provider (called elephant) is runnig first. +# Launch the Walker application launcher while ensuring that it's data provider (called elephant) is running first. # Ensure elephant is running before launching walker if ! pgrep -x elephant > /dev/null; then diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 36f9ba61..8fe6fa4a 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -10,9 +10,9 @@ BACK_TO_EXIT=false back_to() { local parent_menu="$1" - if [[ "$BACK_TO_EXIT" == "true" ]]; then + if [[ $BACK_TO_EXIT == "true" ]]; then exit 0 - elif [[ -n "$parent_menu" ]]; then + elif [[ -n $parent_menu ]]; then "$parent_menu" else show_main_menu @@ -27,10 +27,10 @@ menu() { read -r -a args <<<"$extra" - if [[ -n "$preselect" ]]; then + if [[ -n $preselect ]]; then local index index=$(echo -e "$options" | grep -nxF "$preselect" | cut -d: -f1) - if [[ -n "$index" ]]; then + if [[ -n $index ]]; then args+=("-c" "$index") fi fi @@ -52,15 +52,15 @@ open_in_editor() { } install() { - present_terminal "echo 'Installing $1...'; sudo pacman -S --noconfirm $2" + present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2" } install_and_launch() { - present_terminal "echo 'Installing $1...'; sudo pacman -S --noconfirm $2 && setsid gtk-launch $3" + present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2 && setsid gtk-launch $3" } install_font() { - present_terminal "echo 'Installing $1...'; sudo pacman -S --noconfirm --needed $2 && sleep 2 && omarchy-font-set '$3'" + present_terminal "echo 'Installing $1...'; omarchy-pkg-add $2 && sleep 2 && omarchy-font-set '$3'" } install_terminal() { @@ -68,11 +68,11 @@ install_terminal() { } aur_install() { - present_terminal "echo 'Installing $1 from AUR...'; yay -S --noconfirm $2" + present_terminal "echo 'Installing $1 from AUR...'; omarchy-pkg-aur-add $2" } aur_install_and_launch() { - present_terminal "echo 'Installing $1 from AUR...'; yay -S --noconfirm $2 && setsid gtk-launch $3" + present_terminal "echo 'Installing $1 from AUR...'; omarchy-pkg-aur-add $2 && setsid gtk-launch $3" } show_learn_menu() { @@ -88,38 +88,31 @@ show_learn_menu() { } show_trigger_menu() { - case $(menu "Trigger" " Capture\n Share\n󰔎 Toggle") in + case $(menu "Trigger" " Capture\n Share\n󰔎 Toggle\n Hardware") in *Capture*) show_capture_menu ;; *Share*) show_share_menu ;; *Toggle*) show_toggle_menu ;; + *Hardware*) show_hardware_menu ;; *) show_main_menu ;; esac } show_capture_menu() { case $(menu "Capture" " Screenshot\n Screenrecord\n󰃉 Color") in - *Screenshot*) show_screenshot_menu ;; + *Screenshot*) omarchy-cmd-screenshot ;; *Screenrecord*) show_screenrecord_menu ;; *Color*) pkill hyprpicker || hyprpicker -a ;; *) show_trigger_menu ;; esac } -show_screenshot_menu() { - case $(menu "Screenshot" " Snap with Editing\n Straight to Clipboard") in - *Editing*) omarchy-cmd-screenshot smart ;; - *Clipboard*) omarchy-cmd-screenshot smart clipboard ;; - *) show_capture_menu ;; - esac -} - get_webcam_list() { v4l2-ctl --list-devices 2>/dev/null | while IFS= read -r line; do - if [[ "$line" != $'\t'* && -n "$line" ]]; then + if [[ $line != $'\t'* && -n $line ]]; then local name="$line" IFS= read -r device || break device=$(echo "$device" | tr -d '\t' | head -1) - [[ -n "$device" ]] && echo "$device $name" + [[ -n $device ]] && echo "$device $name" fi done } @@ -128,12 +121,12 @@ show_webcam_select_menu() { local devices=$(get_webcam_list) local count=$(echo "$devices" | grep -c . 2>/dev/null || echo 0) - if [[ -z "$devices" || "$count" -eq 0 ]]; then + if [[ -z $devices ]] || ((count == 0)); then notify-send "No webcam devices found" -u critical -t 3000 return 1 fi - if [[ "$count" -eq 1 ]]; then + if ((count == 1)); then echo "$devices" | awk '{print $1}' else menu "Select Webcam" "$devices" | awk '{print $1}' @@ -143,11 +136,15 @@ show_webcam_select_menu() { show_screenrecord_menu() { omarchy-cmd-screenrecord --stop-recording && exit 0 - case $(menu "Screenrecord" " With desktop audio\n With desktop + microphone audio\n With desktop + microphone audio + webcam") in + case $(menu "Screenrecord" " With no audio\n With desktop audio\n With desktop + microphone audio\n With desktop + microphone audio + webcam") in + *"With no audio") omarchy-cmd-screenrecord ;; *"With desktop audio") omarchy-cmd-screenrecord --with-desktop-audio ;; *"With desktop + microphone audio") omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio ;; *"With desktop + microphone audio + webcam") - local device=$(show_webcam_select_menu) || { back_to show_capture_menu; return; } + local device=$(show_webcam_select_menu) || { + back_to show_capture_menu + return + } omarchy-cmd-screenrecord --with-desktop-audio --with-microphone-audio --with-webcam --webcam-device="$device" ;; *) back_to show_capture_menu ;; @@ -173,11 +170,18 @@ show_toggle_menu() { esac } +show_hardware_menu() { + case $(menu "Toggle" " Hybrid GPU") in + *"Hybrid GPU"*) present_terminal omarchy-toggle-hybrid-gpu ;; + *) show_trigger_menu ;; + esac +} + show_style_menu() { case $(menu "Style" "󰸌 Theme\n Font\n Background\n Hyprland\n󱄄 Screensaver\n About") in *Theme*) show_theme_menu ;; *Font*) show_font_menu ;; - *Background*) omarchy-theme-bg-next ;; + *Background*) show_background_menu ;; *Hyprland*) open_in_editor ~/.config/hypr/looknfeel.conf ;; *Screensaver*) open_in_editor ~/.config/omarchy/branding/screensaver.txt ;; *About*) open_in_editor ~/.config/omarchy/branding/about.txt ;; @@ -189,9 +193,13 @@ show_theme_menu() { omarchy-launch-walker -m menus:omarchythemes --width 800 --minheight 400 } +show_background_menu() { + omarchy-launch-walker -m menus:omarchyBackgroundSelector --width 800 --minheight 400 +} + show_font_menu() { theme=$(menu "Font" "$(omarchy-font-list)" "--width 350" "$(omarchy-font-current)") - if [[ "$theme" == "CNCLD" || -z "$theme" ]]; then + if [[ $theme == "CNCLD" || -z $theme ]]; then back_to show_style_menu else omarchy-font-set "$theme" @@ -200,8 +208,8 @@ show_font_menu() { show_setup_menu() { local options=" Audio\n Wifi\n󰂯 Bluetooth\n󱐋 Power Profile\n System Sleep\n󰍹 Monitors" - [ -f ~/.config/hypr/bindings.conf ] && options="$options\n Keybindings" - [ -f ~/.config/hypr/input.conf ] && options="$options\n Input" + [[ -f ~/.config/hypr/bindings.conf ]] && options="$options\n Keybindings" + [[ -f ~/.config/hypr/input.conf ]] && options="$options\n Input" options="$options\n󰱔 DNS\n Security\n Config" case $(menu "Setup" "$options") in @@ -223,7 +231,7 @@ show_setup_menu() { show_setup_power_menu() { profile=$(menu "Power Profile" "$(omarchy-powerprofiles-list)" "" "$(powerprofilesctl get)") - if [[ "$profile" == "CNCLD" || -z "$profile" ]]; then + if [[ $profile == "CNCLD" || -z $profile ]]; then back_to show_setup_menu else powerprofilesctl set "$profile" @@ -256,10 +264,10 @@ show_setup_config_menu() { show_setup_system_menu() { local options="" - if [ -f ~/.local/state/omarchy/toggles/suspend-on ]; then - options="$options󰒲 Disable Suspend" - else + if [[ -f ~/.local/state/omarchy/toggles/suspend-off ]]; then options="$options󰒲 Enable Suspend" + else + options="$options󰒲 Disable Suspend" fi if omarchy-hibernation-available; then @@ -295,9 +303,10 @@ show_install_menu() { } show_install_service_menu() { - case $(menu "Install" " Dropbox\n Tailscale\n󰟵 Bitwarden\n Chromium Account") in + case $(menu "Install" " Dropbox\n Tailscale\n󱇱 NordVPN\n󰟵 Bitwarden\n Chromium Account") in *Dropbox*) present_terminal omarchy-install-dropbox ;; *Tailscale*) present_terminal omarchy-install-tailscale ;; + *NordVPN*) present_terminal omarchy-install-nordvpn ;; *Bitwarden*) install_and_launch "Bitwarden" "bitwarden bitwarden-cli" "bitwarden" ;; *Chromium*) present_terminal omarchy-install-chromium-google-account ;; *) show_install_menu ;; @@ -308,7 +317,7 @@ show_install_editor_menu() { case $(menu "Install" " VSCode\n Cursor\n Zed\n Sublime Text\n Helix\n Emacs") in *VSCode*) present_terminal omarchy-install-vscode ;; *Cursor*) install_and_launch "Cursor" "cursor-bin" "cursor" ;; - *Zed*) present_terminal "echo 'Installing Zed...'; sudo pacman -S zed && setsid gtk-launch dev.zed.Zed" ;; + *Zed*) install_and_launch "Zed" "zed" "dev.zed.Zed" ;; *Sublime*) install_and_launch "Sublime Text" "sublime-text-4" "sublime_text" ;; *Helix*) install "Helix" "helix" ;; *Emacs*) install "Emacs" "emacs-wayland" && systemctl --user enable --now emacs.service ;; @@ -332,13 +341,13 @@ show_install_ai_menu() { echo ollama ) - case $(menu "Install" " Dictation\n󱚤 Claude Code\n󱚤 Copilot CLI\n󱚤 Cursor CLI\n󱚤 Gemini\n󱚤 OpenAI Codex\n󱚤 LM Studio\n󱚤 Ollama\n󱚤 Crush") in + case $(menu "Install" " Dictation\n󱚤 Claude Code\n󱚤 Codex\n󱚤 Gemini CLI\n󱚤 Copilot CLI\n󱚤 Cursor CLI\n󱚤 LM Studio\n󱚤 Ollama\n󱚤 Crush") in *Dictation*) present_terminal omarchy-voxtype-install ;; *Claude*) install "Claude Code" "claude-code" ;; + *Codex*) install "Codex" "openai-codex" ;; + *Gemini*) install "Gemini CLI" "gemini-cli" ;; *Copilot*) install "Copilot CLI" "github-copilot-cli" ;; *Cursor*) install "Cursor CLI" "cursor-cli" ;; - *Gemini*) install "Gemini" "gemini-cli" ;; - *OpenAI*) install "OpenAI Codex" "openai-codex" ;; *Studio*) install "LM Studio" "lmstudio" ;; *Ollama*) install "Ollama" $ollama_pkg ;; *Crush*) install "Crush" "crush-bin" ;; @@ -347,8 +356,9 @@ show_install_ai_menu() { } show_install_gaming_menu() { - case $(menu "Install" " Steam\n RetroArch [AUR]\n󰍳 Minecraft\n󰖺 Xbox Controller [AUR]") in + case $(menu "Install" " Steam\n󰢹 NVIDIA GeForce NOW\n RetroArch [AUR]\n󰍳 Minecraft\n󰖺 Xbox Controller [AUR]") in *Steam*) present_terminal omarchy-install-steam ;; + *GeForce*) present_terminal omarchy-install-geforce-now ;; *RetroArch*) aur_install_and_launch "RetroArch" "retroarch retroarch-assets libretro libretro-fbneo" "com.libretro.RetroArch.desktop" ;; *Minecraft*) install_and_launch "Minecraft" "minecraft-launcher" "minecraft-launcher" ;; *Xbox*) present_terminal omarchy-install-xbox-controllers ;; @@ -366,7 +376,8 @@ show_install_style_menu() { } show_install_font_menu() { - case $(menu "Install" " Meslo LG Mono\n Fira Code\n Victor Code\n Bistream Vera Mono\n Iosevka" "--width 350") in + case $(menu "Install" " Cascadia Mono\n Meslo LG Mono\n Fira Code\n Victor Code\n Bistream Vera Mono\n Iosevka" "--width 350") in + *Cascadia*) install_font "Cascadia Mono" "ttf-cascadia-mono-nerd" "CaskaydiaMono Nerd Font" ;; *Meslo*) install_font "Meslo LG Mono" "ttf-meslo-nerd" "MesloLGL Nerd Font" ;; *Fira*) install_font "Fira Code" "ttf-firacode-nerd" "FiraCode Nerd Font" ;; *Victor*) install_font "Victor Code" "ttf-victor-mono-nerd" "VictorMono Nerd Font" ;; @@ -423,11 +434,12 @@ show_install_elixir_menu() { } show_remove_menu() { - case $(menu "Remove" "󰣇 Package\n Web App\n TUI\n󰵮 Development\n Dictation\n󰸌 Theme\n󰍲 Windows\n󰈷 Fingerprint\n Fido2") in + case $(menu "Remove" "󰣇 Package\n Web App\n TUI\n󰵮 Development\n󰏓 Preinstalls\n Dictation\n󰸌 Theme\n󰍲 Windows\n󰈷 Fingerprint\n Fido2") in *Package*) terminal omarchy-pkg-remove ;; *Web*) present_terminal omarchy-webapp-remove ;; *TUI*) present_terminal omarchy-tui-remove ;; *Development*) show_remove_development_menu ;; + *Preinstalls*) present_terminal omarchy-remove-preinstalls ;; *Dictation*) present_terminal omarchy-voxtype-remove ;; *Theme*) present_terminal omarchy-theme-remove ;; *Windows*) present_terminal "omarchy-windows-vm remove" ;; @@ -438,7 +450,7 @@ show_remove_menu() { } show_remove_development_menu() { - case $(menu "Remove" "󰫏 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") in + case $(menu "Remove" "󰫏 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\n Scala") in *Rails*) present_terminal "omarchy-remove-dev-env ruby" ;; *JavaScript*) show_remove_javascript_menu ;; *Go*) present_terminal "omarchy-remove-dev-env go" ;; @@ -451,12 +463,13 @@ show_remove_development_menu() { *NET*) present_terminal "omarchy-remove-dev-env dotnet" ;; *OCaml*) present_terminal "omarchy-remove-dev-env ocaml" ;; *Clojure*) present_terminal "omarchy-remove-dev-env clojure" ;; + *Scala*) present_terminal "omarchy-remove-dev-env scala" ;; *) show_remove_menu ;; esac } show_remove_javascript_menu() { - case $(menu "Remove" " Node.js\n Bun\n Deno") in + case $(menu "Remove" " Node.js\n Bun\n Deno") in *Node*) present_terminal "omarchy-remove-dev-env node" ;; *Bun*) present_terminal "omarchy-remove-dev-env bun" ;; *Deno*) present_terminal "omarchy-remove-dev-env deno" ;; @@ -465,7 +478,7 @@ show_remove_javascript_menu() { } show_remove_php_menu() { - case $(menu "Remove" " PHP\n Laravel\n Symfony") in + case $(menu "Remove" " PHP\n Laravel\n Symfony") in *PHP*) present_terminal "omarchy-remove-dev-env php" ;; *Laravel*) present_terminal "omarchy-remove-dev-env laravel" ;; *Symfony*) present_terminal "omarchy-remove-dev-env symfony" ;; @@ -474,7 +487,7 @@ show_remove_php_menu() { } show_remove_elixir_menu() { - case $(menu "Remove" " Elixir\n Phoenix") in + case $(menu "Remove" " Elixir\n Phoenix") in *Elixir*) present_terminal "omarchy-remove-dev-env elixir" ;; *Phoenix*) present_terminal "omarchy-remove-dev-env phoenix" ;; *) show_remove_development_menu ;; @@ -482,7 +495,7 @@ show_remove_elixir_menu() { } show_update_menu() { - case $(menu "Update" " Omarchy\n󰔫 Channel\n Config\n󰸌 Extra Themes\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone\n Time") in + case $(menu "Update" "  Omarchy\n󰔫 Channel\n Config\n󰸌 Extra Themes\n Process\n󰇅 Hardware\n Firmware\n Password\n Timezone\n Time") in *Omarchy*) present_terminal omarchy-update ;; *Channel*) show_update_channel_menu ;; *Config*) show_update_config_menu ;; @@ -498,8 +511,9 @@ show_update_menu() { } show_update_channel_menu() { - case $(menu "Update channel" "🟢 Stable\n🟡 Edge\n🔴 Dev") in + case $(menu "Update channel" "🟢 Stable\n🟡 RC\n🟠 Edge\n🔴 Dev") in *Stable*) present_terminal "omarchy-channel-set stable" ;; + *RC*) present_terminal "omarchy-channel-set rc" ;; *Edge*) present_terminal "omarchy-channel-set edge" ;; *Dev*) present_terminal "omarchy-channel-set dev" ;; *) show_update_menu ;; @@ -517,13 +531,14 @@ show_update_process_menu() { } show_update_config_menu() { - case $(menu "Use default config" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n󱣴 Plymouth\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in + case $(menu "Use default config" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n󱣴 Plymouth\n Swayosd\n Tmux\n󰌧 Walker\n󰍜 Waybar") in *Hyprland*) present_terminal omarchy-refresh-hyprland ;; *Hypridle*) present_terminal omarchy-refresh-hypridle ;; *Hyprlock*) present_terminal omarchy-refresh-hyprlock ;; *Hyprsunset*) present_terminal omarchy-refresh-hyprsunset ;; *Plymouth*) present_terminal omarchy-refresh-plymouth ;; *Swayosd*) present_terminal omarchy-refresh-swayosd ;; + *Tmux*) present_terminal omarchy-refresh-tmux ;; *Walker*) present_terminal omarchy-refresh-walker ;; *Waybar*) present_terminal omarchy-refresh-waybar ;; *) show_update_menu ;; @@ -547,19 +562,24 @@ show_update_password_menu() { esac } +show_about() { + omarchy-launch-about +} + show_system_menu() { - local options=" Lock\n󱄄 Screensaver" - [ -f ~/.local/state/omarchy/toggles/suspend-on ] && options="$options\n󰒲 Suspend" + local options="󱄄 Screensaver\n Lock" + [[ ! -f ~/.local/state/omarchy/toggles/suspend-off ]] && options="$options\n󰒲 Suspend" omarchy-hibernation-available && options="$options\n󰤁 Hibernate" - options="$options\n󰜉 Restart\n󰐥 Shutdown" + options="$options\n󰍃 Logout\n󰜉 Restart\n󰐥 Shutdown" case $(menu "System" "$options") in - *Lock*) omarchy-lock-screen ;; *Screensaver*) omarchy-launch-screensaver force ;; + *Lock*) omarchy-lock-screen ;; *Suspend*) systemctl suspend ;; *Hibernate*) systemctl hibernate ;; - *Restart*) omarchy-cmd-reboot ;; - *Shutdown*) omarchy-cmd-shutdown ;; + *Logout*) omarchy-system-logout ;; + *Restart*) omarchy-system-reboot ;; + *Shutdown*) omarchy-system-shutdown ;; *) back_to show_main_menu ;; esac } @@ -574,16 +594,17 @@ go_to_menu() { *learn*) show_learn_menu ;; *trigger*) show_trigger_menu ;; *share*) show_share_menu ;; + *background*) show_background_menu ;; + *capture*) show_capture_menu ;; *style*) show_style_menu ;; *theme*) show_theme_menu ;; - *screenshot*) show_screenshot_menu ;; *screenrecord*) show_screenrecord_menu ;; *setup*) show_setup_menu ;; *power*) show_setup_power_menu ;; *install*) show_install_menu ;; *remove*) show_remove_menu ;; *update*) show_update_menu ;; - *about*) omarchy-launch-about ;; + *about*) show_about ;; *system*) show_system_menu ;; esac } @@ -592,7 +613,7 @@ go_to_menu() { USER_EXTENSIONS="$HOME/.config/omarchy/extensions/menu.sh" [[ -f $USER_EXTENSIONS ]] && source "$USER_EXTENSIONS" -if [[ -n "$1" ]]; then +if [[ -n $1 ]]; then BACK_TO_EXIT=true go_to_menu "$1" else diff --git a/bin/omarchy-menu-keybindings b/bin/omarchy-menu-keybindings index fcd31a98..dd6f97b2 100755 --- a/bin/omarchy-menu-keybindings +++ b/bin/omarchy-menu-keybindings @@ -12,7 +12,7 @@ build_keymap_cache() { } while IFS=, read -r code sym; do - [[ -z "$code" || -z "$sym" ]] && continue + [[ -z $code || -z $sym ]] && continue KEYCODE_SYM_MAP["$code"]="$sym" done < <( awk ' @@ -42,13 +42,13 @@ lookup_keycode_cached() { parse_keycodes() { local start end elapsed - [[ "${DEBUG:-0}" == "1" ]] && start=$(date +%s.%N) + [[ ${DEBUG:-0} == "1" ]] && start=$(date +%s.%N) while IFS= read -r line; do - if [[ "$line" =~ code:([0-9]+) ]]; then + if [[ $line =~ code:([0-9]+) ]]; then code="${BASH_REMATCH[1]}" symbol=$(lookup_keycode_cached "$code" "$XKB_KEYMAP_CACHE") echo "${line/code:${code}/$symbol}" - elif [[ "$line" =~ mouse:([0-9]+) ]]; then + elif [[ $line =~ mouse:([0-9]+) ]]; then code="${BASH_REMATCH[1]}" case "$code" in @@ -64,7 +64,7 @@ parse_keycodes() { fi done - if [[ "$DEBUG" == "1" ]]; then + if [[ $DEBUG == "1" ]]; then end=$(date +%s.%N) # fall back to awk if bc is missing if command -v bc >/dev/null 2>&1; then @@ -168,44 +168,47 @@ prioritize_entries() { line = $0 prio = 50 if (match(line, /Terminal/)) prio = 0 - if (match(line, /Browser/) && !match(line, /Browser[[:space:]]*\(/)) prio = 1 - if (match(line, /File manager/)) prio = 2 - if (match(line, /Launch apps/)) prio = 3 - if (match(line, /Omarchy menu/)) prio = 4 - if (match(line, /System menu/)) prio = 5 - if (match(line, /Theme menu/)) prio = 6 - if (match(line, /Full screen/)) prio = 7 - if (match(line, /Full width/)) prio = 8 - if (match(line, /Close window/)) prio = 9 - if (match(line, /Close all windows/)) prio = 10 - if (match(line, /Lock system/)) prio = 11 - if (match(line, /Toggle window floating/)) prio = 12 - if (match(line, /Toggle window split/)) prio = 13 - if (match(line, /Pop window/)) prio = 14 - if (match(line, /Universal/)) prio = 15 - if (match(line, /Clipboard/)) prio = 16 - if (match(line, /Audio controls/)) prio = 17 - if (match(line, /Bluetooth controls/)) prio = 18 - if (match(line, /Wifi controls/)) prio = 19 - if (match(line, /Emoji picker/)) prio = 20 - if (match(line, /Color picker/)) prio = 21 - if (match(line, /Screenshot/)) prio = 22 - if (match(line, /Screenrecording/)) prio = 23 - if (match(line, /(Switch|Next|Former|Previous).*workspace/)) prio = 24 - if (match(line, /Move window to workspace/)) prio = 25 - if (match(line, /Move window silently to workspace/)) prio = 26 - if (match(line, /Swap window/)) prio = 27 - if (match(line, /Move window focus/)) prio = 28 - if (match(line, /Move window$/)) prio = 29 - if (match(line, /Resize window/)) prio = 30 - if (match(line, /Expand window/)) prio = 31 - if (match(line, /Shrink window/)) prio = 32 - if (match(line, /scratchpad/)) prio = 33 - if (match(line, /notification/)) prio = 34 - if (match(line, /Toggle window transparency/)) prio = 35 - if (match(line, /Toggle workspace gaps/)) prio = 36 - if (match(line, /Toggle nightlight/)) prio = 37 - if (match(line, /Toggle locking/)) prio = 38 + if (match(line, /Tmux/)) prio = 1 + if (match(line, /Browser/) && !match(line, /Browser[[:space:]]*\(/) && !match(line, /SUPER SHIFT.*\+.*B.*→.*Browser/)) prio = 2 + if (match(line, /File manager/) && !match(line, /File manager \(cwd\)/)) prio = 3 + if (match(line, /Launch apps/)) prio = 4 + if (match(line, /Omarchy menu/)) prio = 5 + if (match(line, /System menu/)) prio = 6 + if (match(line, /Theme menu/)) prio = 7 + if (match(line, /Full screen/)) prio = 8 + if (match(line, /Full width/)) prio = 9 + if (match(line, /Close window/)) prio = 10 + if (match(line, /Close all windows/)) prio = 11 + if (match(line, /Lock system/)) prio = 12 + if (match(line, /Toggle window floating/)) prio = 13 + if (match(line, /Toggle window split/)) prio = 14 + if (match(line, /Pop window/)) prio = 15 + if (match(line, /Universal/)) prio = 16 + if (match(line, /Clipboard/)) prio = 17 + if (match(line, /Audio controls/)) prio = 18 + if (match(line, /Bluetooth controls/)) prio = 19 + if (match(line, /Wifi controls/)) prio = 20 + if (match(line, /Emoji picker/)) prio = 21 + if (match(line, /Color picker/)) prio = 22 + if (match(line, /Screenshot/)) prio = 23 + if (match(line, /Screenrecording/)) prio = 24 + if (match(line, /SUPER SHIFT.*\+.*B.*→.*Browser/)) prio = 25 + if (match(line, /File manager \(cwd\)/)) prio = 26 + if (match(line, /(Switch|Next|Former|Previous).*workspace/)) prio = 27 + if (match(line, /Move window to workspace/)) prio = 28 + if (match(line, /Move window silently to workspace/)) prio = 29 + if (match(line, /Swap window/)) prio = 30 + if (match(line, /Move window focus/)) prio = 31 + if (match(line, /Move window$/)) prio = 32 + if (match(line, /Resize window/)) prio = 33 + if (match(line, /Expand window/)) prio = 34 + if (match(line, /Shrink window/)) prio = 35 + if (match(line, /scratchpad/)) prio = 36 + if (match(line, /notification/)) prio = 37 + if (match(line, /Toggle window transparency/)) prio = 38 + if (match(line, /Toggle workspace gaps/)) prio = 39 + if (match(line, /Toggle nightlight/)) prio = 40 + if (match(line, /Toggle locking/)) prio = 41 if (match(line, /group/)) prio = 94 if (match(line, /Scroll active workspace/)) prio = 95 if (match(line, /Cycle to/)) prio = 96 @@ -233,7 +236,7 @@ output_keybindings() { prioritize_entries } -if [[ "$1" == "--print" || "$1" == "-p" ]]; then +if [[ $1 == "--print" || $1 == "-p" ]]; then output_keybindings else monitor_height=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .height') @@ -242,4 +245,3 @@ else output_keybindings | walker --dmenu -p 'Keybindings' --width 800 --height "$menu_height" fi - diff --git a/bin/omarchy-migrate b/bin/omarchy-migrate index 2bb5a468..a60cba74 100755 --- a/bin/omarchy-migrate +++ b/bin/omarchy-migrate @@ -13,7 +13,7 @@ mkdir -p "$STATE_DIR/skipped" for file in ~/.local/share/omarchy/migrations/*.sh; do filename=$(basename "$file") - if [[ ! -f "$STATE_DIR/$filename" && ! -f "$STATE_DIR/skipped/$filename" ]]; then + if [[ ! -f $STATE_DIR/$filename && ! -f $STATE_DIR/skipped/$filename ]]; then echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m" if bash $file; then diff --git a/bin/omarchy-pkg-aur-install b/bin/omarchy-pkg-aur-install index 8fb849c0..02c506b3 100755 --- a/bin/omarchy-pkg-aur-install +++ b/bin/omarchy-pkg-aur-install @@ -18,9 +18,10 @@ fzf_args=( pkg_names=$(yay -Slqa | fzf "${fzf_args[@]}") -if [[ -n "$pkg_names" ]]; then - # Convert newline-separated selections to space-separated for yay - echo "$pkg_names" | tr '\n' ' ' | xargs yay -S --noconfirm +if [[ -n $pkg_names ]]; then + # Add aur/ prefix to each package name and convert to space-separated for yay + sudo -v + echo "$pkg_names" | sed 's/^/aur\//' | tr '\n' ' ' | xargs yay -S --noconfirm sudo updatedb omarchy-show-done fi diff --git a/bin/omarchy-pkg-install b/bin/omarchy-pkg-install index 9a964119..09386161 100755 --- a/bin/omarchy-pkg-install +++ b/bin/omarchy-pkg-install @@ -16,7 +16,7 @@ fzf_args=( pkg_names=$(pacman -Slq | fzf "${fzf_args[@]}") -if [[ -n "$pkg_names" ]]; then +if [[ -n $pkg_names ]]; then # Convert newline-separated selections to space-separated for yay echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -S --noconfirm omarchy-show-done diff --git a/bin/omarchy-pkg-remove b/bin/omarchy-pkg-remove index aba8d0e3..865c1354 100755 --- a/bin/omarchy-pkg-remove +++ b/bin/omarchy-pkg-remove @@ -16,7 +16,7 @@ fzf_args=( pkg_names=$(yay -Qqe | fzf "${fzf_args[@]}") -if [[ -n "$pkg_names" ]]; then +if [[ -n $pkg_names ]]; then # Convert newline-separated selections to space-separated for yay echo "$pkg_names" | tr '\n' ' ' | xargs sudo pacman -Rns --noconfirm omarchy-show-done diff --git a/bin/omarchy-refresh-chromium b/bin/omarchy-refresh-chromium index ee447b93..e206f363 100755 --- a/bin/omarchy-refresh-chromium +++ b/bin/omarchy-refresh-chromium @@ -6,7 +6,7 @@ CONFIG_FILE="$HOME/.config/chromium-flags.conf" INSTALL_GOOGLE_ACCOUNTS=false # Check if google accounts were installed -if [[ -f "$CONFIG_FILE" ]] && \ +if [[ -f $CONFIG_FILE ]] && \ grep -q -- "--oauth2-client-id" "$CONFIG_FILE" && \ grep -q -- "--oauth2-client-secret" "$CONFIG_FILE"; then INSTALL_GOOGLE_ACCOUNTS=true @@ -16,6 +16,6 @@ fi omarchy-refresh-config chromium-flags.conf # Re-install Google accounts if previously configured -if [[ "$INSTALL_GOOGLE_ACCOUNTS" == true ]]; then +if [[ $INSTALL_GOOGLE_ACCOUNTS == "true" ]]; then omarchy-install-chromium-google-account fi diff --git a/bin/omarchy-refresh-config b/bin/omarchy-refresh-config index f3692429..b293206a 100755 --- a/bin/omarchy-refresh-config +++ b/bin/omarchy-refresh-config @@ -5,7 +5,7 @@ config_file=$1 -if [[ -z "$config_file" ]]; then +if [[ -z $config_file ]]; then cat </dev/null diff --git a/bin/omarchy-refresh-pacman b/bin/omarchy-refresh-pacman index 3cffd226..f09b44fb 100755 --- a/bin/omarchy-refresh-pacman +++ b/bin/omarchy-refresh-pacman @@ -7,17 +7,18 @@ sudo cp -f /etc/pacman.conf /etc/pacman.conf.bak sudo cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak -if [[ $1 == "edge" ]]; then - sudo cp -f ~/.local/share/omarchy/default/pacman/pacman-edge.conf /etc/pacman.conf - sudo cp -f ~/.local/share/omarchy/default/pacman/mirrorlist-edge /etc/pacman.d/mirrorlist - echo "Setting channel to edge" -else - sudo cp -f ~/.local/share/omarchy/default/pacman/pacman-stable.conf /etc/pacman.conf - sudo cp -f ~/.local/share/omarchy/default/pacman/mirrorlist-stable /etc/pacman.d/mirrorlist - echo "Setting channel to stable" +channel="${1:-stable}" + +if [[ $channel != "stable" && $channel != "rc" && $channel != "edge" ]]; then + echo "Error: Invalid channel '$channel'. Must be one of: stable, rc, edge" + exit 1 fi +echo "Setting channel to $channel" echo +sudo cp -f "$OMARCHY_PATH/default/pacman/pacman-$channel.conf" /etc/pacman.conf +sudo cp -f "$OMARCHY_PATH/default/pacman/mirrorlist-$channel" /etc/pacman.d/mirrorlist + # Reset all package DBs and then update -sudo pacman -Syyu --noconfirm +sudo pacman -Syyuu --noconfirm diff --git a/bin/omarchy-refresh-sddm b/bin/omarchy-refresh-sddm new file mode 100755 index 00000000..473bb3ee --- /dev/null +++ b/bin/omarchy-refresh-sddm @@ -0,0 +1,6 @@ +#!/bin/bash + +# Refresh the SDDM theme from default + +sudo rm -rf /usr/share/sddm/themes/omarchy +sudo cp -r $OMARCHY_PATH/default/sddm/omarchy /usr/share/sddm/themes/omarchy diff --git a/bin/omarchy-refresh-tmux b/bin/omarchy-refresh-tmux new file mode 100755 index 00000000..64c7f9f2 --- /dev/null +++ b/bin/omarchy-refresh-tmux @@ -0,0 +1,9 @@ +#!/bin/bash + +# Overwrite the user tmux config with the Omarchy default and reload tmux. + +omarchy-refresh-config tmux/tmux.conf + +if pgrep -x tmux; then + tmux source-file ~/.config/tmux/tmux.conf +fi diff --git a/bin/omarchy-refresh-walker b/bin/omarchy-refresh-walker index a08a29cc..dd6900e1 100755 --- a/bin/omarchy-refresh-walker +++ b/bin/omarchy-refresh-walker @@ -5,9 +5,17 @@ # Ensure walker is set to autostart mkdir -p ~/.config/autostart/ cp $OMARCHY_PATH/default/walker/walker.desktop ~/.config/autostart/ + +# And restarts if it crashes or is killed +mkdir -p ~/.config/systemd/user/app-walker@autostart.service.d/ +cp $OMARCHY_PATH/default/walker/restart.conf ~/.config/systemd/user/app-walker@autostart.service.d/restart.conf + systemctl --user daemon-reload +# Refresh configs omarchy-refresh-config walker/config.toml omarchy-refresh-config elephant/calc.toml omarchy-refresh-config elephant/desktopapplications.toml + +# Restart service omarchy-restart-walker diff --git a/bin/omarchy-reinstall b/bin/omarchy-reinstall index edfab730..df00c609 100755 --- a/bin/omarchy-reinstall +++ b/bin/omarchy-reinstall @@ -10,5 +10,5 @@ if gum confirm "Are you sure you want to reinstall and lose all config changes?" omarchy-reinstall-pkgs omarchy-reinstall-configs - gum confirm "System has been reinstalled. Reboot?" && omarchy-cmd-reboot + gum confirm "System has been reinstalled. Reboot?" && omarchy-system-reboot fi diff --git a/bin/omarchy-reinstall-configs b/bin/omarchy-reinstall-configs index d1a99c42..c27b1efa 100755 --- a/bin/omarchy-reinstall-configs +++ b/bin/omarchy-reinstall-configs @@ -3,7 +3,7 @@ set -e # Overwrite all user configs with the Omarchy defaults. -if [ "$EUID" -eq 0 ]; then +if (( EUID == 0 )); then echo "Error: This script should not be run as root" exit 1 fi diff --git a/bin/omarchy-remove-dev-env b/bin/omarchy-remove-dev-env index d2320149..f25a5ff0 100755 --- a/bin/omarchy-remove-dev-env +++ b/bin/omarchy-remove-dev-env @@ -1,7 +1,10 @@ #!/bin/bash -if [[ -z "$1" ]]; then - echo "Usage: omarchy-remove-dev-env " >&2 +# Remove a development environment that was previously installed via omarchy-install-dev-env. +# Usage: omarchy-remove-dev-env + +if [[ -z $1 ]]; then + echo "Usage: omarchy-remove-dev-env " >&2 exit 1 fi @@ -93,6 +96,13 @@ clojure) mise uninstall clojure --all mise rm -g clojure ;; +scala) + echo -e "Removing Scala...\n" + mise uninstall scala --all + mise uninstall scala-cli --all + mise rm -g scala + mise rm -g scala-cli + ;; *) echo "Unknown environment: $1" exit 1 diff --git a/bin/omarchy-remove-preinstalls b/bin/omarchy-remove-preinstalls new file mode 100755 index 00000000..d4e9a615 --- /dev/null +++ b/bin/omarchy-remove-preinstalls @@ -0,0 +1,32 @@ +#!/bin/bash + +# Remove preinstalled Omarchy applications (web apps, TUIs, and selected packages). +# This removes all web apps, TUIs, plus specific desktop applications. + +if gum confirm "Are you sure you want to remove all preinstalled web apps, TUI wrappers, and desktop applications?"; then + echo -e "Removing preinstalled Omarchy applications...\n" + + omarchy-webapp-remove-all + omarchy-tui-remove-all + + cp ~/.config/hypr/bindings.conf ~/.config/hypr/bindings.conf.bak + cp "$OMARCHY_PATH/default/hypr/plain-bindings.conf" ~/.config/hypr/bindings.conf + hyprctl reload + + omarchy-pkg-drop \ + aether \ + typora \ + spotify \ + libreoffice-fresh \ + 1password-beta \ + 1password-cli \ + xournalpp \ + signal-desktop \ + pinta \ + obsidian \ + obs-studio \ + kdenlive \ + lazydocker \ + opencode \ + claude-code +fi diff --git a/bin/omarchy-reset-sudo b/bin/omarchy-reset-sudo index 94822623..2c568469 100755 --- a/bin/omarchy-reset-sudo +++ b/bin/omarchy-reset-sudo @@ -1,4 +1,7 @@ #!/bin/bash +# Reset the sudo lockout/faillock for the current user. +# This clears any failed authentication attempts that may have locked the user out. + # Resetting sudo lockout for user su -c "faillock --reset --user $USER" diff --git a/bin/omarchy-restart-app b/bin/omarchy-restart-app index 4cc474fa..78556e3e 100755 --- a/bin/omarchy-restart-app +++ b/bin/omarchy-restart-app @@ -1,4 +1,7 @@ #!/bin/bash +# Restart an application by killing it and relaunching via uwsm. +# Usage: omarchy-restart-app [application-args...] + pkill -x $1 -setsid uwsm-app -- $1 >/dev/null 2>&1 & +setsid uwsm-app -- "$@" >/dev/null 2>&1 & diff --git a/bin/omarchy-restart-bluetooth b/bin/omarchy-restart-bluetooth index 1d3c6c11..57530d10 100755 --- a/bin/omarchy-restart-bluetooth +++ b/bin/omarchy-restart-bluetooth @@ -1,5 +1,7 @@ #!/bin/bash +# Unblock and restart the bluetooth service. + echo -e "Unblocking bluetooth...\n" rfkill unblock bluetooth rfkill list bluetooth diff --git a/bin/omarchy-restart-hypridle b/bin/omarchy-restart-hypridle index 261f0aa3..02186267 100755 --- a/bin/omarchy-restart-hypridle +++ b/bin/omarchy-restart-hypridle @@ -1,3 +1,5 @@ #!/bin/bash +# Restart the hypridle service (used for idle detection and auto-lock). + omarchy-restart-app hypridle diff --git a/bin/omarchy-restart-hyprsunset b/bin/omarchy-restart-hyprsunset index 0e681bfd..c705ab53 100755 --- a/bin/omarchy-restart-hyprsunset +++ b/bin/omarchy-restart-hyprsunset @@ -1,3 +1,5 @@ #!/bin/bash +# Restart the hyprsunset service (used for blue light filtering/night light). + omarchy-restart-app hyprsunset diff --git a/bin/omarchy-restart-opencode b/bin/omarchy-restart-opencode index 2ff22d3e..086eba9f 100755 --- a/bin/omarchy-restart-opencode +++ b/bin/omarchy-restart-opencode @@ -2,4 +2,6 @@ # Reload opencode configuration (used by the Omarchy theme switching). -killall -SIGUSR2 opencode +if pgrep -x opencode >/dev/null; then + killall -SIGUSR2 opencode +fi diff --git a/bin/omarchy-restart-pipewire b/bin/omarchy-restart-pipewire index f26ee09e..a222ad1e 100755 --- a/bin/omarchy-restart-pipewire +++ b/bin/omarchy-restart-pipewire @@ -1,4 +1,6 @@ #!/bin/bash +# Restart the PipeWire audio service to fix audio issues or apply new configuration. + echo -e "Restarting pipewire audio service...\n" systemctl --user restart pipewire.service diff --git a/bin/omarchy-restart-walker b/bin/omarchy-restart-walker index 2efb9d53..fb1a9eae 100755 --- a/bin/omarchy-restart-walker +++ b/bin/omarchy-restart-walker @@ -12,7 +12,7 @@ restart_services() { fi } -if [[ $EUID -eq 0 ]]; then +if (( EUID == 0 )); then SCRIPT_OWNER=$(stat -c '%U' "$0") USER_UID=$(id -u "$SCRIPT_OWNER") systemd-run --uid="$SCRIPT_OWNER" --setenv=XDG_RUNTIME_DIR="/run/user/$USER_UID" \ diff --git a/bin/omarchy-restart-wifi b/bin/omarchy-restart-wifi index b4d66a5a..5cf35dd3 100755 --- a/bin/omarchy-restart-wifi +++ b/bin/omarchy-restart-wifi @@ -1,5 +1,7 @@ #!/bin/bash +# Unblock and restart the Wi-Fi service. + echo -e "Unblocking wifi...\n" rfkill unblock wifi rfkill list wifi diff --git a/bin/omarchy-restart-xcompose b/bin/omarchy-restart-xcompose index 45f7d9a8..c66bfe7a 100755 --- a/bin/omarchy-restart-xcompose +++ b/bin/omarchy-restart-xcompose @@ -1,3 +1,5 @@ #!/bin/bash -omarchy-restart-app fcitx5 +# Restart the XCompose input method service (fcitx5) to apply new compose key settings. + +omarchy-restart-app fcitx5 --disable notificationitem diff --git a/bin/omarchy-setup-dns b/bin/omarchy-setup-dns index 472b5550..7a60b641 100755 --- a/bin/omarchy-setup-dns +++ b/bin/omarchy-setup-dns @@ -1,7 +1,30 @@ #!/bin/bash +lock_dns_to_resolved() { + for file in /etc/systemd/network/*.network; do + [[ -f $file ]] || continue + if ! grep -q "^\[DHCPv4\]" "$file"; then continue; fi + + if ! sed -n '/^\[DHCPv4\]/,/^\[/p' "$file" | grep -q "^UseDNS="; then + sudo sed -i '/^\[DHCPv4\]/a UseDNS=no' "$file" + fi + + if grep -q "^\[IPv6AcceptRA\]" "$file" && ! sed -n '/^\[IPv6AcceptRA\]/,/^\[/p' "$file" | grep -q "^UseDNS="; then + sudo sed -i '/^\[IPv6AcceptRA\]/a UseDNS=no' "$file" + fi + done +} + +unlock_dns_to_dhcp() { + for file in /etc/systemd/network/*.network; do + [[ -f $file ]] || continue + sudo sed -i '/^\[DHCPv4\]/{n;/^UseDNS=no$/d}' "$file" + sudo sed -i '/^\[IPv6AcceptRA\]/{n;/^UseDNS=no$/d}' "$file" + done +} + if [[ -z $1 ]]; then - dns=$(gum choose --height 5 --header "Select DNS provider" Cloudflare DHCP Custom) + dns=$(gum choose --height 6 --header "Select DNS provider" Cloudflare Google DHCP Custom) else dns=$1 fi @@ -14,24 +37,17 @@ DNS=1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com FallbackDNS=9.9.9.9 149.112.112.112 DNSOverTLS=opportunistic EOF - - # Ensure network interfaces don't override our DNS settings - for file in /etc/systemd/network/*.network; do - [[ -f "$file" ]] || continue - if ! grep -q "^\[DHCPv4\]" "$file"; then continue; fi - - # Add UseDNS=no to DHCPv4 section if not present - if ! sed -n '/^\[DHCPv4\]/,/^\[/p' "$file" | grep -q "^UseDNS="; then - sudo sed -i '/^\[DHCPv4\]/a UseDNS=no' "$file" - fi - - # Add UseDNS=no to IPv6AcceptRA section if present - if grep -q "^\[IPv6AcceptRA\]" "$file" && ! sed -n '/^\[IPv6AcceptRA\]/,/^\[/p' "$file" | grep -q "^UseDNS="; then - sudo sed -i '/^\[IPv6AcceptRA\]/a UseDNS=no' "$file" - fi - done - - sudo systemctl restart systemd-networkd systemd-resolved + lock_dns_to_resolved + ;; + +Google) + sudo tee /etc/systemd/resolved.conf >/dev/null <<'EOF' +[Resolve] +DNS=8.8.8.8#dns.google 8.8.4.4#dns.google +FallbackDNS=9.9.9.9 149.112.112.112 +DNSOverTLS=opportunistic +EOF + lock_dns_to_resolved ;; DHCP) @@ -39,21 +55,14 @@ DHCP) [Resolve] DNSOverTLS=no EOF - - # Allow network interfaces to use DHCP DNS - for file in /etc/systemd/network/*.network; do - [[ -f "$file" ]] || continue - sudo sed -i '/^UseDNS=no/d' "$file" - done - - sudo systemctl restart systemd-networkd systemd-resolved + unlock_dns_to_dhcp ;; Custom) echo "Enter your DNS servers (space-separated, e.g. '192.168.1.1 1.1.1.1'):" read -r dns_servers - if [[ -z "$dns_servers" ]]; then + if [[ -z $dns_servers ]]; then echo "Error: No DNS servers provided." exit 1 fi @@ -63,25 +72,8 @@ Custom) DNS=$dns_servers FallbackDNS=9.9.9.9 149.112.112.112 EOF - - # Ensure network interfaces don't override our DNS settings - for file in /etc/systemd/network/*.network; do - [[ -f "$file" ]] || continue - if ! grep -q "^\[DHCPv4\]" "$file"; then continue; fi - - # Add UseDNS=no to DHCPv4 section if not present - if ! sed -n '/^\[DHCPv4\]/,/^\[/p' "$file" | grep -q "^UseDNS="; then - sudo sed -i '/^\[DHCPv4\]/a UseDNS=no' "$file" - fi - - # Add UseDNS=no to IPv6AcceptRA section if present - if grep -q "^\[IPv6AcceptRA\]" "$file" && ! sed -n '/^\[IPv6AcceptRA\]/,/^\[/p' "$file" | grep -q "^UseDNS="; then - sudo sed -i '/^\[IPv6AcceptRA\]/a UseDNS=no' "$file" - fi - done - - sudo systemctl restart systemd-networkd systemd-resolved - + lock_dns_to_resolved ;; esac +sudo systemctl restart systemd-networkd systemd-resolved diff --git a/bin/omarchy-setup-fido2 b/bin/omarchy-setup-fido2 index ecf3e2bb..c042cf2c 100755 --- a/bin/omarchy-setup-fido2 +++ b/bin/omarchy-setup-fido2 @@ -21,7 +21,7 @@ print_info() { check_fido2_hardware() { tokens=$(fido2-token -L 2>/dev/null) - if [ -z "$tokens" ]; then + if [[ -z $tokens ]]; then print_error "\nNo FIDO2 device detected. Please plug it in (you may need to unlock it as well)." return 1 fi @@ -36,10 +36,10 @@ setup_pam_config() { fi # Configure polkit - if [ -f /etc/pam.d/polkit-1 ] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then + if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then print_info "Configuring polkit for FIDO2 authentication..." sudo sed -i '1i auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/polkit-1 - elif [ ! -f /etc/pam.d/polkit-1 ]; then + elif [[ ! -f /etc/pam.d/polkit-1 ]]; then print_info "Creating polkit configuration with FIDO2 authentication..." sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF' auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2 @@ -60,20 +60,20 @@ remove_pam_config() { fi # Remove from polkit - if [ -f /etc/pam.d/polkit-1 ] && grep -Fq 'pam_u2f.so' /etc/pam.d/polkit-1; then + if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_u2f.so' /etc/pam.d/polkit-1; then print_info "Removing FIDO2 authentication from polkit..." sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/polkit-1 fi } -if [[ "--remove" == "$1" ]]; then +if [[ "--remove" == $1 ]]; then print_success "Removing FIDO2 device from authentication.\n" # Remove PAM configuration remove_pam_config # Remove FIDO2 configuration - if [ -d /etc/fido2 ]; then + if [[ -d /etc/fido2 ]]; then print_info "Removing FIDO2 configuration..." sudo rm -rf /etc/fido2 fi @@ -88,14 +88,14 @@ else # Install required packages print_info "Installing required packages..." - sudo pacman -S --noconfirm --needed libfido2 pam-u2f + omarchy-pkg-add libfido2 pam-u2f if ! check_fido2_hardware; then exit 1 fi # Create the pamu2fcfg file - if [ ! -f /etc/fido2/fido2 ]; then + if [[ ! -f /etc/fido2/fido2 ]]; then sudo mkdir -p /etc/fido2 print_success "\nLet's setup your device by confirming on the device now." print_info "Touch your FIDO2 key when it lights up...\n" diff --git a/bin/omarchy-setup-fingerprint b/bin/omarchy-setup-fingerprint index 105234ff..42149651 100755 --- a/bin/omarchy-setup-fingerprint +++ b/bin/omarchy-setup-fingerprint @@ -24,7 +24,7 @@ check_fingerprint_hardware() { devices=$(fprintd-list "$USER" 2>/dev/null) # Exit if no devices found - if [[ -z "$devices" ]]; then + if [[ -z $devices ]]; then print_error "\nNo fingerprint sensor detected." return 1 fi @@ -39,10 +39,10 @@ setup_pam_config() { fi # Configure polkit - if [ -f /etc/pam.d/polkit-1 ] && ! grep -q 'pam_fprintd.so' /etc/pam.d/polkit-1; then + if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_fprintd.so' /etc/pam.d/polkit-1; then print_info "Configuring polkit for fingerprint authentication..." sudo sed -i '1i auth sufficient pam_fprintd.so' /etc/pam.d/polkit-1 - elif [ ! -f /etc/pam.d/polkit-1 ]; then + elif [[ ! -f /etc/pam.d/polkit-1 ]]; then print_info "Creating polkit configuration with fingerprint authentication..." sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF' auth sufficient pam_fprintd.so @@ -58,11 +58,13 @@ EOF add_hyprlock_fingerprint_icon() { print_info "Adding fingerprint icon to hyprlock placeholder text..." sed -i 's/placeholder_text = .*/placeholder_text = Enter Password 󰈷 <\/span>/' ~/.config/hypr/hyprlock.conf + sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = true/' ~/.config/hypr/hyprlock.conf } remove_hyprlock_fingerprint_icon() { print_info "Removing fingerprint icon from hyprlock placeholder text..." sed -i 's/placeholder_text = .*/placeholder_text = Enter Password/' ~/.config/hypr/hyprlock.conf + sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf } remove_pam_config() { @@ -73,13 +75,13 @@ remove_pam_config() { fi # Remove from polkit - if [ -f /etc/pam.d/polkit-1 ] && grep -Fq 'pam_fprintd.so' /etc/pam.d/polkit-1; then + if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_fprintd.so' /etc/pam.d/polkit-1; then print_info "Removing fingerprint authentication from polkit..." sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/polkit-1 fi } -if [[ "--remove" == "$1" ]]; then +if [[ "--remove" == $1 ]]; then print_success "Removing fingerprint scanner from authentication.\n" # Remove PAM configuration @@ -98,7 +100,7 @@ else # Install required packages print_info "Installing required packages..." - sudo pacman -S --noconfirm --needed fprintd usbutils + omarchy-pkg-add fprintd usbutils if ! check_fingerprint_hardware; then exit 1 diff --git a/bin/omarchy-show-done b/bin/omarchy-show-done index de5fe2ab..36f5aec2 100755 --- a/bin/omarchy-show-done +++ b/bin/omarchy-show-done @@ -1,4 +1,7 @@ #!/bin/bash +# Display a "Done!" message with a spinner and wait for user to press any key. +# Used by various install scripts to indicate completion. + echo gum spin --spinner "globe" --title "Done! Press any key to close..." -- bash -c 'read -n 1 -s' diff --git a/bin/omarchy-show-logo b/bin/omarchy-show-logo index fbaf38df..a6137c58 100755 --- a/bin/omarchy-show-logo +++ b/bin/omarchy-show-logo @@ -1,5 +1,8 @@ #!/bin/bash +# Display the Omarchy logo in the terminal using green color. +# Used by various presentation scripts to show branding. + clear echo -e "\033[32m" cat <~/.local/share/omarchy/logo.txt diff --git a/bin/omarchy-state b/bin/omarchy-state index d55943b6..ff5e3e87 100755 --- a/bin/omarchy-state +++ b/bin/omarchy-state @@ -1,17 +1,21 @@ #!/bin/bash +# Manage persistent state files for Omarchy toggles and settings. +# Usage: omarchy-state +# Used to track whether features like suspend, idle lock, etc are enabled or disabled. + STATE_DIR="$HOME/.local/state/omarchy" mkdir -p "$STATE_DIR" COMMAND="$1" STATE_NAME="$2" -if [[ -z "$COMMAND" ]]; then +if [[ -z $COMMAND ]]; then echo "Usage: omarchy-state " exit 1 fi -if [[ -z "$STATE_NAME" ]]; then +if [[ -z $STATE_NAME ]]; then echo "Usage: omarchy-state $COMMAND " exit 1 fi diff --git a/bin/omarchy-swayosd-brightness b/bin/omarchy-swayosd-brightness new file mode 100755 index 00000000..1fb492a1 --- /dev/null +++ b/bin/omarchy-swayosd-brightness @@ -0,0 +1,15 @@ +#!/bin/bash + +# Display brightness level using SwayOSD on the current monitor. +# Usage: omarchy-swayosd-brightness + +percent="$1" + +progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')" +[[ $progress == "0.00" ]] && progress="0.01" + +swayosd-client \ + --monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \ + --custom-icon display-brightness \ + --custom-progress "$progress" \ + --custom-progress-text "${percent}%" diff --git a/bin/omarchy-swayosd-kbd-brightness b/bin/omarchy-swayosd-kbd-brightness new file mode 100755 index 00000000..4c0a30bb --- /dev/null +++ b/bin/omarchy-swayosd-kbd-brightness @@ -0,0 +1,15 @@ +#!/bin/bash + +# Display keyboard brightness level using SwayOSD on the current monitor. +# Usage: omarchy-swayosd-kbd-brightness + +percent="$1" + +progress="$(awk -v p="$percent" 'BEGIN{printf "%.2f", p/100}')" +[[ $progress == "0.00" ]] && progress="0.01" + +swayosd-client \ + --monitor "$(hyprctl monitors -j | jq -r '.[]|select(.focused==true).name')" \ + --custom-icon keyboard-brightness \ + --custom-progress "$progress" \ + --custom-progress-text "${percent}%" diff --git a/bin/omarchy-system-logout b/bin/omarchy-system-logout new file mode 100755 index 00000000..bf70b861 --- /dev/null +++ b/bin/omarchy-system-logout @@ -0,0 +1,11 @@ +#!/bin/bash + +# Logout command that first closes all application windows (thus giving them a chance to save state), +# then stops the session, returning to the SDDM login screen. + +# Schedule the session stop after closing windows (detached from terminal) +nohup bash -c "sleep 2 && uwsm stop" >/dev/null 2>&1 & + +# Now close all windows +omarchy-hyprland-window-close-all +sleep 1 # Allow apps like Chrome to shutdown correctly diff --git a/bin/omarchy-cmd-reboot b/bin/omarchy-system-reboot similarity index 100% rename from bin/omarchy-cmd-reboot rename to bin/omarchy-system-reboot diff --git a/bin/omarchy-cmd-shutdown b/bin/omarchy-system-shutdown similarity index 100% rename from bin/omarchy-cmd-shutdown rename to bin/omarchy-system-shutdown diff --git a/bin/omarchy-theme-bg-next b/bin/omarchy-theme-bg-next index e073db5c..42f15340 100755 --- a/bin/omarchy-theme-bg-next +++ b/bin/omarchy-theme-bg-next @@ -10,13 +10,13 @@ CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background" mapfile -d '' -t BACKGROUNDS < <(find -L "$USER_BACKGROUNDS_PATH" "$THEME_BACKGROUNDS_PATH" -maxdepth 1 -type f -print0 2>/dev/null | sort -z) TOTAL=${#BACKGROUNDS[@]} -if [[ $TOTAL -eq 0 ]]; then +if (( TOTAL == 0 )); then notify-send "No background was found for theme" -t 2000 pkill -x swaybg setsid uwsm-app -- swaybg --color '#000000' >/dev/null 2>&1 & else # Get current background from symlink - if [[ -L "$CURRENT_BACKGROUND_LINK" ]]; then + if [[ -L $CURRENT_BACKGROUND_LINK ]]; then CURRENT_BACKGROUND=$(readlink "$CURRENT_BACKGROUND_LINK") else # Default to first background if no symlink exists @@ -26,14 +26,14 @@ else # Find current background index INDEX=-1 for i in "${!BACKGROUNDS[@]}"; do - if [[ "${BACKGROUNDS[$i]}" == "$CURRENT_BACKGROUND" ]]; then + if [[ ${BACKGROUNDS[$i]} == $CURRENT_BACKGROUND ]]; then INDEX=$i break fi done # Get next background (wrap around) - if [[ $INDEX -eq -1 ]]; then + if (( INDEX == -1 )); then # Use the first background when no match was found NEW_BACKGROUND="${BACKGROUNDS[0]}" else diff --git a/bin/omarchy-theme-bg-set b/bin/omarchy-theme-bg-set new file mode 100755 index 00000000..45992612 --- /dev/null +++ b/bin/omarchy-theme-bg-set @@ -0,0 +1,18 @@ +#!/bin/bash + +# Sets the specified image as the current background + +if [[ -z $1 ]]; then + echo "Usage: omarchy-theme-bg-set " >&2 + exit 1 +fi + +BACKGROUND="$1" +CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background" + +# Create symlink to the new background +ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK" + +# Kill existing swaybg and start new one +pkill -x swaybg +setsid uwsm-app -- swaybg -i "$CURRENT_BACKGROUND_LINK" -m fill >/dev/null 2>&1 & diff --git a/bin/omarchy-theme-install b/bin/omarchy-theme-install index bc9001e7..0c0f0c4e 100755 --- a/bin/omarchy-theme-install +++ b/bin/omarchy-theme-install @@ -3,14 +3,14 @@ # omarchy-theme-install: Install a new theme from a git repo for Omarchy # Usage: omarchy-theme-install -if [ -z "$1" ]; then +if [[ -z $1 ]]; then echo -e "\e[32mSee https://manuals.omamix.org/2/the-omarchy-manual/90/extra-themes\n\e[0m" REPO_URL=$(gum input --placeholder="Git repo URL for theme" --header="") else REPO_URL="$1" fi -if [ -z "$REPO_URL" ]; then +if [[ -z $REPO_URL ]]; then exit 1 fi @@ -19,7 +19,7 @@ THEME_NAME=$(basename "$REPO_URL" .git | sed -E 's/^omarchy-//; s/-theme$//') THEME_PATH="$THEMES_DIR/$THEME_NAME" # Remove existing theme if present -if [ -d "$THEME_PATH" ]; then +if [[ -d $THEME_PATH ]]; then rm -rf "$THEME_PATH" fi diff --git a/bin/omarchy-theme-refresh b/bin/omarchy-theme-refresh new file mode 100755 index 00000000..e967f289 --- /dev/null +++ b/bin/omarchy-theme-refresh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Refresh the current theme from its templates. + +THEME_NAME_PATH="$HOME/.config/omarchy/current/theme.name" + +if [[ -f $THEME_NAME_PATH ]]; then + omarchy-theme-set "$(cat $THEME_NAME_PATH)" +fi diff --git a/bin/omarchy-theme-remove b/bin/omarchy-theme-remove index ee51d809..98a81fa0 100755 --- a/bin/omarchy-theme-remove +++ b/bin/omarchy-theme-remove @@ -3,10 +3,10 @@ # omarchy-theme-remove: Remove a theme from Omarchy by name # Usage: omarchy-theme-remove -if [ -z "$1" ]; then +if [[ -z $1 ]]; then mapfile -t extra_themes < <(find ~/.config/omarchy/themes -mindepth 1 -maxdepth 1 -type d ! -xtype l -printf '%f\n') - if [[ ${#extra_themes[@]} -gt 0 ]]; then + if (( ${#extra_themes[@]} > 0 )); then THEME_NAME=$(printf '%s\n' "${extra_themes[@]}" | sort | gum choose --header="Remove extra theme") else echo "No extra themes installed." @@ -21,12 +21,12 @@ CURRENT_DIR="$HOME/.config/omarchy/current" THEME_PATH="$THEMES_DIR/$THEME_NAME" # Ensure a theme was set -if [ -z "$THEME_NAME" ]; then +if [[ -z $THEME_NAME ]]; then exit 1 fi # Check if theme exists before attempting removal -if [ ! -d "$THEME_PATH" ]; then +if [[ ! -d $THEME_PATH ]]; then echo "Error: Theme '$THEME_NAME' not found." exit 1 fi diff --git a/bin/omarchy-theme-set b/bin/omarchy-theme-set index ba34a501..0c57455b 100755 --- a/bin/omarchy-theme-set +++ b/bin/omarchy-theme-set @@ -12,11 +12,7 @@ OMARCHY_THEMES_PATH="$OMARCHY_PATH/themes" THEME_NAME=$(echo "$1" | sed -E 's/<[^>]+>//g' | tr '[:upper:]' '[:lower:]' | tr ' ' '-') -if [[ -d "$USER_THEMES_PATH/$THEME_NAME" ]]; then - THEME_PATH="$USER_THEMES_PATH/$THEME_NAME" -elif [[ -d "$OMARCHY_THEMES_PATH/$THEME_NAME" ]]; then - THEME_PATH="$OMARCHY_THEMES_PATH/$THEME_NAME" -else +if [[ ! -d $OMARCHY_THEMES_PATH/$THEME_NAME ]] && [[ ! -d $USER_THEMES_PATH/$THEME_NAME ]]; then echo "Theme '$THEME_NAME' does not exist" exit 1 fi @@ -25,8 +21,9 @@ fi rm -rf "$NEXT_THEME_PATH" mkdir -p "$NEXT_THEME_PATH" -# Copy static configs -cp -r "$THEME_PATH/"* "$NEXT_THEME_PATH/" 2>/dev/null +# Copy official theme first, then overlay user customizations on top +cp -r "$OMARCHY_THEMES_PATH/$THEME_NAME/"* "$NEXT_THEME_PATH/" 2>/dev/null +cp -r "$USER_THEMES_PATH/$THEME_NAME/"* "$NEXT_THEME_PATH/" 2>/dev/null # Generate dynamic configs omarchy-theme-set-templates @@ -36,7 +33,7 @@ rm -rf "$CURRENT_THEME_PATH" mv "$NEXT_THEME_PATH" "$CURRENT_THEME_PATH" # Store theme name for reference -echo "$THEME_NAME" > "$HOME/.config/omarchy/current/theme.name" +echo "$THEME_NAME" >"$HOME/.config/omarchy/current/theme.name" # Change background with theme omarchy-theme-bg-next @@ -57,6 +54,7 @@ omarchy-theme-set-gnome omarchy-theme-set-browser omarchy-theme-set-vscode omarchy-theme-set-obsidian +omarchy-theme-set-keyboard # Call hook on theme set omarchy-hook theme-set "$THEME_NAME" diff --git a/bin/omarchy-theme-set-browser b/bin/omarchy-theme-set-browser index 9594de18..0ff87091 100755 --- a/bin/omarchy-theme-set-browser +++ b/bin/omarchy-theme-set-browser @@ -2,7 +2,7 @@ CHROMIUM_THEME=~/.config/omarchy/current/theme/chromium.theme -if omarchy-cmd-present chromium || omarchy-cmd-present helium-browser || omarchy-cmd-present brave; then +if omarchy-cmd-present chromium || omarchy-cmd-present brave; then if [[ -f $CHROMIUM_THEME ]]; then THEME_RGB_COLOR=$(<$CHROMIUM_THEME) THEME_HEX_COLOR=$(printf '#%02x%02x%02x' ${THEME_RGB_COLOR//,/ }) diff --git a/bin/omarchy-theme-set-keyboard b/bin/omarchy-theme-set-keyboard new file mode 100755 index 00000000..6c237a8e --- /dev/null +++ b/bin/omarchy-theme-set-keyboard @@ -0,0 +1,4 @@ +#!/bin/bash + +omarchy-theme-set-keyboard-asus-rog +omarchy-theme-set-keyboard-f16 diff --git a/bin/omarchy-theme-set-keyboard-asus-rog b/bin/omarchy-theme-set-keyboard-asus-rog new file mode 100755 index 00000000..e0078ee4 --- /dev/null +++ b/bin/omarchy-theme-set-keyboard-asus-rog @@ -0,0 +1,7 @@ +#!/bin/bash + +ASUSCTL_THEME=~/.config/omarchy/current/theme/keyboard.rgb + +if omarchy-cmd-present asusctl; then + asusctl aura effect static -c $(sed 's/^#//' $ASUSCTL_THEME) +fi diff --git a/bin/omarchy-theme-set-keyboard-f16 b/bin/omarchy-theme-set-keyboard-f16 new file mode 100755 index 00000000..1a30991e --- /dev/null +++ b/bin/omarchy-theme-set-keyboard-f16 @@ -0,0 +1,22 @@ +#!/bin/bash + +FRAMEWORK16_THEME=~/.config/omarchy/current/theme/keyboard.rgb + +if omarchy-cmd-present qmk_hid && [[ -f $FRAMEWORK16_THEME ]]; then + hex=$(cat "$FRAMEWORK16_THEME") + hex="${hex#\#}" + + # Convert hex to QMK HSV (0-255 scale) using Python's colorsys + read -r h s <<< $(python3 -c " +import colorsys +r, g, b = int('$hex'[:2],16)/255, int('$hex'[2:4],16)/255, int('$hex'[4:6],16)/255 +h, s, v = colorsys.rgb_to_hsv(r, g, b) +print(int(h * 255), int(s * 255)) +") + + qmk_hid via --rgb-effect 1 2>/dev/null + qmk_hid via --rgb-hue "$h" 2>/dev/null + qmk_hid via --rgb-saturation "$s" 2>/dev/null + qmk_hid via --rgb-brightness 100 2>/dev/null + qmk_hid via --save 2>/dev/null +fi diff --git a/bin/omarchy-theme-set-obsidian b/bin/omarchy-theme-set-obsidian index f86cea1d..420bd8c3 100755 --- a/bin/omarchy-theme-set-obsidian +++ b/bin/omarchy-theme-set-obsidian @@ -4,15 +4,15 @@ CURRENT_THEME_DIR="$HOME/.config/omarchy/current/theme" -[ -f "$CURRENT_THEME_DIR/obsidian.css" ] || exit 0 +[[ -f $CURRENT_THEME_DIR/obsidian.css ]] || exit 0 jq -r '.vaults | values[].path' ~/.config/obsidian/obsidian.json 2>/dev/null | while read -r vault_path; do - [ -d "$vault_path/.obsidian" ] || continue + [[ -d $vault_path/.obsidian ]] || continue theme_dir="$vault_path/.obsidian/themes/Omarchy" mkdir -p "$theme_dir" - [ -f "$theme_dir/manifest.json" ] || cat >"$theme_dir/manifest.json" <<'EOF' + [[ -f $theme_dir/manifest.json ]] || cat >"$theme_dir/manifest.json" <<'EOF' { "name": "Omarchy", "version": "1.0.0", diff --git a/bin/omarchy-theme-set-vscode b/bin/omarchy-theme-set-vscode index bf53013b..3980f68d 100755 --- a/bin/omarchy-theme-set-vscode +++ b/bin/omarchy-theme-set-vscode @@ -9,18 +9,18 @@ set_theme() { local settings_path="$2" local skip_flag="$3" - omarchy-cmd-present "$editor_cmd" && [[ ! -f "$skip_flag" ]] || return 0 + omarchy-cmd-present "$editor_cmd" && [[ ! -f $skip_flag ]] || return 0 - if [[ -f "$VS_CODE_THEME" ]]; then + if [[ -f $VS_CODE_THEME ]]; then theme_name=$(jq -r '.name' "$VS_CODE_THEME") extension=$(jq -r '.extension' "$VS_CODE_THEME") - if [[ -n "$extension" ]] && ! "$editor_cmd" --list-extensions | grep -Fxq "$extension"; then + if [[ -n $extension ]] && ! "$editor_cmd" --list-extensions | grep -Fxq "$extension"; then "$editor_cmd" --install-extension "$extension" >/dev/null fi mkdir -p "$(dirname "$settings_path")" - [[ -f "$settings_path" ]] || printf '{\n}\n' >"$settings_path" + [[ -f $settings_path ]] || printf '{\n}\n' >"$settings_path" if ! grep -q '"workbench.colorTheme"' "$settings_path"; then sed -i --follow-symlinks -E '0,/\{/{s/\{/{\ "workbench.colorTheme": "",/}' "$settings_path" @@ -29,7 +29,7 @@ set_theme() { sed -i --follow-symlinks -E \ "s/(\"workbench.colorTheme\"[[:space:]]*:[[:space:]]*\")[^\"]*(\")/\1$theme_name\2/" \ "$settings_path" - elif [[ -f "$settings_path" ]]; then + elif [[ -f $settings_path ]]; then sed -i --follow-symlinks -E 's/\"workbench\.colorTheme\"[[:space:]]*:[^,}]*,?//' "$settings_path" fi } diff --git a/bin/omarchy-theme-update b/bin/omarchy-theme-update index aa68f095..cfb823f4 100755 --- a/bin/omarchy-theme-update +++ b/bin/omarchy-theme-update @@ -1,7 +1,7 @@ #!/bin/bash for dir in ~/.config/omarchy/themes/*/; do - if [[ -d $dir ]] && [[ ! -L "${dir%/}" ]] && [[ -d "$dir/.git" ]]; then + if [[ -d $dir ]] && [[ ! -L ${dir%/} ]] && [[ -d $dir/.git ]]; then echo "Updating: $(basename "$dir")" git -C "$dir" pull fi diff --git a/bin/omarchy-toggle-hybrid-gpu b/bin/omarchy-toggle-hybrid-gpu new file mode 100755 index 00000000..4c573243 --- /dev/null +++ b/bin/omarchy-toggle-hybrid-gpu @@ -0,0 +1,65 @@ +#!/bin/bash + +# Toggle dedicated vs integrated GPU mode via supergfxd (for hybrid gpu laptops, like Asus G14). +# Requires reboot to take effect. + +# Ensure supergfxctl has been installed +if omarchy-cmd-missing supergfxctl; then + omarchy-pkg-add supergfxctl + + # Create config before starting service to prevent hang on first boot + sudo tee /etc/supergfxd.conf >/dev/null <<'CONF' +{ + "mode": "Hybrid", + "vfio_enable": true, + "vfio_save": false, + "always_reboot": false, + "no_logind": false, + "logout_timeout_s": 180, + "hotplug_type": "None" +} +CONF + + sudo systemctl enable --now supergfxd +fi + +gpu_mode=$(supergfxctl -g) + +case "$gpu_mode" in +"Integrated") + if gum confirm "Enable dedicated GPU and reboot?"; then + # Switch to hybrid mode + sudo sed -i "s/\"mode\": \".*\"/\"mode\": \"Hybrid\"/" /etc/supergfxd.conf + + # Let hybrid mode be the default after system sleep + sudo rm -rf /usr/lib/systemd/system-sleep/force-igpu + + # Remove the startup delay override (not needed for Hybrid mode) + sudo rm -rf /etc/systemd/system/supergfxd.service.d/delay-start.conf + + omarchy-system-reboot + fi + ;; +"Hybrid") + if gum confirm "Use only integrated GPU and reboot?"; then + # Switch to integrated mode and ensure vfio is enabled (needed for sleep/wake trick) + sudo sed -i "s/\"mode\": \".*\"/\"mode\": \"Integrated\"/" /etc/supergfxd.conf + sudo sed -i 's/"vfio_enable": false/"vfio_enable": true/' /etc/supergfxd.conf + + # Force igpu mode after system sleep (or dgpu could get activated) + sudo mkdir -p /usr/lib/systemd/system-sleep + sudo cp -p $OMARCHY_PATH/default/systemd/system-sleep/force-igpu /usr/lib/systemd/system-sleep/ + + # Delay supergfxd startup to avoid race condition with display manager + # that can cause system freeze when booting in Integrated mode + sudo mkdir -p /etc/systemd/system/supergfxd.service.d + sudo cp -p $OMARCHY_PATH/default/systemd/system/supergfxd.service.d/delay-start.conf /etc/systemd/system/supergfxd.service.d/ + + omarchy-system-reboot + fi + ;; +*) + echo "Hybrid GPU not found or in unknown mode." + exit 1 + ;; +esac diff --git a/bin/omarchy-toggle-idle b/bin/omarchy-toggle-idle index aa69cf50..58f0a85d 100755 --- a/bin/omarchy-toggle-idle +++ b/bin/omarchy-toggle-idle @@ -2,8 +2,10 @@ if pgrep -x hypridle >/dev/null; then pkill -x hypridle - notify-send "Stop locking computer when idle" + notify-send "󱫖 Stop locking computer when idle" else uwsm-app -- hypridle >/dev/null 2>&1 & - notify-send "Now locking computer when idle" + notify-send "󱫖 Now locking computer when idle" fi + +pkill -RTMIN+9 waybar diff --git a/bin/omarchy-toggle-nightlight b/bin/omarchy-toggle-nightlight index 99b0286b..cb0836ee 100755 --- a/bin/omarchy-toggle-nightlight +++ b/bin/omarchy-toggle-nightlight @@ -19,7 +19,7 @@ restart_nightlighted_waybar() { fi } -if [[ "$CURRENT_TEMP" == "$OFF_TEMP" ]]; then +if [[ $CURRENT_TEMP == $OFF_TEMP ]]; then hyprctl hyprsunset temperature $ON_TEMP notify-send " Nightlight screen temperature" restart_nightlighted_waybar diff --git a/bin/omarchy-toggle-notification-silencing b/bin/omarchy-toggle-notification-silencing new file mode 100755 index 00000000..c8117059 --- /dev/null +++ b/bin/omarchy-toggle-notification-silencing @@ -0,0 +1,11 @@ +#!/bin/bash + +makoctl mode -t do-not-disturb + +if makoctl mode | grep -q 'do-not-disturb'; then + notify-send "󰂛 Silenced notifications" +else + notify-send "󰂚 Enabled notifications" +fi + +pkill -RTMIN+10 waybar diff --git a/bin/omarchy-toggle-suspend b/bin/omarchy-toggle-suspend index a2464528..3c5b0491 100755 --- a/bin/omarchy-toggle-suspend +++ b/bin/omarchy-toggle-suspend @@ -1,13 +1,12 @@ #!/bin/bash -STATE_FILE=~/.local/state/omarchy/toggles/suspend-on +STATE_FILE=~/.local/state/omarchy/toggles/suspend-off -if [[ ! -f $STATE_FILE ]]; then - mkdir -p "$(dirname $STATE_FILE)" - touch $STATE_FILE +if [[ -f $STATE_FILE ]]; then + rm -f $STATE_FILE notify-send "󰒲 Suspend now available in system menu" else mkdir -p "$(dirname $STATE_FILE)" - rm -f $STATE_FILE + touch $STATE_FILE notify-send "󰒲 Suspend removed from system menu" fi diff --git a/bin/omarchy-tui-install b/bin/omarchy-tui-install index ebd3dfa1..2d6397a2 100755 --- a/bin/omarchy-tui-install +++ b/bin/omarchy-tui-install @@ -2,7 +2,7 @@ set -e -if [ "$#" -ne 4 ]; then +if (( $# != 4 )); 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'") @@ -15,7 +15,7 @@ else ICON_URL="$4" fi -if [[ -z "$APP_NAME" || -z "$APP_EXEC" || -z "$ICON_URL" ]]; then +if [[ -z $APP_NAME || -z $APP_EXEC || -z $ICON_URL ]]; then echo "You must set app name, app command, and icon URL!" exit 1 fi @@ -23,7 +23,7 @@ fi ICON_DIR="$HOME/.local/share/applications/icons" DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop" -if [[ ! "$ICON_URL" =~ ^https?:// ]] && [ -f "$ICON_URL" ]; then +if [[ ! $ICON_URL =~ ^https?:// ]] && [[ -f $ICON_URL ]]; then ICON_PATH="$ICON_URL" else ICON_PATH="$ICON_DIR/$APP_NAME.png" @@ -54,6 +54,6 @@ EOF chmod +x "$DESKTOP_FILE" -if [ "$#" -ne 4 ]; then +if (( $# != 4 )); then echo -e "You can now find $APP_NAME using the app launcher (SUPER + SPACE)\n" fi diff --git a/bin/omarchy-tui-remove b/bin/omarchy-tui-remove index e436776b..3b97df8c 100755 --- a/bin/omarchy-tui-remove +++ b/bin/omarchy-tui-remove @@ -5,7 +5,7 @@ set -e ICON_DIR="$HOME/.local/share/applications/icons" DESKTOP_DIR="$HOME/.local/share/applications/" -if [ "$#" -eq 0 ]; then +if (( $# == 0 )); then # Find all TUIs while IFS= read -r -d '' file; do if grep -qE '^Exec=.*(\$TERMINAL|xdg-terminal-exec).*-e' "$file"; then @@ -20,7 +20,7 @@ if [ "$#" -eq 0 ]; then # Convert newline-separated string to array APP_NAMES=() while IFS= read -r line; do - [[ -n "$line" ]] && APP_NAMES+=("$line") + [[ -n $line ]] && APP_NAMES+=("$line") done <<< "$APP_NAMES_STRING" else echo "No TUIs to remove." @@ -31,7 +31,7 @@ else APP_NAMES=("$@") fi -if [[ ${#APP_NAMES[@]} -eq 0 ]]; then +if (( ${#APP_NAMES[@]} == 0 )); then echo "You must provide TUI names." exit 1 fi diff --git a/bin/omarchy-tui-remove-all b/bin/omarchy-tui-remove-all new file mode 100755 index 00000000..8efe4d80 --- /dev/null +++ b/bin/omarchy-tui-remove-all @@ -0,0 +1,36 @@ +#!/bin/bash + +# Remove all TUIs installed via omarchy-tui-install. +# Identifies TUIs by their Exec pattern (xdg-terminal-exec --app-id=TUI.). + +set -e + +APP_DIR="${1:-$HOME/.local/share/applications}" +ICON_DIR="$HOME/.local/share/applications/icons" + +echo "Scanning for TUIs in $APP_DIR..." + +tui_desktop_files=() +while IFS= read -r -d '' file; do + if grep -q "Exec=xdg-terminal-exec --app-id=TUI\." "$file" 2>/dev/null; then + tui_desktop_files+=("$file") + fi +done < <(find "$APP_DIR" -maxdepth 1 -name "*.desktop" -print0 2>/dev/null) + +if (( ${#tui_desktop_files[@]} == 0 )); then + echo "No TUIs found." + exit 0 +fi + +for file in "${tui_desktop_files[@]}"; do + app_name=$(basename "$file" .desktop) + echo "Removing TUI: $app_name" + rm -f "$file" + rm -f "$ICON_DIR/$app_name.png" +done + +if command -v update-desktop-database &>/dev/null; then + update-desktop-database "$APP_DIR" &>/dev/null || true +fi + +echo "TUIs removed successfully." diff --git a/bin/omarchy-update b/bin/omarchy-update index 7b800005..086e78c9 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -5,7 +5,7 @@ set -e trap 'echo ""; echo -e "\033[0;31mSomething went wrong during the update!\n\nPlease review the output above carefully, correct the error, and retry the update.\n\nIf you need assistance, get help from the community at https://omarchy.org/discord\033[0m"' ERR if [[ $1 == "-y" ]] || omarchy-update-confirm; then - omarchy-snapshot create || [ $? -eq 127 ] + omarchy-snapshot create || (( $? == 127 )) omarchy-update-git omarchy-update-perform fi diff --git a/bin/omarchy-update-analyze-logs b/bin/omarchy-update-analyze-logs index 349506c5..fb42e82e 100755 --- a/bin/omarchy-update-analyze-logs +++ b/bin/omarchy-update-analyze-logs @@ -2,13 +2,6 @@ update_log="/tmp/omarchy-update.log" -# Check for errors -if grep -qi "error" "$update_log"; then - echo -e "\e[31mNon-stopping errors detected during update:\e[0m" - grep -i "error" "$update_log" - echo -fi - # Check for initramfs generation failure if grep -q "Updating linux initcpios" "$update_log"; then if ! grep -q "Initcpio image generation successful" "$update_log"; then diff --git a/bin/omarchy-update-aur-pkgs b/bin/omarchy-update-aur-pkgs new file mode 100755 index 00000000..0dee5edf --- /dev/null +++ b/bin/omarchy-update-aur-pkgs @@ -0,0 +1,13 @@ +#!/bin/bash + +# Update AUR packages if any are installed +if pacman -Qem >/dev/null; then + if omarchy-pkg-aur-accessible; then + echo -e "\e[32m\nUpdate AUR packages\e[0m" + yay -Sua --noconfirm --cleanafter --ignore gcc14,gcc14-libs + echo + else + echo -e "\e[31m\nAUR is unavailable (so skipping updates)\e[0m" + echo + fi +fi diff --git a/bin/omarchy-update-available b/bin/omarchy-update-available index 25558215..e5d19cf7 100755 --- a/bin/omarchy-update-available +++ b/bin/omarchy-update-available @@ -2,19 +2,19 @@ # Get remote tag latest_tag=$(git -C "$OMARCHY_PATH" ls-remote --tags origin | grep -v "{}" | awk '{print $2}' | sed 's#refs/tags/##' | sort -V | tail -n 1) -if [[ -z "$latest_tag" ]]; then +if [[ -z $latest_tag ]]; then echo "Error: Could not retrieve latest tag." exit 1 fi # Get local tag current_tag=$(git -C "$OMARCHY_PATH" describe --tags $(git -C "$OMARCHY_PATH" rev-list --tags --max-count=1)) -if [[ -z "$current_tag" ]]; then +if [[ -z $current_tag ]]; then echo "Error: Could not retrieve current tag." exit 1 fi -if [[ "$current_tag" != "$latest_tag" ]]; then +if [[ $current_tag != $latest_tag ]]; then echo "Omarchy update available ($latest_tag)" exit 0 else diff --git a/bin/omarchy-update-branch b/bin/omarchy-update-branch index 91bd797e..b10822cd 100755 --- a/bin/omarchy-update-branch +++ b/bin/omarchy-update-branch @@ -10,7 +10,7 @@ fi branch="$1" # Snapshot before switching branch -omarchy-snapshot create || [ $? -eq 127 ] +omarchy-snapshot create || (( $? == 127 )) if ! git -C "$OMARCHY_PATH" diff --quiet || ! git -C "$OMARCHY_PATH" diff --cached --quiet; then stashed=true @@ -23,7 +23,7 @@ fi git -C "$OMARCHY_PATH" switch "$branch" # Reapply stash if we made one -if [[ $stashed == true ]]; then +if [[ $stashed == "true" ]]; then if ! git -C "$OMARCHY_PATH" stash pop; then echo "⚠️ Conflicts when applying stash — stash kept" fi diff --git a/bin/omarchy-update-firmware b/bin/omarchy-update-firmware index 10e490f4..6eb1a088 100755 --- a/bin/omarchy-update-firmware +++ b/bin/omarchy-update-firmware @@ -7,5 +7,5 @@ if omarchy-cmd-missing fwupdmgr; then omarchy-pkg-add fwupd fi -fwupdmgr refresh +fwupdmgr refresh --force sudo fwupdmgr update diff --git a/bin/omarchy-update-keyring b/bin/omarchy-update-keyring index f54cfb82..32bd3f22 100755 --- a/bin/omarchy-update-keyring +++ b/bin/omarchy-update-keyring @@ -12,3 +12,7 @@ if omarchy-pkg-missing omarchy-keyring || ! sudo pacman-key --list-keys 40DFB630 sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 fi + +# Ensure we have the latest archlinux-keyring, maintainer keys might have changed +echo -e "\e[32m\nUpdate Arch signing keys\e[0m" +sudo pacman -Sy --noconfirm archlinux-keyring >/dev/null diff --git a/bin/omarchy-update-orphan-pkgs b/bin/omarchy-update-orphan-pkgs new file mode 100755 index 00000000..3d7a3511 --- /dev/null +++ b/bin/omarchy-update-orphan-pkgs @@ -0,0 +1,10 @@ +#!/bin/bash + +orphans=$(pacman -Qtdq || true) +if [[ -n $orphans ]]; then + echo -e "\e[32m\nRemove orphan system packages\e[0m" + for pkg in $orphans; do + sudo pacman -Rs --noconfirm "$pkg" || true + done + echo +fi diff --git a/bin/omarchy-update-perform b/bin/omarchy-update-perform index c4fcc2cb..c2101c15 100755 --- a/bin/omarchy-update-perform +++ b/bin/omarchy-update-perform @@ -14,6 +14,8 @@ omarchy-update-keyring omarchy-update-available-reset omarchy-update-system-pkgs omarchy-migrate +omarchy-update-aur-pkgs +omarchy-update-orphan-pkgs omarchy-hook post-update omarchy-update-analyze-logs diff --git a/bin/omarchy-update-restart b/bin/omarchy-update-restart index b6b73afe..2e62716b 100755 --- a/bin/omarchy-update-restart +++ b/bin/omarchy-update-restart @@ -1,14 +1,13 @@ #!/bin/bash -if [ "$(uname -r | sed 's/-arch/\.arch/')" != "$(pacman -Q linux | awk '{print $2}')" ]; then - gum confirm "Linux kernel has been updated. Reboot?" && omarchy-cmd-reboot - -elif [ -f "$HOME/.local/state/omarchy/reboot-required" ]; then - gum confirm "Updates require reboot. Ready?" && omarchy-cmd-reboot +if [[ ! -d /usr/lib/modules/$(uname -r) ]]; then + gum confirm "Linux kernel has been updated. Reboot?" && omarchy-system-reboot +elif [[ -f $HOME/.local/state/omarchy/reboot-required ]]; then + gum confirm "Updates require reboot. Ready?" && omarchy-system-reboot fi for file in "$HOME"/.local/state/omarchy/restart-*-required; do - if [ -f "$file" ]; then + if [[ -f $file ]]; then filename=$(basename "$file") service=$(echo "$filename" | sed 's/restart-\(.*\)-required/\1/') echo "Restarting $service" diff --git a/bin/omarchy-update-system-pkgs b/bin/omarchy-update-system-pkgs index 814fb491..36a78418 100755 --- a/bin/omarchy-update-system-pkgs +++ b/bin/omarchy-update-system-pkgs @@ -4,24 +4,3 @@ set -e echo -e "\e[32m\nUpdate system packages\e[0m" sudo pacman -Syyu --noconfirm - -# Update AUR packages if any are installed -if pacman -Qem >/dev/null; then - if omarchy-pkg-aur-accessible; then - echo -e "\e[32m\nUpdate AUR packages\e[0m" - yay -Sua --noconfirm --ignore gcc14,gcc14-libs - echo - else - echo -e "\e[31m\nAUR is unavailable (so skipping updates)\e[0m" - echo - fi -fi - -orphans=$(pacman -Qtdq || true) -if [[ -n $orphans ]]; then - echo -e "\e[32m\nRemove orphan system packages\e[0m" - for pkg in $orphans; do - sudo pacman -Rs --noconfirm "$pkg" || true - done - echo -fi diff --git a/bin/omarchy-upload-log b/bin/omarchy-upload-log index bd98da86..c084f518 100755 --- a/bin/omarchy-upload-log +++ b/bin/omarchy-upload-log @@ -46,7 +46,7 @@ install) cat "$SYSTEM_INFO" >"$TEMP_LOG" cat $ARCHINSTALL_LOG $OMARCHY_LOG >>"$TEMP_LOG" 2>/dev/null - if [ ! -s "$TEMP_LOG" ]; then + if [[ ! -s $TEMP_LOG ]]; then echo "Error: No install logs found" exit 1 fi @@ -59,7 +59,7 @@ this-boot) cat "$SYSTEM_INFO" >"$TEMP_LOG" journalctl -b 0 >>"$TEMP_LOG" 2>/dev/null - if [ ! -s "$TEMP_LOG" ]; then + if [[ ! -s $TEMP_LOG ]]; then echo "Error: No logs found for current boot" exit 1 fi @@ -72,7 +72,7 @@ last-boot) cat "$SYSTEM_INFO" >"$TEMP_LOG" journalctl -b -1 >>"$TEMP_LOG" 2>/dev/null - if [ ! -s "$TEMP_LOG" ]; then + if [[ ! -s $TEMP_LOG ]]; then echo "Error: No logs found for previous boot" exit 1 fi @@ -80,7 +80,7 @@ last-boot) echo "Uploading previous boot logs to 0x0.st..." ;; -installed) +installed|system-info) # System info plus all installed packages cat "$SYSTEM_INFO" >"$TEMP_LOG" { @@ -91,7 +91,7 @@ installed) pacman -Q 2>/dev/null || echo "Failed to get package list" } >>"$TEMP_LOG" - if [ ! -s "$TEMP_LOG" ]; then + if [[ ! -s $TEMP_LOG ]]; then echo "Error: Failed to gather system information" exit 1 fi @@ -100,7 +100,7 @@ installed) ;; *) - echo "Usage: $0 [install|this-boot|last-boot|system-info]" + echo "Usage: $0 [install|this-boot|last-boot|installed|system-info]" echo " install - Upload installation logs (default)" echo " this-boot - Upload logs from current boot" echo " last-boot - Upload logs from previous boot" @@ -113,7 +113,7 @@ echo "" URL=$(curl -sF "file=@$TEMP_LOG" -Fexpires=24 https://0x0.st) -if [ $? -eq 0 ] && [ -n "$URL" ]; then +if (( $? == 0 )) && [[ -n $URL ]]; then echo "✓ Log uploaded successfully!" echo "Share this URL:" echo "" diff --git a/bin/omarchy-version-channel b/bin/omarchy-version-channel index 8affb87e..76233513 100755 --- a/bin/omarchy-version-channel +++ b/bin/omarchy-version-channel @@ -2,6 +2,8 @@ if grep -q "https://stable-mirror.omarchy.org/" /etc/pacman.d/mirrorlist; then mirror="stable" +elif grep -q "https://rc-mirror.omarchy.org/" /etc/pacman.d/mirrorlist; then + mirror="rc" elif grep -q "https://mirror.omarchy.org/" /etc/pacman.d/mirrorlist; then mirror="edge" else @@ -12,6 +14,8 @@ if grep -q "https://pkgs.omarchy.org/stable/" /etc/pacman.conf; then pkgs="stable" elif grep -q "https://pkgs.omarchy.org/edge/" /etc/pacman.conf; then pkgs="edge" +elif grep -q "https://pkgs.omarchy.org/rc/" /etc/pacman.conf; then + pkgs="rc" else pkgs="unknown" fi diff --git a/bin/omarchy-voxtype-install b/bin/omarchy-voxtype-install index 6522cde5..524ff4c6 100755 --- a/bin/omarchy-voxtype-install +++ b/bin/omarchy-voxtype-install @@ -14,5 +14,5 @@ if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then voxtype setup systemd omarchy-restart-waybar - notify-send " Voxtype Dictation Ready" "Hold Super + Ctrl + X to dictate.\nEdit ~/.config/voxtype/config.toml for options." -t 10000 + notify-send " Voxtype Dictation Ready" "Press Super + Ctrl + X to toggle dictation.\nEdit ~/.config/voxtype/config.toml for options." -t 10000 fi diff --git a/bin/omarchy-webapp-install b/bin/omarchy-webapp-install index a66dcabd..264c7ea9 100755 --- a/bin/omarchy-webapp-install +++ b/bin/omarchy-webapp-install @@ -2,17 +2,34 @@ set -e -if [ "$#" -lt 3 ]; then +ICON_DIR="$HOME/.local/share/applications/icons" + +if (( $# < 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_REF=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG!)") + if [[ ! $APP_URL =~ ^[a-zA-Z][a-zA-Z0-9+.-]*: ]]; then + APP_URL="https://$APP_URL" + fi + + # Try to fetch favicon automatically first. + FAVICON_URL="https://www.google.com/s2/favicons?domain=${APP_URL}&sz=128" + mkdir -p "$ICON_DIR" + if curl -fsSL -o "$ICON_DIR/$APP_NAME.png" "$FAVICON_URL" && [[ -s $ICON_DIR/$APP_NAME.png ]]; then + ICON_REF="$APP_NAME.png" + else + ICON_REF=$(gum input --prompt "Icon URL> " --placeholder "Could not fetch favicon automatically. Enter PNG icon URL (see https://dashboardicons.com)") + fi + CUSTOM_EXEC="" MIME_TYPES="" INTERACTIVE_MODE=true else APP_NAME="$1" APP_URL="$2" + if [[ ! $APP_URL =~ ^[a-zA-Z][a-zA-Z0-9+.-]*: ]]; then + APP_URL="https://$APP_URL" + fi ICON_REF="$3" CUSTOM_EXEC="$4" # Optional custom exec command MIME_TYPES="$5" # Optional mime types @@ -20,18 +37,21 @@ else fi # 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!" +if [[ -z $APP_NAME || -z $APP_URL ]]; then + echo "You must set app name and app URL!" exit 1 fi -# Refer to local icon or fetch remotely from URL -ICON_DIR="$HOME/.local/share/applications/icons" +# Resolve icon from URL or from a local icon name. +mkdir -p "$ICON_DIR" + +if [[ -z $ICON_REF ]]; then + ICON_REF="https://www.google.com/s2/favicons?domain=${APP_URL}&sz=128" +fi + if [[ $ICON_REF =~ ^https?:// ]]; then ICON_PATH="$ICON_DIR/$APP_NAME.png" - if curl -sL -o "$ICON_PATH" "$ICON_REF"; then - ICON_PATH="$ICON_DIR/$APP_NAME.png" - else + if ! curl -fsSL -o "$ICON_PATH" "$ICON_REF" || [[ ! -s $ICON_PATH ]]; then echo "Error: Failed to download icon." exit 1 fi @@ -40,11 +60,7 @@ else fi # Use custom exec if provided, otherwise default behavior -if [[ -n $CUSTOM_EXEC ]]; then - EXEC_COMMAND="$CUSTOM_EXEC" -else - EXEC_COMMAND="omarchy-launch-webapp $APP_URL" -fi +EXEC_COMMAND="${CUSTOM_EXEC:-omarchy-launch-webapp $APP_URL}" # Create application .desktop file DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop" @@ -68,6 +84,6 @@ fi chmod +x "$DESKTOP_FILE" -if [[ $INTERACTIVE_MODE == true ]]; then +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/omarchy-webapp-remove b/bin/omarchy-webapp-remove index 2da36b54..a54aba5c 100755 --- a/bin/omarchy-webapp-remove +++ b/bin/omarchy-webapp-remove @@ -5,7 +5,7 @@ set -e ICON_DIR="$HOME/.local/share/applications/icons" DESKTOP_DIR="$HOME/.local/share/applications/" -if [ "$#" -eq 0 ]; then +if (( $# == 0 )); then # Find all web apps while IFS= read -r -d '' file; do if grep -q '^Exec=.*\(omarchy-launch-webapp\|omarchy-webapp-handler\).*' "$file"; then @@ -20,7 +20,7 @@ if [ "$#" -eq 0 ]; then # Convert newline-separated string to array APP_NAMES=() while IFS= read -r line; do - [[ -n "$line" ]] && APP_NAMES+=("$line") + [[ -n $line ]] && APP_NAMES+=("$line") done <<< "$APP_NAMES_STRING" else echo "No web apps to remove." @@ -31,7 +31,7 @@ else APP_NAMES=("$@") fi -if [[ ${#APP_NAMES[@]} -eq 0 ]]; then +if (( ${#APP_NAMES[@]} == 0 )); then echo "You must select at least one web app to remove." exit 1 fi diff --git a/bin/omarchy-webapp-remove-all b/bin/omarchy-webapp-remove-all new file mode 100755 index 00000000..d2006abc --- /dev/null +++ b/bin/omarchy-webapp-remove-all @@ -0,0 +1,36 @@ +#!/bin/bash + +# Remove all web apps installed via omarchy-webapp-install. +# Identifies web apps by their Exec pattern (omarchy-launch-webapp or omarchy-webapp-handler). + +set -e + +APP_DIR="${1:-$HOME/.local/share/applications}" +ICON_DIR="$HOME/.local/share/applications/icons" + +echo "Scanning for web apps in $APP_DIR..." + +webapp_desktop_files=() +while IFS= read -r -d '' file; do + if grep -q "Exec=omarchy-launch-webapp\|Exec=omarchy-webapp-handler" "$file" 2>/dev/null; then + webapp_desktop_files+=("$file") + fi +done < <(find "$APP_DIR" -maxdepth 1 -name "*.desktop" -print0 2>/dev/null) + +if (( ${#webapp_desktop_files[@]} == 0 )); then + echo "No web apps found." + exit 0 +fi + +for file in "${webapp_desktop_files[@]}"; do + app_name=$(basename "$file" .desktop) + echo "Removing web app: $app_name" + rm -f "$file" + rm -f "$ICON_DIR/$app_name.png" +done + +if command -v update-desktop-database &>/dev/null; then + update-desktop-database "$APP_DIR" &>/dev/null || true +fi + +echo "Web apps removed successfully." diff --git a/bin/omarchy-wifi-powersave b/bin/omarchy-wifi-powersave new file mode 100755 index 00000000..9e1c5bbe --- /dev/null +++ b/bin/omarchy-wifi-powersave @@ -0,0 +1,5 @@ +#!/bin/bash +for iface in /sys/class/net/*/wireless; do + iface="$(basename "$(dirname "$iface")")" + iw dev "$iface" set power_save "$1" 2>/dev/null +done diff --git a/bin/omarchy-windows-vm b/bin/omarchy-windows-vm index f9034d48..70386213 100755 --- a/bin/omarchy-windows-vm +++ b/bin/omarchy-windows-vm @@ -6,7 +6,7 @@ check_prerequisites() { local REQUIRED_SPACE=$((DISK_SIZE_GB + 10)) # Add 10GB for Windows ISO and overhead # Check for KVM support - if [ ! -e /dev/kvm ]; then + if [[ ! -e /dev/kvm ]]; then gum style \ --border normal \ --padding "1 2" \ @@ -21,7 +21,7 @@ check_prerequisites() { # Check disk space AVAILABLE_SPACE=$(df "$HOME" | awk 'NR==2 {print int($4/1024/1024)}') - if [ "$AVAILABLE_SPACE" -lt "$REQUIRED_SPACE" ]; then + if (( AVAILABLE_SPACE < REQUIRED_SPACE )); then echo "❌ Insufficient disk space!" echo " Available: ${AVAILABLE_SPACE}GB" echo " Required: ${REQUIRED_SPACE}GB (${DISK_SIZE_GB}GB disk + 10GB for Windows image)" @@ -42,7 +42,7 @@ install_windows() { mkdir -p "$HOME/.local/share/applications/icons" # Install Windows VM icon and desktop file - if [ -f "$OMARCHY_PATH/applications/icons/windows.png" ]; then + if [[ -f $OMARCHY_PATH/applications/icons/windows.png ]]; then cp "$OMARCHY_PATH/applications/icons/windows.png" "$HOME/.local/share/applications/icons/windows.png" fi @@ -70,7 +70,7 @@ EOF RAM_OPTIONS="" for size in 2 4 8 16 32 64; do - if [ $size -le $TOTAL_RAM_GB ]; then + if (( size <= TOTAL_RAM_GB )); then RAM_OPTIONS="$RAM_OPTIONS ${size}G" fi done @@ -78,7 +78,7 @@ EOF SELECTED_RAM=$(echo $RAM_OPTIONS | tr ' ' '\n' | gum choose --selected="4G" --header="How much RAM would you like to allocate to Windows VM?") # Check if user cancelled - if [ -z "$SELECTED_RAM" ]; then + if [[ -z $SELECTED_RAM ]]; then echo "Installation cancelled by user" exit 1 fi @@ -86,12 +86,12 @@ EOF SELECTED_CORES=$(gum input --placeholder="Number of CPU cores (1-$TOTAL_CORES)" --value="2" --header="How many CPU cores would you like to allocate to Windows VM?" --char-limit=2) # Check if user cancelled (Ctrl+C in gum input returns empty string) - if [ -z "$SELECTED_CORES" ]; then + if [[ -z $SELECTED_CORES ]]; then echo "Installation cancelled by user" exit 1 fi - if ! [[ "$SELECTED_CORES" =~ ^[0-9]+$ ]] || [ "$SELECTED_CORES" -lt 1 ] || [ "$SELECTED_CORES" -gt "$TOTAL_CORES" ]; then + if ! [[ $SELECTED_CORES =~ ^[0-9]+$ ]] || (( SELECTED_CORES < 1 )) || (( SELECTED_CORES > TOTAL_CORES )); then echo "Invalid input. Using default: 2 cores" SELECTED_CORES=2 fi @@ -100,7 +100,7 @@ EOF MAX_DISK_GB=$((AVAILABLE_SPACE - 10)) # Leave 10GB for Windows image # Check if we have enough space for minimum - if [ $MAX_DISK_GB -lt 32 ]; then + if (( MAX_DISK_GB < 32 )); then echo "❌ Insufficient disk space for Windows VM!" echo " Available: ${AVAILABLE_SPACE}GB" echo " Minimum required: 42GB (32GB disk + 10GB for Windows image)" @@ -109,7 +109,7 @@ EOF DISK_OPTIONS="" for size in 32 64 128 256 512; do - if [ $size -le $MAX_DISK_GB ]; then + if (( size <= MAX_DISK_GB )); then DISK_OPTIONS="$DISK_OPTIONS ${size}G" fi done @@ -123,7 +123,7 @@ EOF SELECTED_DISK=$(echo $DISK_OPTIONS | tr ' ' '\n' | gum choose --selected="$DEFAULT_DISK" --header="How much disk space would you like to give Windows VM? (64GB+ recommended)") # Check if user cancelled - if [ -z "$SELECTED_DISK" ]; then + if [[ -z $SELECTED_DISK ]]; then echo "Installation cancelled by user" exit 1 fi @@ -136,12 +136,12 @@ EOF # Prompt for username and password USERNAME=$(gum input --placeholder="Username (Press enter to use default: docker)" --header="Enter Windows username:") - if [ -z "$USERNAME" ]; then + if [[ -z $USERNAME ]]; then USERNAME="docker" fi PASSWORD=$(gum input --placeholder="Password (Press enter to use default: admin)" --password --header="Enter Windows password:") - if [ -z "$PASSWORD" ]; then + if [[ -z $PASSWORD ]]; then PASSWORD="admin" PASSWORD_DISPLAY="(default)" else @@ -185,19 +185,21 @@ services: DISK_SIZE: "$SELECTED_DISK" USERNAME: "$USERNAME" PASSWORD: "$PASSWORD" + TZ: "$(timedatectl show -p Timezone --value 2>/dev/null || echo UTC)" + ARGUMENTS: "-rtc base=localtime,clock=host,driftfix=slew" devices: - /dev/kvm - /dev/net/tun cap_add: - NET_ADMIN ports: - - 8006:8006 - - 3389:3389/tcp - - 3389:3389/udp + - 127.0.0.1:8006:8006 + - 127.0.0.1:3389:3389/tcp + - 127.0.0.1:3389:3389/udp volumes: - $HOME/.windows:/storage - $HOME/Windows:/shared - restart: always + restart: unless-stopped stop_grace_period: 2m EOF @@ -240,6 +242,11 @@ EOF } remove_windows() { + if ! gum confirm --default=false "Remove Windows VM and delete all associated data?"; then + echo "Removal cancelled by user" + exit 1 + fi + echo "Removing Windows VM..." docker-compose -f "$COMPOSE_FILE" down 2>/dev/null || true @@ -254,33 +261,14 @@ remove_windows() { echo "Windows VM removal completed!" } -wait_for_rdp_ready() { - local WIN_USER="$1" - local WIN_PASS="$2" - local TIMEOUT=240 - local SECONDS=0 - - echo "Waiting for Windows VM to be ready..." - - while ! timeout 5s xfreerdp3 /auth-only /cert:ignore /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 &>/dev/null; do - sleep 2 - if [ $SECONDS -gt $TIMEOUT ]; then - echo "❌ Timeout waiting for RDP!" - echo " The VM might still be installing Windows." - echo " Check progress at: http://127.0.0.1:8006" - return 1 - fi - done -} - launch_windows() { KEEP_ALIVE=false - if [ "$1" = "--keep-alive" ] || [ "$1" = "-k" ]; then + if [[ $1 = "--keep-alive" ]] || [[ $1 = "-k" ]]; then KEEP_ALIVE=true fi # Check if config exists - if [ ! -f "$COMPOSE_FILE" ]; then + if [[ ! -f $COMPOSE_FILE ]]; then echo "Windows VM not configured. Please run: omarchy-windows-vm install" exit 1 fi @@ -290,13 +278,13 @@ launch_windows() { WIN_PASS=$(grep "PASSWORD:" "$COMPOSE_FILE" | sed 's/.*PASSWORD: "\(.*\)"/\1/') # Use defaults if not found - [ -z "$WIN_USER" ] && WIN_USER="docker" - [ -z "$WIN_PASS" ] && WIN_PASS="admin" + [[ -z $WIN_USER ]] && WIN_USER="docker" + [[ -z $WIN_PASS ]] && WIN_PASS="admin" # Check if container is already running CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' omarchy-windows 2>/dev/null) - if [ "$CONTAINER_STATUS" != "running" ]; then + if [[ $CONTAINER_STATUS != "running" ]]; then echo "Starting Windows VM..." # Send desktop notification @@ -309,15 +297,23 @@ launch_windows() { notify-send -u critical "Windows VM" "Failed to start Windows VM" exit 1 fi - fi - if ! wait_for_rdp_ready "$WIN_USER" "$WIN_PASS"; then - notify-send -u critical "Windows VM" "Did not come alive in time." - exit 1 + echo "Waiting for Windows VM to start..." + WAIT_COUNT=0 + until docker logs omarchy-windows 2>&1 | grep -qi "windows started successfully"; do + sleep 2 + WAIT_COUNT=$((WAIT_COUNT + 1)) + if (( WAIT_COUNT > 60 )); then # 2 minutes timeout + echo "" + echo "❌ Timeout: Windows VM failed to start within 2 minutes" + echo " Check logs: docker logs omarchy-windows" + exit 1 + fi + done fi # Build the connection info - if [ "$KEEP_ALIVE" = true ]; then + if [[ $KEEP_ALIVE = "true" ]]; then LIFECYCLE="VM will keep running after RDP closes To stop: omarchy-windows-vm stop" else @@ -338,18 +334,18 @@ To stop: omarchy-windows-vm stop" SCALE_PERCENT=$(echo "$HYPR_SCALE" | awk '{print int($1 * 100)}') RDP_SCALE="" - if [ "$SCALE_PERCENT" -ge 170 ]; then + if (( SCALE_PERCENT >= 170 )); then RDP_SCALE="/scale:180" - elif [ "$SCALE_PERCENT" -ge 130 ]; then + elif (( SCALE_PERCENT >= 130 )); then RDP_SCALE="/scale:140" fi # If scale is less than 130%, don't set any scale (use default 100) # Connect with RDP in fullscreen (auto-detects resolution) - xfreerdp3 /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 -grab-keyboard /sound /microphone /cert:ignore /title:"Windows VM - Omarchy" /dynamic-resolution /gfx:AVC444 /floatbar:sticky:off,default:visible,show:fullscreen $RDP_SCALE + xfreerdp3 /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 -grab-keyboard /sound /microphone /clipboard /cert:ignore /title:"Windows VM - Omarchy" /dynamic-resolution /gfx:AVC444 /floatbar:sticky:off,default:visible,show:fullscreen $RDP_SCALE # After RDP closes, stop the container unless --keep-alive was specified - if [ "$KEEP_ALIVE" = false ]; then + if [[ $KEEP_ALIVE = "false" ]]; then echo "" echo "RDP session closed. Stopping Windows VM..." docker-compose -f "$COMPOSE_FILE" down @@ -362,7 +358,7 @@ To stop: omarchy-windows-vm stop" } stop_windows() { - if [ ! -f "$COMPOSE_FILE" ]; then + if [[ ! -f $COMPOSE_FILE ]]; then echo "Windows VM not configured." exit 1 fi @@ -373,7 +369,7 @@ stop_windows() { } status_windows() { - if [ ! -f "$COMPOSE_FILE" ]; then + if [[ ! -f $COMPOSE_FILE ]]; then echo "Windows VM not configured." echo "To set up: omarchy-windows-vm install" exit 1 @@ -381,10 +377,10 @@ status_windows() { CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' omarchy-windows 2>/dev/null) - if [ -z "$CONTAINER_STATUS" ]; then + if [[ -z $CONTAINER_STATUS ]]; then echo "Windows VM container not found." echo "To start: omarchy-windows-vm launch" - elif [ "$CONTAINER_STATUS" = "running" ]; then + elif [[ $CONTAINER_STATUS = "running" ]]; then gum style \ --border normal \ --padding "1 2" \ diff --git a/boot.sh b/boot.sh index 0ab69d5b..e17c7af2 100755 --- a/boot.sh +++ b/boot.sh @@ -17,6 +17,21 @@ ansi_art=' ▄▄▄ clear echo -e "\n$ansi_art\n" +# Use custom branch if instructed, otherwise default to master +OMARCHY_REF="${OMARCHY_REF:-master}" + +# Set mirror based on branch +if [[ $OMARCHY_REF == "dev" ]]; then + export OMARCHY_MIRROR=edge + echo 'Server = https://mirror.omarchy.org/$repo/os/$arch' | sudo tee /etc/pacman.d/mirrorlist >/dev/null +elif [[ $OMARCHY_REF == "rc" ]]; then + export OMARCHY_MIRROR=rc + echo 'Server = https://rc-mirror.omarchy.org/$repo/os/$arch' | sudo tee /etc/pacman.d/mirrorlist >/dev/null +else + export OMARCHY_MIRROR=stable + echo 'Server = https://stable-mirror.omarchy.org/$repo/os/$arch' | sudo tee /etc/pacman.d/mirrorlist >/dev/null +fi + sudo pacman -Syu --noconfirm --needed git # Use custom repo if specified, otherwise default to basecamp/omarchy @@ -26,19 +41,10 @@ echo -e "\nCloning Omarchy from: https://github.com/${OMARCHY_REPO}.git" rm -rf ~/.local/share/omarchy/ git clone "https://github.com/${OMARCHY_REPO}.git" ~/.local/share/omarchy >/dev/null -# Use custom branch if instructed, otherwise default to master -OMARCHY_REF="${OMARCHY_REF:-master}" echo -e "\e[32mUsing branch: $OMARCHY_REF\e[0m" cd ~/.local/share/omarchy git fetch origin "${OMARCHY_REF}" && git checkout "${OMARCHY_REF}" cd - -# Set edge mirror for dev installs -if [[ $OMARCHY_REF == "dev" ]]; then - export OMARCHY_MIRROR=edge -else - export OMARCHY_MIRROR=stable -fi - echo -e "\nInstallation starting..." source ~/.local/share/omarchy/install.sh diff --git a/config/alacritty/alacritty.toml b/config/alacritty/alacritty.toml index be44031c..f016c07a 100644 --- a/config/alacritty/alacritty.toml +++ b/config/alacritty/alacritty.toml @@ -3,6 +3,9 @@ general.import = [ "~/.config/omarchy/current/theme/alacritty.toml" ] [env] TERM = "xterm-256color" +[terminal] +osc52 = "CopyPaste" + [font] normal = { family = "JetBrainsMono Nerd Font", style = "Regular" } bold = { family = "JetBrainsMono Nerd Font", style = "Bold" } diff --git a/config/brave-flags.conf b/config/brave-flags.conf index bce00d52..88c8082b 100644 --- a/config/brave-flags.conf +++ b/config/brave-flags.conf @@ -2,5 +2,3 @@ --ozone-platform-hint=wayland --enable-features=TouchpadOverscrollHistoryNavigation --load-extension=~/.local/share/omarchy/default/chromium/extensions/copy-url -# Chromium crash workaround for Wayland color management on Hyprland - see https://github.com/hyprwm/Hyprland/issues/11957 ---disable-features=WaylandWpColorManagerV1 diff --git a/config/chromium-flags.conf b/config/chromium-flags.conf index bce00d52..88c8082b 100644 --- a/config/chromium-flags.conf +++ b/config/chromium-flags.conf @@ -2,5 +2,3 @@ --ozone-platform-hint=wayland --enable-features=TouchpadOverscrollHistoryNavigation --load-extension=~/.local/share/omarchy/default/chromium/extensions/copy-url -# Chromium crash workaround for Wayland color management on Hyprland - see https://github.com/hyprwm/Hyprland/issues/11957 ---disable-features=WaylandWpColorManagerV1 diff --git a/config/elephant/symbols.toml b/config/elephant/symbols.toml new file mode 100644 index 00000000..3144c152 --- /dev/null +++ b/config/elephant/symbols.toml @@ -0,0 +1 @@ +command = 'wl-copy && hyprctl dispatch sendshortcut "SHIFT, Insert,"' diff --git a/config/fontconfig/fonts.conf b/config/fontconfig/fonts.conf index 5463ba30..2d873761 100644 --- a/config/fontconfig/fonts.conf +++ b/config/fontconfig/fonts.conf @@ -55,4 +55,25 @@ Liberation Sans + + + sans-serif + + Noto Color Emoji + + + + + serif + + Noto Color Emoji + + + + + monospace + + Noto Color Emoji + + diff --git a/config/ghostty/config b/config/ghostty/config index 4360f279..d53f5c32 100644 --- a/config/ghostty/config +++ b/config/ghostty/config @@ -32,3 +32,6 @@ keybind = super+control+shift+alt+arrow_right=resize_split:right,100 # Slowdown mouse scrolling mouse-scroll-multiplier = 0.95 + +# Fix general slowness on hyprland (https://github.com/ghostty-org/ghostty/discussions/3224) +async-backend = epoll diff --git a/config/hypr/bindings.conf b/config/hypr/bindings.conf index f7770dd8..985832fc 100644 --- a/config/hypr/bindings.conf +++ b/config/hypr/bindings.conf @@ -1,6 +1,8 @@ # Application bindings bindd = SUPER, RETURN, Terminal, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" +bindd = SUPER ALT, RETURN, Tmux, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" tmux new bindd = SUPER SHIFT, F, File manager, exec, uwsm-app -- nautilus --new-window +bindd = SUPER ALT SHIFT, F, File manager (cwd), exec, uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)" bindd = SUPER SHIFT, B, Browser, exec, omarchy-launch-browser bindd = SUPER SHIFT ALT, B, Browser (private), exec, omarchy-launch-browser --private bindd = SUPER SHIFT, M, Music, exec, omarchy-launch-or-focus spotify @@ -23,6 +25,9 @@ bindd = SUPER SHIFT, P, Google Photos, exec, omarchy-launch-or-focus-webapp "Goo bindd = SUPER SHIFT, X, X, exec, omarchy-launch-webapp "https://x.com/" bindd = SUPER SHIFT ALT, X, X Post, exec, omarchy-launch-webapp "https://x.com/compose/post" +# Add extra bindings +# bind = SUPER SHIFT, R, exec, alacritty -e ssh your-server + # Overwrite existing bindings, like putting Omarchy Menu on Super + Space # unbind = SUPER, SPACE # bindd = SUPER, SPACE, Omarchy menu, exec, omarchy-menu diff --git a/config/hypr/hypridle.conf b/config/hypr/hypridle.conf index d39c97fd..b7d17690 100644 --- a/config/hypr/hypridle.conf +++ b/config/hypr/hypridle.conf @@ -1,7 +1,7 @@ general { lock_cmd = omarchy-lock-screen # lock screen and 1password before_sleep_cmd = loginctl lock-session # lock before suspend. - after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. + after_sleep_cmd = sleep 1 && hyprctl dispatch dpms on # delay for PAM readiness, then turn on display. inhibit_sleep = 3 # wait until screen is locked } @@ -15,6 +15,12 @@ listener { on-timeout = loginctl lock-session # lock screen when timeout has passed } +listener { + timeout = 330 # 5.5min + on-timeout = brightnessctl -sd '*::kbd_backlight' set 0 # save state and turn off keyboard backlight + on-resume = brightnessctl -rd '*::kbd_backlight' # restore keyboard backlight +} + listener { timeout = 330 # 5.5min on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf index f7a939c0..9550b656 100644 --- a/config/hypr/hyprlock.conf +++ b/config/hypr/hyprlock.conf @@ -39,5 +39,5 @@ input-field { } auth { - fingerprint:enabled = true + fingerprint:enabled = false } diff --git a/config/hypr/input.conf b/config/hypr/input.conf index c536e618..841c8f42 100644 --- a/config/hypr/input.conf +++ b/config/hypr/input.conf @@ -3,6 +3,10 @@ input { # Use multiple keyboard layouts and switch between them with Left Alt + Right Alt # kb_layout = us,dk,eu + + # Use a specific keyboard variant if needed (e.g. intl for international keyboards) + # kb_variant = intl + kb_options = compose:caps # ,grp:alts_toggle # Change speed of keyboard repeat @@ -14,6 +18,9 @@ input { # Increase sensitivity for mouse/trackpad (default: 0) # sensitivity = 0.35 + + # Turn off mouse acceleration (default: false) + # force_no_accel = true touchpad { # Use natural (inverse) scrolling diff --git a/config/hypr/looknfeel.conf b/config/hypr/looknfeel.conf index 62e26344..8d869813 100644 --- a/config/hypr/looknfeel.conf +++ b/config/hypr/looknfeel.conf @@ -15,6 +15,16 @@ general { decoration { # Use round window corners # rounding = 8 + + # Dim unfocused windows (0.0 = no dim, 1.0 = fully dimmed) + # dim_inactive = true + # dim_strength = 0.15 +} + +# https://wiki.hyprland.org/Configuring/Variables/#animations +animations { + # Disable all animations + # enabled = no } # https://wiki.hypr.land/Configuring/Dwindle-Layout/ diff --git a/config/hypr/monitors.conf b/config/hypr/monitors.conf index 875ad265..557c7ff3 100644 --- a/config/hypr/monitors.conf +++ b/config/hypr/monitors.conf @@ -11,9 +11,13 @@ monitor=,preferred,auto,auto # monitor=,preferred,auto,1.6 # Straight 1x setup for low-resolution displays like 1080p or 1440p +# Or for ultrawide monitors like 34" 3440x1440 or 49" 5120x1440 # env = GDK_SCALE,1 # monitor=,preferred,auto,1 +# Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°) +# monitor = DP-2, preferred, auto, 1, transform, 1 + # Example for Framework 13 w/ 6K XDR Apple display # monitor = DP-5, 6016x3384@60, auto, 2 # monitor = eDP-1, 2880x1920@120, auto, 2 diff --git a/config/omarchy/extensions/menu.sh b/config/omarchy/extensions/menu.sh index 743002ba..4ededf8e 100644 --- a/config/omarchy/extensions/menu.sh +++ b/config/omarchy/extensions/menu.sh @@ -8,7 +8,13 @@ # show_system_menu() { # case $(menu "System" " Lock\n󰐥 Shutdown") in # *Lock*) omarchy-lock-screen ;; -# *Shutdown*) omarchy-cmd-shutdown ;; +# *Shutdown*) omarchy-system-shutdown ;; # *) back_to show_main_menu ;; # esac # } +# +# Example of overriding just the about menu action: (Using zsh instead of bash (default)) +# +# show_about() { +# exec omarchy-launch-or-focus-tui "zsh -c 'fastfetch; read -k 1'" +# } diff --git a/config/opencode/opencode.json b/config/opencode/opencode.json index a03a5cb0..4fbe31f9 100644 --- a/config/opencode/opencode.json +++ b/config/opencode/opencode.json @@ -1,4 +1,5 @@ { "$schema": "https://opencode.ai/config.json", - "theme": "system" + "theme": "system", + "autoupdate": false } diff --git a/config/swayosd/config.toml b/config/swayosd/config.toml index 598c1f22..759cbe1f 100644 --- a/config/swayosd/config.toml +++ b/config/swayosd/config.toml @@ -1,4 +1,4 @@ [server] show_percentage = true max_volume = 100 -style = "./style.css" +style = "~/.config/swayosd/style.css" diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf new file mode 100644 index 00000000..5aa42094 --- /dev/null +++ b/config/tmux/tmux.conf @@ -0,0 +1,84 @@ +# Prefix +set -g prefix C-Space +set -g prefix2 C-b +bind C-Space send-prefix + +# Reload config +bind q source-file ~/.config/tmux/tmux.conf + +# Vi mode for copy +setw -g mode-keys vi +bind -T copy-mode-vi v send -X begin-selection +bind -T copy-mode-vi y send -X copy-selection-and-cancel + +# Pane Controls +bind h split-window -v -c "#{pane_current_path}" +bind v split-window -h -c "#{pane_current_path}" +bind x kill-pane + +bind -n C-M-Left select-pane -L +bind -n C-M-Right select-pane -R +bind -n C-M-Up select-pane -U +bind -n C-M-Down select-pane -D + +bind -n C-M-S-Left resize-pane -L 5 +bind -n C-M-S-Down resize-pane -D 5 +bind -n C-M-S-Up resize-pane -U 5 +bind -n C-M-S-Right resize-pane -R 5 + +# Window navigation +bind r command-prompt -I "#W" "rename-window -- '%%'" +bind c new-window -c "#{pane_current_path}" +bind k kill-window + +bind -n M-1 select-window -t 1 +bind -n M-2 select-window -t 2 +bind -n M-3 select-window -t 3 +bind -n M-4 select-window -t 4 +bind -n M-5 select-window -t 5 +bind -n M-6 select-window -t 6 +bind -n M-7 select-window -t 7 +bind -n M-8 select-window -t 8 +bind -n M-9 select-window -t 9 + +# Session controls +bind R command-prompt -I "#S" "rename-session -- '%%'" +bind C new-session -c "#{pane_current_path}" +bind K kill-session +bind P switch-client -p +bind N switch-client -n + +# General +set -g default-terminal "tmux-256color" +set -ag terminal-overrides ",*:RGB" +set -g mouse on +set -g base-index 1 +setw -g pane-base-index 1 +set -g renumber-windows on +set -g history-limit 50000 +set -g escape-time 0 +set -g focus-events on +set -g set-clipboard on +set -g allow-passthrough on +setw -g aggressive-resize on +set -g detach-on-destroy off + +# Status bar +set -g status-position top +set -g status-interval 5 +set -g status-left-length 30 +set -g status-right-length 50 +set -g window-status-separator "" + +# Theme +set -g status-style "bg=default,fg=default" +set -g status-left "#[fg=black,bg=blue,bold] #S #[bg=default] " +set -g status-right "#[fg=blue]#{?client_prefix,PREFIX ,}#[fg=brightblack]#h " +set -g window-status-format "#[fg=brightblack] #I:#W " +set -g window-status-current-format "#[fg=blue,bold] #I:#W " +set -g pane-border-style "fg=brightblack" +set -g pane-active-border-style "fg=blue" +set -g message-style "bg=default,fg=blue" +set -g message-command-style "bg=default,fg=blue" +set -g mode-style "bg=blue,fg=black" +setw -g clock-mode-colour blue diff --git a/config/waybar/config.jsonc b/config/waybar/config.jsonc index 9100b4ca..9049f00e 100644 --- a/config/waybar/config.jsonc +++ b/config/waybar/config.jsonc @@ -5,7 +5,7 @@ "spacing": 0, "height": 26, "modules-left": ["custom/omarchy", "hyprland/workspaces"], - "modules-center": ["clock", "custom/update", "custom/voxtype", "custom/screenrecording-indicator"], + "modules-center": ["clock", "custom/update", "custom/voxtype", "custom/screenrecording-indicator", "custom/idle-indicator", "custom/notification-silencing-indicator"], "modules-right": [ "group/tray-expander", "bluetooth", @@ -116,6 +116,7 @@ "format-muted": "", "format-icons": { "headphone": "", + "headset": "", "default": ["", "", ""] } }, @@ -141,6 +142,18 @@ "signal": 8, "return-type": "json" }, + "custom/idle-indicator": { + "on-click": "omarchy-toggle-idle", + "exec": "$OMARCHY_PATH/default/waybar/indicators/idle.sh", + "signal": 9, + "return-type": "json" + }, + "custom/notification-silencing-indicator": { + "on-click": "omarchy-toggle-notification-silencing", + "exec": "$OMARCHY_PATH/default/waybar/indicators/notification-silencing.sh", + "signal": 10, + "return-type": "json" + }, "custom/voxtype": { "exec": "omarchy-voxtype-status", "return-type": "json", diff --git a/config/waybar/style.css b/config/waybar/style.css index 19e934c2..4bbf0ddb 100644 --- a/config/waybar/style.css +++ b/config/waybar/style.css @@ -34,7 +34,6 @@ #battery, #pulseaudio, #custom-omarchy, -#custom-screenrecording-indicator, #custom-update { min-width: 12px; margin: 0 7.5px; @@ -72,9 +71,12 @@ tooltip { opacity: 0; } -#custom-screenrecording-indicator { +#custom-screenrecording-indicator, +#custom-idle-indicator, +#custom-notification-silencing-indicator { min-width: 12px; margin-left: 5px; + margin-right: 0; font-size: 10px; padding-bottom: 1px; } @@ -83,6 +85,11 @@ tooltip { color: #a55555; } +#custom-idle-indicator.active, +#custom-notification-silencing-indicator.active { + color: #a55555; +} + #custom-voxtype { min-width: 12px; margin: 0 0 0 7.5px; diff --git a/config/wiremix/wiremix.toml b/config/wiremix/wiremix.toml new file mode 100644 index 00000000..07f9747c --- /dev/null +++ b/config/wiremix/wiremix.toml @@ -0,0 +1,5 @@ +# overwrites default wiremix configuration +# defaults: https://github.com/tsowell/wiremix/blob/main/wiremix.toml + +[char_sets.default] +default_device = "⮞" diff --git a/config/xdg-terminals.list b/config/xdg-terminals.list index bc27bcf6..0821cf0d 100644 --- a/config/xdg-terminals.list +++ b/config/xdg-terminals.list @@ -1,3 +1,3 @@ # Terminal emulator preference order for xdg-terminal-exec # The first found and valid terminal will be used -com.mitchellh.ghostty.desktop +Alacritty.desktop diff --git a/default/bash/aliases b/default/bash/aliases index 8e485a35..39f4378a 100644 --- a/default/bash/aliases +++ b/default/bash/aliases @@ -7,6 +7,7 @@ if command -v eza &> /dev/null; then fi alias ff="fzf --preview 'bat --style=numbers --color=always {}'" +alias eff='$EDITOR "$(ff)"' if command -v zoxide &> /dev/null; then alias cd="zd" @@ -21,9 +22,9 @@ if command -v zoxide &> /dev/null; then } fi -open() { +open() ( xdg-open "$@" >/dev/null 2>&1 & -} +) # Directories alias ..='cd ..' @@ -32,9 +33,11 @@ alias ....='cd ../../..' # Tools alias c='opencode' +alias cx='printf "\033[2J\033[3J\033[H" && claude --allow-dangerously-skip-permissions' alias d='docker' alias r='rails' -n() { if [ "$#" -eq 0 ]; then nvim .; else nvim "$@"; fi; } +alias t='tmux attach || tmux new -s Work' +n() { if [ "$#" -eq 0 ]; then command nvim . ; else command nvim "$@"; fi; } # Git alias g='git' diff --git a/default/bash/fns/compression b/default/bash/fns/compression new file mode 100644 index 00000000..4e8bb814 --- /dev/null +++ b/default/bash/fns/compression @@ -0,0 +1,3 @@ +# Compression +compress() { tar -czf "${1%/}.tar.gz" "${1%/}"; } +alias decompress="tar -xzf" diff --git a/default/bash/fns/drives b/default/bash/fns/drives new file mode 100644 index 00000000..412faaba --- /dev/null +++ b/default/bash/fns/drives @@ -0,0 +1,59 @@ +# Write iso file to sd card +iso2sd() { + if (( $# < 1 )); then + echo "Usage: iso2sd [output_device]" + echo "Example: iso2sd ~/Downloads/ubuntu-25.04-desktop-amd64.iso /dev/sda" + return 1 + fi + + local iso="$1" + local drive="$2" + + if [[ -z $drive ]]; then + local available_sds=$(lsblk -dpno NAME | grep -E '/dev/sd') + + if [[ -z $available_sds ]]; then + echo "No SD drives found and no drive specified" + return 1 + fi + + drive=$(omarchy-drive-select "$available_sds") + + if [[ -z $drive ]]; then + echo "No drive selected" + return 1 + fi + fi + + sudo dd bs=4M status=progress oflag=sync if="$iso" of="$drive" + sudo eject "$drive" +} + +# Format an entire drive for a single partition using exFAT +format-drive() { + if (( $# != 2 )); then + echo "Usage: format-drive " + echo "Example: format-drive /dev/sda 'My Stuff'" + echo -e "\nAvailable drives:" + lsblk -d -o NAME -n | awk '{print "/dev/"$1}' + else + echo "WARNING: This will completely erase all data on $1 and label it '$2'." + read -rp "Are you sure you want to continue? (y/N): " confirm + + if [[ $confirm =~ ^[Yy]$ ]]; then + sudo wipefs -a "$1" + sudo dd if=/dev/zero of="$1" bs=1M count=100 status=progress + sudo parted -s "$1" mklabel gpt + sudo parted -s "$1" mkpart primary 1MiB 100% + sudo parted -s "$1" set 1 msftdata on + + partition="$([[ $1 == *"nvme"* ]] && echo "${1}p1" || echo "${1}1")" + sudo partprobe "$1" || true + sudo udevadm settle || true + + sudo mkfs.exfat -n "$2" "$partition" + + echo "Drive $1 formatted as exFAT and labeled '$2'." + fi + fi +} diff --git a/default/bash/fns/ssh-port-forwarding b/default/bash/fns/ssh-port-forwarding new file mode 100644 index 00000000..4ee6c924 --- /dev/null +++ b/default/bash/fns/ssh-port-forwarding @@ -0,0 +1,20 @@ +# SSH Port Forwarding Functions +fip() { + (( $# < 2 )) && echo "Usage: fip [port2] ..." && return 1 + local host="$1" + shift + for port in "$@"; do + ssh -f -N -L "$port:localhost:$port" "$host" && echo "Forwarding localhost:$port -> $host:$port" + done +} + +dip() { + (( $# == 0 )) && echo "Usage: dip [port2] ..." && return 1 + for port in "$@"; do + pkill -f "ssh.*-L $port:localhost:$port" && echo "Stopped forwarding port $port" || echo "No forwarding on port $port" + done +} + +lip() { + pgrep -af "ssh.*-L [0-9]+:localhost:[0-9]+" || echo "No active forwards" +} diff --git a/default/bash/fns/tmux b/default/bash/fns/tmux new file mode 100644 index 00000000..0144f2eb --- /dev/null +++ b/default/bash/fns/tmux @@ -0,0 +1,97 @@ +# Create a Tmux Dev Layout with editor, ai, and terminal +# Usage: tdl [] +tdl() { + [[ -z $1 ]] && { echo "Usage: tdl []"; return 1; } + [[ -z $TMUX ]] && { echo "You must start tmux to use tdl."; return 1; } + + local current_dir="${PWD}" + local editor_pane ai_pane ai2_pane + local ai="$1" + local ai2="$2" + + # Use TMUX_PANE for the pane we're running in (stable even if active window changes) + editor_pane="$TMUX_PANE" + + # Name the current window after the base directory name + tmux rename-window -t "$editor_pane" "$(basename "$current_dir")" + + # Split window vertically - top 85%, bottom 15% (target editor pane explicitly) + tmux split-window -v -p 15 -t "$editor_pane" -c "$current_dir" + + # Split editor pane horizontally - AI on right 30% (capture new pane ID directly) + ai_pane=$(tmux split-window -h -p 30 -t "$editor_pane" -c "$current_dir" -P -F '#{pane_id}') + + # If second AI provided, split the AI pane vertically + if [[ -n $ai2 ]]; then + ai2_pane=$(tmux split-window -v -t "$ai_pane" -c "$current_dir" -P -F '#{pane_id}') + tmux send-keys -t "$ai2_pane" "$ai2" C-m + fi + + # Run ai in the right pane + tmux send-keys -t "$ai_pane" "$ai" C-m + + # Run nvim in the left pane + tmux send-keys -t "$editor_pane" "$EDITOR ." C-m + + # Select the nvim pane for focus + tmux select-pane -t "$editor_pane" +} + +# Create multiple tdl windows with one per subdirectory in the current directory +# Usage: tdlm [] +tdlm() { + [[ -z $1 ]] && { echo "Usage: tdlm []"; return 1; } + [[ -z $TMUX ]] && { echo "You must start tmux to use tdlm."; return 1; } + + local ai="$1" + local ai2="$2" + local base_dir="$PWD" + local first=true + + # Rename the session to the current directory name (replace dots/colons which tmux disallows) + tmux rename-session "$(basename "$base_dir" | tr '.:' '--')" + + for dir in "$base_dir"/*/; do + [[ -d $dir ]] || continue + local dirpath="${dir%/}" + + if $first; then + # Reuse the current window for the first project + tmux send-keys -t "$TMUX_PANE" "cd '$dirpath' && tdl $ai $ai2" C-m + first=false + else + local pane_id=$(tmux new-window -c "$dirpath" -P -F '#{pane_id}') + tmux send-keys -t "$pane_id" "tdl $ai $ai2" C-m + fi + done +} + +# Create a multi-pane swarm layout with the same command started in each pane (great for AI) +# Usage: tsl +tsl() { + [[ -z $1 || -z $2 ]] && { echo "Usage: tsl "; return 1; } + [[ -z $TMUX ]] && { echo "You must start tmux to use tsl."; return 1; } + + local count="$1" + local cmd="$2" + local current_dir="${PWD}" + local -a panes + + tmux rename-window -t "$TMUX_PANE" "$(basename "$current_dir")" + + panes+=("$TMUX_PANE") + + while (( ${#panes[@]} < count )); do + local new_pane + local split_target="${panes[-1]}" + new_pane=$(tmux split-window -h -t "$split_target" -c "$current_dir" -P -F '#{pane_id}') + panes+=("$new_pane") + tmux select-layout -t "${panes[0]}" tiled + done + + for pane in "${panes[@]}"; do + tmux send-keys -t "$pane" "$cmd" C-m + done + + tmux select-pane -t "${panes[0]}" +} diff --git a/default/bash/fns/transcoding b/default/bash/fns/transcoding new file mode 100644 index 00000000..ea33c75b --- /dev/null +++ b/default/bash/fns/transcoding @@ -0,0 +1,45 @@ +# Transcode a video to a good-balance 1080p that's great for sharing online +transcode-video-1080p() { + ffmpeg -i "$1" -vf scale=1920:1080 -c:v libx264 -preset fast -crf 23 -c:a copy "${1%.*}-1080p.mp4" +} + +# Transcode a video to a good-balance 4K that's great for sharing online +transcode-video-4K() { + ffmpeg -i "$1" -c:v libx265 -preset slow -crf 24 -c:a aac -b:a 192k "${1%.*}-optimized.mp4" +} + +# Transcode any image to JPG image that's great for shrinking wallpapers +img2jpg() { + img="$1" + shift + + magick "$img" "$@" -quality 95 -strip "${img%.*}-converted.jpg" +} + +# Transcode any image to a small JPG (max 1080px wide) that's great for sharing online +img2jpg-small() { + img="$1" + shift + + magick "$img" "$@" -resize 1080x\> -quality 95 -strip "${img%.*}-small.jpg" +} + +# Transcode any image to a medium JPG (max 1800px wide) that's great for sharing online +img2jpg-medium() { + img="$1" + shift + + magick "$img" "$@" -resize 1800x\> -quality 95 -strip "${img%.*}-medium.jpg" +} + +# Transcode any image to compressed-but-lossless PNG +img2png() { + img="$1" + shift + + magick "$img" "$@" -strip -define png:compression-filter=5 \ + -define png:compression-level=9 \ + -define png:compression-strategy=1 \ + -define png:exclude-chunk=all \ + "${img%.*}-optimized.png" +} diff --git a/default/bash/functions b/default/bash/functions index 1839e242..9f26f9b5 100644 --- a/default/bash/functions +++ b/default/bash/functions @@ -1,82 +1 @@ -# Compression -compress() { tar -czf "${1%/}.tar.gz" "${1%/}"; } -alias decompress="tar -xzf" - -# Write iso file to sd card -iso2sd() { - if [ $# -ne 2 ]; then - echo "Usage: iso2sd " - echo "Example: iso2sd ~/Downloads/ubuntu-25.04-desktop-amd64.iso /dev/sda" - echo -e "\nAvailable SD cards:" - lsblk -d -o NAME | grep -E '^sd[a-z]' | awk '{print "/dev/"$1}' - else - sudo dd bs=4M status=progress oflag=sync if="$1" of="$2" - sudo eject $2 - fi -} - -# Format an entire drive for a single partition using exFAT -format-drive() { - if [ $# -ne 2 ]; then - echo "Usage: format-drive " - echo "Example: format-drive /dev/sda 'My Stuff'" - echo -e "\nAvailable drives:" - lsblk -d -o NAME -n | awk '{print "/dev/"$1}' - else - echo "WARNING: This will completely erase all data on $1 and label it '$2'." - read -rp "Are you sure you want to continue? (y/N): " confirm - - if [[ "$confirm" =~ ^[Yy]$ ]]; then - sudo wipefs -a "$1" - sudo dd if=/dev/zero of="$1" bs=1M count=100 status=progress - sudo parted -s "$1" mklabel gpt - sudo parted -s "$1" mkpart primary 1MiB 100% - - partition="$([[ $1 == *"nvme"* ]] && echo "${1}p1" || echo "${1}1")" - sudo partprobe "$1" || true - sudo udevadm settle || true - - sudo mkfs.exfat -n "$2" "$partition" - - echo "Drive $1 formatted as exFAT and labeled '$2'." - fi - fi -} - -# Transcode a video to a good-balance 1080p that's great for sharing online -transcode-video-1080p() { - ffmpeg -i $1 -vf scale=1920:1080 -c:v libx264 -preset fast -crf 23 -c:a copy ${1%.*}-1080p.mp4 -} - -# Transcode a video to a good-balance 4K that's great for sharing online -transcode-video-4K() { - ffmpeg -i $1 -c:v libx265 -preset slow -crf 24 -c:a aac -b:a 192k ${1%.*}-optimized.mp4 -} - -# Transcode any image to JPG image that's great for shrinking wallpapers -img2jpg() { - img="$1" - shift - - magick "$img" $@ -quality 95 -strip ${img%.*}-optimized.jpg -} - -# Transcode any image to JPG image that's great for sharing online without being too big -img2jpg-small() { - img="$1" - shift - - magick "$img" $@ -resize 1080x\> -quality 95 -strip ${img%.*}-optimized.jpg -} - -# Transcode any image to compressed-but-lossless PNG -img2png() { - img="$1" - shift - - magick "$img" $@ -strip -define png:compression-filter=5 \ - -define png:compression-level=9 \ - -define png:compression-strategy=1 \ - -define png:exclude-chunk=all \ - "${img%.*}-optimized.png" -} +for f in $OMARCHY_PATH/default/bash/fns/*; do source "$f"; done diff --git a/default/bash/init b/default/bash/init index e9228edb..6ae94284 100644 --- a/default/bash/init +++ b/default/bash/init @@ -3,6 +3,9 @@ if command -v mise &> /dev/null; then fi if command -v starship &> /dev/null; then + # clear stale readline state before rendering prompt (prevents artifacts in prompt after abnormal exits like SIGQUIT) + __sanitize_prompt() { printf '\r\033[K'; } + PROMPT_COMMAND="__sanitize_prompt${PROMPT_COMMAND:+;$PROMPT_COMMAND}" eval "$(starship init bash)" fi @@ -11,7 +14,7 @@ if command -v zoxide &> /dev/null; then fi if command -v try &> /dev/null; then - eval "$(try init ~/Work/tries)" + eval "$(SHELL=/bin/bash try init ~/Work/tries)" fi if command -v fzf &> /dev/null; then diff --git a/default/bash/inputrc b/default/bash/inputrc index 11146d64..3b48e554 100644 --- a/default/bash/inputrc +++ b/default/bash/inputrc @@ -37,3 +37,11 @@ set skip-completed-text on # Coloring for Bash 4 tab completions. set colored-stats on + +# Cycle forward and backward through completion candidates (tab/shift+tab) +# (completion listing and display behavior configured above) +TAB: menu-complete +"\e[Z": menu-complete-backward + +# On first Tab, complete the common prefix before cycling candidates +set menu-complete-display-prefix on diff --git a/default/bashrc b/default/bashrc index eaf13c66..77e8d27b 100644 --- a/default/bashrc +++ b/default/bashrc @@ -9,3 +9,4 @@ source ~/.local/share/omarchy/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" diff --git a/default/elephant/omarchy_background_selector.lua b/default/elephant/omarchy_background_selector.lua new file mode 100644 index 00000000..7954266f --- /dev/null +++ b/default/elephant/omarchy_background_selector.lua @@ -0,0 +1,73 @@ +Name = "omarchyBackgroundSelector" +NamePretty = "Omarchy Background Selector" +Cache = false +HideFromProviderlist = true +SearchName = true + +local function ShellEscape(s) + return "'" .. s:gsub("'", "'\\''") .. "'" +end + +function FormatName(filename) + -- Remove leading number and dash + local name = filename:gsub("^%d+", ""):gsub("^%-", "") + -- Remove extension + name = name:gsub("%.[^%.]+$", "") + -- Replace dashes with spaces + name = name:gsub("-", " ") + -- Capitalize each word + name = name:gsub("%S+", function(word) + return word:sub(1, 1):upper() .. word:sub(2):lower() + end) + return name +end + +function GetEntries() + local entries = {} + local home = os.getenv("HOME") + + -- Read current theme name + local theme_name_file = io.open(home .. "/.config/omarchy/current/theme.name", "r") + local theme_name = theme_name_file and theme_name_file:read("*l") or nil + if theme_name_file then + theme_name_file:close() + end + + -- Directories to search + local dirs = { + home .. "/.config/omarchy/current/theme/backgrounds", + } + if theme_name then + table.insert(dirs, home .. "/.config/omarchy/backgrounds/" .. theme_name) + end + + -- Track added files to avoid duplicates + local seen = {} + + for _, wallpaper_dir in ipairs(dirs) do + local handle = io.popen( + "find " .. ShellEscape(wallpaper_dir) + .. " -maxdepth 1 -type f \\( -name '*.jpg' -o -name '*.jpeg' -o -name '*.png' -o -name '*.gif' -o -name '*.bmp' -o -name '*.webp' \\) 2>/dev/null | sort" + ) + if handle then + for background in handle:lines() do + local filename = background:match("([^/]+)$") + if filename and not seen[filename] then + seen[filename] = true + table.insert(entries, { + Text = FormatName(filename), + Value = background, + Actions = { + activate = "omarchy-theme-bg-set " .. ShellEscape(background), + }, + Preview = background, + PreviewType = "file", + }) + end + end + handle:close() + end + end + + return entries +end diff --git a/default/hypr/apps.conf b/default/hypr/apps.conf index 354339de..f6946ad1 100644 --- a/default/hypr/apps.conf +++ b/default/hypr/apps.conf @@ -9,7 +9,9 @@ source = ~/.local/share/omarchy/default/hypr/apps/pip.conf source = ~/.local/share/omarchy/default/hypr/apps/qemu.conf source = ~/.local/share/omarchy/default/hypr/apps/retroarch.conf source = ~/.local/share/omarchy/default/hypr/apps/steam.conf +source = ~/.local/share/omarchy/default/hypr/apps/geforce.conf source = ~/.local/share/omarchy/default/hypr/apps/system.conf +source = ~/.local/share/omarchy/default/hypr/apps/telegram.conf source = ~/.local/share/omarchy/default/hypr/apps/terminals.conf source = ~/.local/share/omarchy/default/hypr/apps/walker.conf source = ~/.local/share/omarchy/default/hypr/apps/webcam-overlay.conf diff --git a/default/hypr/apps/bitwarden.conf b/default/hypr/apps/bitwarden.conf index 974aa28c..8ffb5688 100644 --- a/default/hypr/apps/bitwarden.conf +++ b/default/hypr/apps/bitwarden.conf @@ -1,2 +1,6 @@ windowrule = no_screen_share on, match:class ^(Bitwarden)$ windowrule = tag +floating-window, match:class ^(Bitwarden)$ + +# Bitwarden Chrome Extension +windowrule = no_screen_share on, match:class chrome-nngceckbapebfimnlniiiahkandclblb-Default +windowrule = tag +floating-window, match:class chrome-nngceckbapebfimnlniiiahkandclblb-Default diff --git a/default/hypr/apps/browser.conf b/default/hypr/apps/browser.conf index 2b44576b..7f30ba38 100644 --- a/default/hypr/apps/browser.conf +++ b/default/hypr/apps/browser.conf @@ -1,13 +1,16 @@ # Browser types windowrule = tag +chromium-based-browser, match:class ((google-)?[cC]hrom(e|ium)|[bB]rave-browser|[mM]icrosoft-edge|Vivaldi-stable|helium) windowrule = tag +firefox-based-browser, match:class ([fF]irefox|zen|librewolf) +windowrule = tag -default-opacity, match:tag chromium-based-browser +windowrule = tag -default-opacity, match:tag firefox-based-browser + +# Video apps: remove chromium browser tag so they don't get opacity applied +windowrule = tag -chromium-based-browser, match:class (chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default) +windowrule = tag -default-opacity, match:class (chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default) # Force chromium-based browsers into a tile to deal with --app bug windowrule = tile on, match:tag chromium-based-browser # Only a subtle opacity change, but not for video sites -windowrule = opacity 1 0.97, match:tag chromium-based-browser -windowrule = opacity 1 0.97, match:tag firefox-based-browser - -# Some video sites should never have opacity applied to them -windowrule = opacity 1.0 1.0, match:initial_title ((?i)(?:[a-z0-9-]+\.)*youtube\.com_/|app\.zoom\.us_/wc/home) +windowrule = opacity 1.0 0.97, match:tag chromium-based-browser +windowrule = opacity 1.0 0.97, match:tag firefox-based-browser diff --git a/default/hypr/apps/geforce.conf b/default/hypr/apps/geforce.conf new file mode 100644 index 00000000..fb2e5a30 --- /dev/null +++ b/default/hypr/apps/geforce.conf @@ -0,0 +1,5 @@ +windowrule { + name = geforce + match:class = GeForceNOW + idle_inhibit = fullscreen +} diff --git a/default/hypr/apps/jetbrains.conf b/default/hypr/apps/jetbrains.conf index d045f823..5b73bce4 100644 --- a/default/hypr/apps/jetbrains.conf +++ b/default/hypr/apps/jetbrains.conf @@ -1,22 +1,41 @@ # Fix splash screen showing in weird places and prevent annoying focus takeovers -windowrule = tag +jetbrains-splash, match:class ^(jetbrains-.*)$, match:title ^(splash)$, match:float 1 -windowrule = center on, match:tag jetbrains-splash -windowrule = no_focus on, match:tag jetbrains-splash -windowrule = border_size 0, match:tag jetbrains-splash +windowrule { + name = jetbrains-splash + match:class = ^(jetbrains-.*)$ + match:title = ^(splash)$ + match:float = 1 + tag = +jetbrains-splash + center = on + no_focus = on + border_size = 0 +} # Center popups/find windows -windowrule = tag +jetbrains, match:class ^(jetbrains-.*), match:title ^()$, match:float 1 -windowrule = center on, match:tag jetbrains - -# Enabling this makes it possible to provide input in popup dialogs (search window, new file, etc.) -windowrule = stay_focused on, match:tag jetbrains -windowrule = border_size 0, match:tag jetbrains - -# For some reason tag:jetbrains does not work for size rule -windowrule = min_size (monitor_w*0.5) (monitor_h*0.5), match:class ^(jetbrains-.*), match:title ^()$, match:float 1 +windowrule { + name = jetbrains-popup + match:class = ^(jetbrains-.*) + match:title = ^()$ + match:float = 1 + tag = +jetbrains + center = on + # Enabling this makes it possible to provide input in popup dialogs (search window, new file, etc.) + stay_focused = on + border_size = 0 + min_size = (monitor_w*0.5) (monitor_h*0.5) + } # Disable window flicker when autocomplete or tooltips appear -windowrule = no_initial_focus on, match:class ^(jetbrains-.*)$, match:title ^(win.*)$, match:float 1 +windowrule { + name = jetbrains-tooltip + match:class = ^(jetbrains-.*)$ + match:title = ^(win.*)$ + match:float = 1 + no_initial_focus = on +} # Disable mouse focus -windowrule = no_follow_mouse on, match:class ^(jetbrains-.*)$ +windowrule { + name = jetbrains-focus + no_follow_mouse = on + match:class = ^(jetbrains-.*)$ +} diff --git a/default/hypr/apps/pip.conf b/default/hypr/apps/pip.conf index e5b45d56..417edc91 100644 --- a/default/hypr/apps/pip.conf +++ b/default/hypr/apps/pip.conf @@ -1,5 +1,6 @@ # Picture-in-picture overlays windowrule = tag +pip, match:title (Picture.?in.?[Pp]icture) +windowrule = tag -default-opacity, match:tag pip windowrule = float on, match:tag pip windowrule = pin on, match:tag pip windowrule = size 600 338, match:tag pip diff --git a/default/hypr/apps/qemu.conf b/default/hypr/apps/qemu.conf index acc32a4a..6dcce0e0 100644 --- a/default/hypr/apps/qemu.conf +++ b/default/hypr/apps/qemu.conf @@ -1 +1,2 @@ +windowrule = tag -default-opacity, match:class qemu windowrule = opacity 1 1, match:class qemu diff --git a/default/hypr/apps/retroarch.conf b/default/hypr/apps/retroarch.conf index f3b046f9..556f0fd8 100644 --- a/default/hypr/apps/retroarch.conf +++ b/default/hypr/apps/retroarch.conf @@ -1,3 +1,4 @@ windowrule = fullscreen on, match:class com.libretro.RetroArch +windowrule = tag -default-opacity, match:class com.libretro.RetroArch windowrule = opacity 1 1, match:class com.libretro.RetroArch windowrule = idle_inhibit fullscreen, match:class com.libretro.RetroArch diff --git a/default/hypr/apps/steam.conf b/default/hypr/apps/steam.conf index ec4f754d..a42a6e68 100644 --- a/default/hypr/apps/steam.conf +++ b/default/hypr/apps/steam.conf @@ -1,7 +1,8 @@ # Float Steam windowrule = float on, match:class steam windowrule = center on, match:class steam, match:title Steam -windowrule = opacity 1 1, match:class steam +windowrule = tag -default-opacity, match:class steam.* +windowrule = opacity 1 1, match:class steam.* windowrule = size 1100 700, match:class steam, match:title Steam windowrule = size 460 800, match:class steam, match:title Friends List windowrule = idle_inhibit fullscreen, match:class steam diff --git a/default/hypr/apps/system.conf b/default/hypr/apps/system.conf index ee6c6b86..702388f2 100644 --- a/default/hypr/apps/system.conf +++ b/default/hypr/apps/system.conf @@ -12,6 +12,7 @@ windowrule = fullscreen on, match:class org.omarchy.screensaver windowrule = float on, match:class org.omarchy.screensaver # No transparency on media windows +windowrule = tag -default-opacity, match:class ^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$ windowrule = opacity 1 1, match:class ^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$ # Popped window rounding diff --git a/default/hypr/apps/telegram.conf b/default/hypr/apps/telegram.conf new file mode 100644 index 00000000..5a621fdb --- /dev/null +++ b/default/hypr/apps/telegram.conf @@ -0,0 +1,2 @@ +# Prevent Telegram from stealing focus on new messages +windowrule = focus_on_activate off, match:class org.telegram.desktop diff --git a/default/hypr/apps/terminals.conf b/default/hypr/apps/terminals.conf index 2bcf0eb6..ead08dde 100644 --- a/default/hypr/apps/terminals.conf +++ b/default/hypr/apps/terminals.conf @@ -1,2 +1,4 @@ # Define terminal tag to style them uniformly windowrule = tag +terminal, match:class (Alacritty|kitty|com.mitchellh.ghostty) +windowrule = tag -default-opacity, match:tag terminal +windowrule = opacity 0.97 0.9, match:tag terminal diff --git a/default/hypr/autostart.conf b/default/hypr/autostart.conf index 0462f73a..40522822 100644 --- a/default/hypr/autostart.conf +++ b/default/hypr/autostart.conf @@ -1,7 +1,7 @@ exec-once = uwsm-app -- hypridle exec-once = uwsm-app -- mako exec-once = uwsm-app -- waybar -exec-once = uwsm-app -- fcitx5 +exec-once = uwsm-app -- fcitx5 --disable notificationitem exec-once = uwsm-app -- swaybg -i ~/.config/omarchy/current/background -m fill exec-once = uwsm-app -- swayosd-server exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 diff --git a/default/hypr/bindings/media.conf b/default/hypr/bindings/media.conf index efedbb72..9506ff41 100644 --- a/default/hypr/bindings/media.conf +++ b/default/hypr/bindings/media.conf @@ -6,14 +6,17 @@ bindeld = ,XF86AudioRaiseVolume, Volume up, exec, $osdclient --output-volume rai bindeld = ,XF86AudioLowerVolume, Volume down, exec, $osdclient --output-volume lower bindeld = ,XF86AudioMute, Mute, exec, $osdclient --output-volume mute-toggle bindeld = ,XF86AudioMicMute, Mute microphone, exec, $osdclient --input-volume mute-toggle -bindeld = ,XF86MonBrightnessUp, Brightness up, exec, $osdclient --brightness raise -bindeld = ,XF86MonBrightnessDown, Brightness down, exec, $osdclient --brightness lower +bindeld = ,XF86MonBrightnessUp, Brightness up, exec, omarchy-brightness-display +5% +bindeld = ,XF86MonBrightnessDown, Brightness down, exec, omarchy-brightness-display 5%- +bindeld = ,XF86KbdBrightnessUp, Keyboard brightness up, exec, omarchy-brightness-keyboard up +bindeld = ,XF86KbdBrightnessDown, Keyboard brightness down, exec, omarchy-brightness-keyboard down +bindld = ,XF86KbdLightOnOff, Keyboard backlight cycle, exec, omarchy-brightness-keyboard cycle # Precise 1% multimedia adjustments with Alt modifier bindeld = ALT, XF86AudioRaiseVolume, Volume up precise, exec, $osdclient --output-volume +1 bindeld = ALT, XF86AudioLowerVolume, Volume down precise, exec, $osdclient --output-volume -1 -bindeld = ALT, XF86MonBrightnessUp, Brightness up precise, exec, $osdclient --brightness +1 -bindeld = ALT, XF86MonBrightnessDown, Brightness down precise, exec, $osdclient --brightness -1 +bindeld = ALT, XF86MonBrightnessUp, Brightness up precise, exec, omarchy-brightness-display +1% +bindeld = ALT, XF86MonBrightnessDown, Brightness down precise, exec, omarchy-brightness-display 1%- # Requires playerctl bindld = , XF86AudioNext, Next track, exec, $osdclient --playerctl next diff --git a/default/hypr/bindings/utilities.conf b/default/hypr/bindings/utilities.conf index e4364ec8..6cd1e21d 100644 --- a/default/hypr/bindings/utilities.conf +++ b/default/hypr/bindings/utilities.conf @@ -1,6 +1,7 @@ # Menus bindd = SUPER, SPACE, Launch apps, exec, omarchy-launch-walker bindd = SUPER CTRL, E, Emoji picker, exec, omarchy-launch-walker -m symbols +bindd = SUPER CTRL, C, Capture menu, exec, omarchy-menu capture bindd = SUPER ALT, SPACE, Omarchy menu, exec, omarchy-menu bindd = SUPER, ESCAPE, System menu, exec, omarchy-menu system bindld = , XF86PowerOff, Power menu, exec, omarchy-menu system @@ -9,7 +10,7 @@ bindd = , XF86Calculator, Calculator, exec, gnome-calculator # Aesthetics bindd = SUPER SHIFT, SPACE, Toggle top bar, exec, omarchy-toggle-waybar -bindd = SUPER CTRL, SPACE, Next background in theme, exec, omarchy-theme-bg-next +bindd = SUPER CTRL, SPACE, Next background in theme, exec, omarchy-menu background bindd = SUPER SHIFT CTRL, SPACE, Theme menu, exec, omarchy-menu theme bindd = SUPER, BACKSPACE, Toggle window transparency, exec, hyprctl dispatch setprop "address:$(hyprctl activewindow -j | jq -r '.address')" opaque toggle bindd = SUPER SHIFT, BACKSPACE, Toggle workspace gaps, exec, omarchy-hyprland-workspace-toggle-gaps @@ -17,24 +18,23 @@ bindd = SUPER SHIFT, BACKSPACE, Toggle workspace gaps, exec, omarchy-hyprland-wo # Notifications bindd = SUPER, COMMA, Dismiss last notification, exec, makoctl dismiss bindd = SUPER SHIFT, COMMA, Dismiss all notifications, exec, makoctl dismiss --all -bindd = SUPER CTRL, COMMA, Toggle silencing notifications, exec, makoctl mode -t do-not-disturb && makoctl mode | grep -q 'do-not-disturb' && notify-send "Silenced notifications" || notify-send "Enabled notifications" +bindd = SUPER CTRL, COMMA, Toggle silencing notifications, exec, omarchy-toggle-notification-silencing bindd = SUPER ALT, COMMA, Invoke last notification, exec, makoctl invoke bindd = SUPER SHIFT ALT, COMMA, Restore last notification, exec, makoctl restore -# Toggle idling +# Toggles bindd = SUPER CTRL, I, Toggle locking on idle, exec, omarchy-toggle-idle - -# Toggle nightlight bindd = SUPER CTRL, N, Toggle nightlight, exec, omarchy-toggle-nightlight +bindd = SUPER CTRL, Backspace, Toggle monitor scaling, exec, omarchy-hyprland-monitor-scaling-toggle +bindd = SUPER CTRL ALT, Backspace, Toggle single-window square aspect, exec, omarchy-hyprland-window-single-square-aspect-toggle # Control Apple Display brightness -bindd = CTRL, F1, Apple Display brightness down, exec, omarchy-cmd-apple-display-brightness -5000 -bindd = CTRL, F2, Apple Display brightness up, exec, omarchy-cmd-apple-display-brightness +5000 -bindd = SHIFT CTRL, F2, Apple Display full brightness, exec, omarchy-cmd-apple-display-brightness +60000 +bindd = CTRL, F1, Apple Display brightness down, exec, omarchy-brightness-display-apple -5000 +bindd = CTRL, F2, Apple Display brightness up, exec, omarchy-brightness-display-apple +5000 +bindd = SHIFT CTRL, F2, Apple Display full brightness, exec, omarchy-brightness-display-apple +60000 # Captures -bindd = , PRINT, Screenshot with editing, exec, omarchy-cmd-screenshot -bindd = SHIFT, PRINT, Screenshot to clipboard, exec, omarchy-cmd-screenshot smart clipboard +bindd = , PRINT, Screenshot, exec, omarchy-cmd-screenshot bindd = ALT, PRINT, Screenrecording, exec, omarchy-menu screenrecord bindd = SUPER, PRINT, Color picker, exec, pkill hyprpicker || hyprpicker -a @@ -52,8 +52,11 @@ bindd = SUPER CTRL, W, Wifi controls, exec, omarchy-launch-wifi bindd = SUPER CTRL, T, Activity, exec, omarchy-launch-tui btop # Dictation -bindd = SUPER CTRL, X, Start dictation, exec, voxtype record start -binddr = SUPER CTRL, X, Stop dictation, exec, voxtype record stop +bindd = SUPER CTRL, X, Toggle dictation, exec, voxtype record toggle + +# Zoom +bindd = SUPER CTRL, Z, Zoom in, exec, hyprctl keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor -j | jq '.float + 1') +bindd = SUPER CTRL ALT, Z, Reset zoom, exec, hyprctl keyword cursor:zoom_factor 1 # Lock system bindd = SUPER CTRL, L, Lock system, exec, omarchy-lock-screen diff --git a/default/hypr/envs.conf b/default/hypr/envs.conf index 92d15446..85afc775 100644 --- a/default/hypr/envs.conf +++ b/default/hypr/envs.conf @@ -6,7 +6,7 @@ env = HYPRCURSOR_SIZE,24 env = GDK_BACKEND,wayland,x11,* env = QT_QPA_PLATFORM,wayland;xcb env = QT_STYLE_OVERRIDE,kvantum -env = SDL_VIDEODRIVER,wayland +env = SDL_VIDEODRIVER,wayland,x11 env = MOZ_ENABLE_WAYLAND,1 env = ELECTRON_OZONE_PLATFORM_HINT,wayland env = OZONE_PLATFORM,wayland diff --git a/default/hypr/looknfeel.conf b/default/hypr/looknfeel.conf index 0279074e..1decf433 100644 --- a/default/hypr/looknfeel.conf +++ b/default/hypr/looknfeel.conf @@ -129,11 +129,17 @@ misc { # https://wiki.hypr.land/Configuring/Variables/#cursor cursor { hide_on_key_press = true + warp_on_change_workspace = 1 +} + +# Auto toggle scratchpad on switching workspace from scratchpad +binds { + hide_special_on_workspace_change = true } # Style Gum confirm to match terminal theme env = GUM_CONFIRM_PROMPT_FOREGROUND,6 # Cyan env = GUM_CONFIRM_SELECTED_FOREGROUND,0 # Black env = GUM_CONFIRM_SELECTED_BACKGROUND,2 # Green -env = GUM_CONFIRM_UNSELECTED_FOREGROUND,0 # Black +env = GUM_CONFIRM_UNSELECTED_FOREGROUND,7 # White env = GUM_CONFIRM_UNSELECTED_BACKGROUND,8 # Dark grey diff --git a/default/hypr/plain-bindings.conf b/default/hypr/plain-bindings.conf new file mode 100644 index 00000000..81a47062 --- /dev/null +++ b/default/hypr/plain-bindings.conf @@ -0,0 +1,16 @@ +# Application bindings +bindd = SUPER, RETURN, Terminal, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" +bindd = SUPER SHIFT, RETURN, Browser, exec, omarchy-launch-browser +bindd = SUPER SHIFT, F, File manager, exec, uwsm-app -- nautilus --new-window +bindd = SUPER ALT SHIFT, F, File manager (cwd), exec, uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)" +bindd = SUPER SHIFT, B, Browser, exec, omarchy-launch-browser +bindd = SUPER SHIFT ALT, B, Browser (private), exec, omarchy-launch-browser --private +bindd = SUPER SHIFT, N, Editor, exec, omarchy-launch-editor + +# Add extra bindings +# bindd = SUPER SHIFT, A, ChatGPT, exec, omarchy-launch-webapp "https://chatgpt.com" +# bindd = SUPER SHIFT, R, exec, alacritty -e ssh your-server + +# Overwrite existing bindings, like putting Omarchy Menu on Super + Space +# unbind = SUPER, SPACE +# bindd = SUPER, SPACE, Omarchy menu, exec, omarchy-menu diff --git a/default/hypr/windows.conf b/default/hypr/windows.conf index 5d1afb76..67a9a6a9 100644 --- a/default/hypr/windows.conf +++ b/default/hypr/windows.conf @@ -2,11 +2,14 @@ # Hyprland 0.53+ syntax windowrule = suppress_event maximize, match:class .* -# Just dash of opacity by default -windowrule = opacity 0.97 0.9, match:class .* +# Tag all windows for default opacity (apps can override with -default-opacity tag) +windowrule = tag +default-opacity, match:class .* # Fix some dragging issues with XWayland windowrule = no_focus on, match:class ^$, match:title ^$, match:xwayland 1, match:float 1, match:fullscreen 0, match:pin 0 -# App-specific tweaks +# App-specific tweaks (may remove default-opacity tag) source = ~/.local/share/omarchy/default/hypr/apps.conf + +# Apply default opacity after apps have had a chance to opt out +windowrule = opacity 0.97 0.9, match:tag default-opacity diff --git a/default/limine/default.conf b/default/limine/default.conf index eb34057a..072b8bf3 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" ENABLE_UKI=yes CUSTOM_UKI_NAME="omarchy" diff --git a/default/mako/core.ini b/default/mako/core.ini index 0c9a46e8..203d4e8c 100644 --- a/default/mako/core.ini +++ b/default/mako/core.ini @@ -28,3 +28,7 @@ on-button-left=exec sh -c 'omarchy-notification-dismiss "Update System"; omarchy [summary~="Learn Keybindings"] on-button-left=exec sh -c 'omarchy-notification-dismiss "Learn Keybindings"; omarchy-menu-keybindings' + +[summary~="Screenshot copied & saved"] +max-icon-size=80 +format=%s\n%b diff --git a/default/omarchy-skill/SKILL.md b/default/omarchy-skill/SKILL.md index d8d85607..46c11e73 100644 --- a/default/omarchy-skill/SKILL.md +++ b/default/omarchy-skill/SKILL.md @@ -1,22 +1,26 @@ --- -name: Omarchy +name: omarchy description: > - REQUIRED for ANY changes to Linux desktop, window manager, or system config. + REQUIRED for end-user customization of Linux desktop, window manager, or system config. Use when editing ~/.config/hypr/, ~/.config/waybar/, ~/.config/walker/, ~/.config/alacritty/, ~/.config/kitty/, ~/.config/ghostty/, ~/.config/mako/, or ~/.config/omarchy/. Triggers: Hyprland, window rules, animations, keybindings, monitors, gaps, borders, blur, opacity, waybar, walker, terminal config, themes, wallpaper, night light, idle, lock screen, screenshots, layer rules, workspace - settings, display config, or any omarchy-* commands. + settings, display config, and user-facing omarchy commands. Excludes Omarchy + source development in ~/.local/share/omarchy/ and omarchy-dev-* workflows. --- # Omarchy Skill Manage [Omarchy](https://omarchy.org/) Linux systems - a beautiful, modern, opinionated Arch Linux distribution with Hyprland. +This skill is for end-user customization on installed systems. +It is not for contributing to Omarchy source code. + ## When This Skill MUST Be Used -**ALWAYS invoke this skill when the user's request involves ANY of these:** +**ALWAYS invoke this skill for end-user requests involving ANY of these:** - Editing ANY file in `~/.config/hypr/` (window rules, animations, keybindings, monitors, etc.) - Editing ANY file in `~/.config/waybar/`, `~/.config/walker/`, `~/.config/mako/` @@ -25,14 +29,16 @@ Manage [Omarchy](https://omarchy.org/) Linux systems - a beautiful, modern, opin - Window behavior, animations, opacity, blur, gaps, borders - Layer rules, workspace settings, display/monitor configuration - Themes, wallpapers, fonts, appearance changes -- Any `omarchy-*` command +- User-facing `omarchy-*` commands (`omarchy-theme-*`, `omarchy-refresh-*`, `omarchy-restart-*`, etc.) - Screenshots, screen recording, night light, idle behavior, lock screen **If you're about to edit a config file in ~/.config/ on this system, STOP and use this skill first.** +**Do NOT use this skill for Omarchy development tasks** (editing files in `~/.local/share/omarchy/`, creating migrations, or running `omarchy-dev-*` workflows). + ## Critical Safety Rules -**NEVER modify anything in `~/.local/share/omarchy/`** - but READING is safe and encouraged. +**For end-user customization tasks, NEVER modify anything in `~/.local/share/omarchy/`** - but READING is safe and encouraged. This directory contains Omarchy's source files managed by git. Any changes will be: - Lost on next `omarchy-update` @@ -60,6 +66,8 @@ This directory contains Omarchy's source files managed by git. Any changes will - `~/.config/omarchy/themes//` - Custom themes (must be real directories) - `~/.config/omarchy/hooks/` - Custom automation hooks +If the request is to develop Omarchy itself, this skill is out of scope. Follow repository development instructions instead of this skill. + ## System Architecture Omarchy is built on: @@ -301,8 +309,8 @@ omarchy-update # Full system update omarchy-version # Show Omarchy version omarchy-debug --no-sudo --print # Debug info (ALWAYS use these flags) omarchy-lock-screen # Lock screen -omarchy-cmd-shutdown # Shutdown -omarchy-cmd-reboot # Reboot +omarchy-system-shutdown # Shutdown +omarchy-system-reboot # Reboot ``` **IMPORTANT:** Always run `omarchy-debug` with `--no-sudo --print` flags to avoid interactive sudo prompts that will hang the terminal. @@ -336,26 +344,15 @@ When user requests system changes: 2. **Is it a config edit?** Edit in `~/.config/`, never `~/.local/share/omarchy/` 3. **Is it a theme customization?** Create a NEW custom theme directory 4. **Is it automation?** Use hooks in `~/.config/omarchy/hooks/` -5. **Is it a package install?** Use `yay` +5. **Is it a package install?** Use `omarchy-pkg-add` (or `omarchy-pkg-aur-add` for AUR-only packages) 6. **Unsure if command exists?** Search with `compgen -c | grep omarchy` -## Development (AI Agents) +## Out of Scope -When contributing to Omarchy itself (e.g., fixing bugs, adding features), migrations are used to apply changes to existing installations. - -### Creating Migrations - -```bash -# ALWAYS use --no-edit flag or you will get stuck -omarchy-dev-add-migration --no-edit -``` - -This creates a new migration file and outputs its path without opening an editor. The migration filename is based on the git commit timestamp. - -**Migration files** are shell scripts in `~/.local/share/omarchy/migrations/` that run once per system during `omarchy-update`. Use them for: -- Updating user configs with new defaults -- Installing new dependencies -- Running one-time setup tasks +This skill intentionally does not cover Omarchy source development. Do not use this skill for: +- Editing files in `~/.local/share/omarchy/` (`bin/`, `config/`, `default/`, `themes/`, `migrations/`, etc.) +- Creating or editing migrations +- Running `omarchy-dev-*` commands ## Example Requests diff --git a/default/pacman/mirrorlist-rc b/default/pacman/mirrorlist-rc new file mode 100644 index 00000000..0692a0a1 --- /dev/null +++ b/default/pacman/mirrorlist-rc @@ -0,0 +1 @@ +Server = https://rc-mirror.omarchy.org/$repo/os/$arch diff --git a/default/pacman/pacman-rc.conf b/default/pacman/pacman-rc.conf new file mode 100644 index 00000000..50d2e498 --- /dev/null +++ b/default/pacman/pacman-rc.conf @@ -0,0 +1,30 @@ +# See the pacman.conf(5) manpage for option and repository directives + +[options] +Color +ILoveCandy +VerbosePkgLists +HoldPkg = pacman glibc +Architecture = auto +CheckSpace +ParallelDownloads = 5 +DownloadUser = alpm + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Required DatabaseOptional +LocalFileSigLevel = Optional + +# pacman searches repositories in the order defined here +[core] +Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +[multilib] +Include = /etc/pacman.d/mirrorlist + +[omarchy] +SigLevel = Optional TrustAll +Server = https://pkgs.omarchy.org/edge/$arch diff --git a/default/sddm/omarchy/Main.qml b/default/sddm/omarchy/Main.qml new file mode 100644 index 00000000..93ecfb08 --- /dev/null +++ b/default/sddm/omarchy/Main.qml @@ -0,0 +1,98 @@ +import QtQuick 2.0 +import SddmComponents 2.0 + +Rectangle { + id: root + width: 640 + height: 480 + color: "#000000" + + property string currentUser: userModel.lastUser + property int sessionIndex: { + for (var i = 0; i < sessionModel.rowCount(); i++) { + var name = (sessionModel.data(sessionModel.index(i, 0), Qt.DisplayRole) || "").toString() + if (name.indexOf("uwsm") !== -1) + return i + } + return sessionModel.lastIndex + } + + Connections { + target: sddm + function onLoginFailed() { + errorMessage.text = "Login failed" + password.text = "" + password.focus = true + } + function onLoginSucceeded() { + errorMessage.text = "" + } + } + + Column { + anchors.centerIn: parent + spacing: root.height * 0.04 + width: parent.width + + Image { + source: "logo.svg" + width: root.width * 0.35 + height: Math.round(width * sourceSize.height / sourceSize.width) + fillMode: Image.PreserveAspectFit + anchors.horizontalCenter: parent.horizontalCenter + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter + spacing: root.width * 0.007 + + Text { + text: "\uf023" + color: "#ffffff" + font.family: "JetBrainsMono Nerd Font" + font.pixelSize: root.height * 0.025 + anchors.verticalCenter: parent.verticalCenter + } + + Rectangle { + width: root.width * 0.17 + height: root.height * 0.04 + color: "#000000" + border.color: "#ffffff" + border.width: 1 + + TextInput { + id: password + anchors.fill: parent + anchors.margins: root.height * 0.008 + verticalAlignment: TextInput.AlignVCenter + echoMode: TextInput.Password + font.family: "JetBrainsMono Nerd Font" + font.pixelSize: root.height * 0.02 + font.letterSpacing: root.height * 0.004 + passwordCharacter: "\u2022" + color: "#ffffff" + focus: true + + Keys.onPressed: { + if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { + sddm.login(root.currentUser, password.text, root.sessionIndex) + event.accepted = true + } + } + } + } + } + + Text { + id: errorMessage + text: "" + color: "#f7768e" + font.family: "JetBrainsMono Nerd Font" + font.pixelSize: root.height * 0.018 + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Component.onCompleted: password.forceActiveFocus() +} diff --git a/default/sddm/omarchy/logo.svg b/default/sddm/omarchy/logo.svg new file mode 100644 index 00000000..0853b047 --- /dev/null +++ b/default/sddm/omarchy/logo.svg @@ -0,0 +1 @@ + diff --git a/default/sddm/omarchy/metadata.desktop b/default/sddm/omarchy/metadata.desktop new file mode 100644 index 00000000..7d07c7e4 --- /dev/null +++ b/default/sddm/omarchy/metadata.desktop @@ -0,0 +1,6 @@ +[SddmGreeterTheme] +Name=Omarchy +Description=Minimal terminal-style login theme matching the Limine bootloader aesthetic +Author=Omarchy +Type=sddm-theme +Version=1.0 diff --git a/default/sddm/omarchy/theme.conf b/default/sddm/omarchy/theme.conf new file mode 100644 index 00000000..e94cbbd3 --- /dev/null +++ b/default/sddm/omarchy/theme.conf @@ -0,0 +1 @@ +[General] diff --git a/default/systemd/faster-shutdown.conf b/default/systemd/faster-shutdown.conf new file mode 100644 index 00000000..90dce4f6 --- /dev/null +++ b/default/systemd/faster-shutdown.conf @@ -0,0 +1,2 @@ +[Manager] +DefaultTimeoutStopSec=5s diff --git a/default/systemd/hibernate.conf b/default/systemd/hibernate.conf deleted file mode 100644 index b146ae9b..00000000 --- a/default/systemd/hibernate.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Sleep] -HibernateDelaySec=30min -HibernateOnACPower=no diff --git a/default/systemd/lid.conf b/default/systemd/lid.conf deleted file mode 100644 index c6ecbcb7..00000000 --- a/default/systemd/lid.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Login] -HandleLidSwitch=suspend-then-hibernate diff --git a/default/systemd/system-sleep/force-igpu b/default/systemd/system-sleep/force-igpu new file mode 100644 index 00000000..6f129438 --- /dev/null +++ b/default/systemd/system-sleep/force-igpu @@ -0,0 +1,29 @@ +#!/bin/bash + +# Use the Vfio to Integrated trick to turn off NVIDIA dgpu when in integrated mode +# without needing to restart the computer. This is needed because computers like the Asus G14 +# will wake after suspend in Hybrid mode, even if the system was in Integrated mode before +# suspending. + +case "$1" in + pre) + # Before hibernating, switch to Vfio so the nvidia driver is detached from the dGPU. + # Without this, hibernate resume fails because the nvidia driver can't freeze a + # powered-off dGPU (returns -EIO), which aborts the entire resume. + if [[ $2 == "hibernate" ]]; then + /usr/bin/supergfxctl -m Vfio + sleep 1 + fi + ;; + post) + # small delay so the device is fully re-enumerated + sleep 4 + + # force-bind dGPU to vfio (fully detached from nvidia) + /usr/bin/supergfxctl -m Vfio + sleep 1 + + # then go back to Integrated, which powers it off again + /usr/bin/supergfxctl -m Integrated + ;; +esac diff --git a/default/systemd/system-sleep/keyboard-backlight b/default/systemd/system-sleep/keyboard-backlight new file mode 100644 index 00000000..c6fbea1c --- /dev/null +++ b/default/systemd/system-sleep/keyboard-backlight @@ -0,0 +1,18 @@ +#!/bin/bash + +# Turn off keyboard backlight before hibernate to prevent hang on power-off. +# The ASUS keyboard controller can block S4 shutdown if LEDs are active. + +if [[ $1 == "pre" && $2 == "hibernate" ]]; then + device="" + for candidate in /sys/class/leds/*kbd_backlight*; do + if [[ -e "$candidate" ]]; then + device="$(basename "$candidate")" + break + fi + done + + if [[ -n "$device" ]]; then + brightnessctl -d "$device" set 0 >/dev/null 2>&1 + fi +fi diff --git a/default/systemd/system/supergfxd.service.d/delay-start.conf b/default/systemd/system/supergfxd.service.d/delay-start.conf new file mode 100644 index 00000000..19fc2986 --- /dev/null +++ b/default/systemd/system/supergfxd.service.d/delay-start.conf @@ -0,0 +1,6 @@ +[Service] +# Delay startup to avoid race condition with display manager initialization +# when booting in Integrated mode. Without this delay, the system can freeze +# on boot because supergfxd tries to disable the dGPU while the display +# subsystem is still initializing. +ExecStartPre=/bin/sleep 5 diff --git a/default/systemd/user@.service.d/faster-shutdown.conf b/default/systemd/user@.service.d/faster-shutdown.conf new file mode 100644 index 00000000..449242ce --- /dev/null +++ b/default/systemd/user@.service.d/faster-shutdown.conf @@ -0,0 +1,2 @@ +[Service] +TimeoutStopSec=5s diff --git a/default/themed/keyboard.rgb.tpl b/default/themed/keyboard.rgb.tpl new file mode 100644 index 00000000..bc9f35a2 --- /dev/null +++ b/default/themed/keyboard.rgb.tpl @@ -0,0 +1 @@ +{{ accent }} diff --git a/default/themed/obsidian.css.tpl b/default/themed/obsidian.css.tpl index 90b86244..e255b0e5 100644 --- a/default/themed/obsidian.css.tpl +++ b/default/themed/obsidian.css.tpl @@ -30,8 +30,8 @@ --interactive-accent-hover: {{ accent }}; /* Muted text */ - --text-muted: {{ color8 }}; - --text-faint: {{ color8 }}; + --text-muted: color-mix(in srgb, {{ foreground }} 70%, transparent); + --text-faint: color-mix(in srgb, {{ foreground }} 55%, transparent); /* Code */ --code-normal: {{ color6 }}; diff --git a/default/udev/framework16-qmk-hid.rules b/default/udev/framework16-qmk-hid.rules new file mode 100644 index 00000000..0100d7af --- /dev/null +++ b/default/udev/framework16-qmk-hid.rules @@ -0,0 +1 @@ +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", MODE="0660", TAG+="uaccess" diff --git a/default/walker/restart.conf b/default/walker/restart.conf new file mode 100644 index 00000000..57940311 --- /dev/null +++ b/default/walker/restart.conf @@ -0,0 +1,3 @@ +[Service] +Restart=always +RestartSec=2 diff --git a/default/waybar/indicators/idle.sh b/default/waybar/indicators/idle.sh new file mode 100755 index 00000000..ebb5f4f5 --- /dev/null +++ b/default/waybar/indicators/idle.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if pgrep -x hypridle >/dev/null; then + echo '{"text": ""}' +else + echo '{"text": "󱫖", "tooltip": "Idle lock disabled", "class": "active"}' +fi diff --git a/default/waybar/indicators/notification-silencing.sh b/default/waybar/indicators/notification-silencing.sh new file mode 100755 index 00000000..d5a68276 --- /dev/null +++ b/default/waybar/indicators/notification-silencing.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if makoctl mode | grep -q 'do-not-disturb'; then + echo '{"text": "󰂛", "tooltip": "Notifications silenced", "class": "active"}' +else + echo '{"text": ""}' +fi diff --git a/default/wireplumber/wireplumber.conf.d/alsa-soft-mixer.conf b/default/wireplumber/wireplumber.conf.d/alsa-soft-mixer.conf new file mode 100644 index 00000000..6fc1dbd9 --- /dev/null +++ b/default/wireplumber/wireplumber.conf.d/alsa-soft-mixer.conf @@ -0,0 +1,18 @@ +## Use software volume control for all ALSA devices. +## This prevents hardware mixer quirks (like muffled audio on Realtek codecs) +## and provides consistent volume behavior across all hardware. + +monitor.alsa.rules = [ + { + matches = [ + { + device.name = "~alsa_card.*" + } + ] + actions = { + update-props = { + api.alsa.soft-mixer = true + } + } + } +] diff --git a/install/config/all.sh b/install/config/all.sh index e40558b5..b80e4ca5 100644 --- a/install/config/all.sh +++ b/install/config/all.sh @@ -7,6 +7,7 @@ run_logged $OMARCHY_INSTALL/config/timezones.sh run_logged $OMARCHY_INSTALL/config/increase-sudo-tries.sh run_logged $OMARCHY_INSTALL/config/increase-lockout-limit.sh run_logged $OMARCHY_INSTALL/config/ssh-flakiness.sh +run_logged $OMARCHY_INSTALL/config/increase-file-watchers.sh run_logged $OMARCHY_INSTALL/config/detect-keyboard-layout.sh run_logged $OMARCHY_INSTALL/config/xcompose.sh run_logged $OMARCHY_INSTALL/config/mise-work.sh @@ -19,6 +20,9 @@ run_logged $OMARCHY_INSTALL/config/fast-shutdown.sh run_logged $OMARCHY_INSTALL/config/sudoless-asdcontrol.sh run_logged $OMARCHY_INSTALL/config/input-group.sh run_logged $OMARCHY_INSTALL/config/omarchy-ai-skill.sh +run_logged $OMARCHY_INSTALL/config/kernel-modules-hook.sh +run_logged $OMARCHY_INSTALL/config/powerprofilesctl-rules.sh +run_logged $OMARCHY_INSTALL/config/wifi-powersave-rules.sh run_logged $OMARCHY_INSTALL/config/hardware/network.sh run_logged $OMARCHY_INSTALL/config/hardware/set-wireless-regdom.sh run_logged $OMARCHY_INSTALL/config/hardware/fix-fkeys.sh @@ -27,9 +31,15 @@ run_logged $OMARCHY_INSTALL/config/hardware/printer.sh run_logged $OMARCHY_INSTALL/config/hardware/usb-autosuspend.sh run_logged $OMARCHY_INSTALL/config/hardware/ignore-power-button.sh run_logged $OMARCHY_INSTALL/config/hardware/nvidia.sh +run_logged $OMARCHY_INSTALL/config/hardware/vulkan.sh run_logged $OMARCHY_INSTALL/config/hardware/fix-f13-amd-audio-input.sh run_logged $OMARCHY_INSTALL/config/hardware/fix-bcm43xx.sh run_logged $OMARCHY_INSTALL/config/hardware/fix-apple-spi-keyboard.sh run_logged $OMARCHY_INSTALL/config/hardware/fix-apple-suspend-nvme.sh run_logged $OMARCHY_INSTALL/config/hardware/fix-apple-t2.sh run_logged $OMARCHY_INSTALL/config/hardware/fix-surface-keyboard.sh +run_logged $OMARCHY_INSTALL/config/hardware/fix-asus-rog-audio-mixer.sh +run_logged $OMARCHY_INSTALL/config/hardware/fix-asus-rog-mic.sh +run_logged $OMARCHY_INSTALL/config/hardware/fix-yt6801-ethernet-adapter.sh +run_logged $OMARCHY_INSTALL/config/hardware/fix-synaptic-touchpad.sh +run_logged $OMARCHY_INSTALL/config/hardware/framework16-qmk-hid.sh diff --git a/install/config/docker.sh b/install/config/docker.sh index 99096245..1499f9c8 100644 --- a/install/config/docker.sh +++ b/install/config/docker.sh @@ -16,8 +16,8 @@ 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 +# Start Docker on-demand +sudo systemctl enable docker.socket # Give this user privileged Docker access sudo usermod -aG docker ${USER} diff --git a/install/config/fast-shutdown.sh b/install/config/fast-shutdown.sh index bbbfafdc..c7cc7827 100644 --- a/install/config/fast-shutdown.sh +++ b/install/config/fast-shutdown.sh @@ -1,7 +1,5 @@ sudo mkdir -p /etc/systemd/system.conf.d - -cat </dev/null else echo "MODULES=(applespi intel_lpss_pci spi_pxa2xx_platform)" | sudo tee /etc/mkinitcpio.conf.d/macbook_spi_modules.conf >/dev/null diff --git a/install/config/hardware/fix-apple-suspend-nvme.sh b/install/config/hardware/fix-apple-suspend-nvme.sh index 35724112..863242a1 100644 --- a/install/config/hardware/fix-apple-suspend-nvme.sh +++ b/install/config/hardware/fix-apple-suspend-nvme.sh @@ -2,12 +2,12 @@ # This prevents NVMe drives from failing to wake from sleep properly MACBOOK_MODEL=$(cat /sys/class/dmi/id/product_name 2>/dev/null || true) -if [[ "$MACBOOK_MODEL" =~ MacBook(8,1|9,1|10,1)|MacBookPro13,[123]|MacBookPro14,[123] ]]; then +if [[ $MACBOOK_MODEL =~ MacBook(8,1|9,1|10,1)|MacBookPro13,[123]|MacBookPro14,[123] ]]; then echo "Detected MacBook model: $MACBOOK_MODEL" NVME_DEVICE="/sys/bus/pci/devices/0000:01:00.0/d3cold_allowed" - if [[ -f "$NVME_DEVICE" ]]; then + if [[ -f $NVME_DEVICE ]]; then echo "Applying NVMe suspend fix..." cat </dev/null diff --git a/install/config/hardware/fix-apple-t2.sh b/install/config/hardware/fix-apple-t2.sh index 40c6942b..19b44a8d 100644 --- a/install/config/hardware/fix-apple-t2.sh +++ b/install/config/hardware/fix-apple-t2.sh @@ -3,7 +3,7 @@ if lspci -nn | grep -q "106b:180[12]"; then echo "Detected MacBook with T2 chip. Installing support items..." - sudo pacman -S --noconfirm --needed \ + omarchy-pkg-add \ linux-t2 \ linux-t2-headers \ apple-t2-audio-config \ diff --git a/install/config/hardware/fix-asus-rog-audio-mixer.sh b/install/config/hardware/fix-asus-rog-audio-mixer.sh new file mode 100644 index 00000000..7380721f --- /dev/null +++ b/install/config/hardware/fix-asus-rog-audio-mixer.sh @@ -0,0 +1,13 @@ +# Fix audio volume on Asus ROG laptops by using a soft mixer. + +if omarchy-hw-asus-rog; then + mkdir -p ~/.config/wireplumber/wireplumber.conf.d/ + cp $OMARCHY_PATH/default/wireplumber/wireplumber.conf.d/alsa-soft-mixer.conf ~/.config/wireplumber/wireplumber.conf.d/ + rm -rf ~/.local/state/wireplumber/default-routes + + # Unmute the Master control on the ALC285 card (often muted by default) + card=$(aplay -l 2>/dev/null | grep -i "ALC285" | head -1 | sed 's/card \([0-9]*\).*/\1/') + if [[ -n $card ]]; then + amixer -c "$card" set Master 80% unmute 2>/dev/null + fi +fi diff --git a/install/config/hardware/fix-asus-rog-mic.sh b/install/config/hardware/fix-asus-rog-mic.sh new file mode 100644 index 00000000..c50a63f1 --- /dev/null +++ b/install/config/hardware/fix-asus-rog-mic.sh @@ -0,0 +1,15 @@ +# Fix internal mic gain on ASUS ROG laptops with Realtek ALC285. +# The mic boost is way too high by default, causing clipping. +# Sets levels and stores ALSA state so it persists across reboots. + +if omarchy-hw-asus-rog; then + for card in /proc/asound/card*/codec*; do + if grep -q "ALC285" "$card" 2>/dev/null; then + cardnum=$(echo "$card" | grep -oP 'card\K\d+') + amixer -c "$cardnum" set 'Internal Mic Boost' 0 >/dev/null 2>&1 || true + amixer -c "$cardnum" set 'Capture' 70% >/dev/null 2>&1 || true + sudo alsactl store "$cardnum" 2>/dev/null || true + break + fi + done +fi diff --git a/install/config/hardware/fix-bcm43xx.sh b/install/config/hardware/fix-bcm43xx.sh index 5078f69e..f6e0f18b 100644 --- a/install/config/hardware/fix-bcm43xx.sh +++ b/install/config/hardware/fix-bcm43xx.sh @@ -6,5 +6,5 @@ pci_info=$(lspci -nnv) if (echo "$pci_info" | grep -q "14e4:43a0" || echo "$pci_info" | grep -q "14e4:4331"); then echo "BCM4360 / BCM4331 detected" - sudo pacman -S --noconfirm --needed broadcom-wl dkms linux-headers + omarchy-pkg-add broadcom-wl dkms linux-headers fi diff --git a/install/config/hardware/fix-surface-keyboard.sh b/install/config/hardware/fix-surface-keyboard.sh index d68fe5ae..2211db62 100644 --- a/install/config/hardware/fix-surface-keyboard.sh +++ b/install/config/hardware/fix-surface-keyboard.sh @@ -1,18 +1,18 @@ # Detect Surface devices which require additional modules for the keyboard to work. # Module list derived from Chris McLeod's manual install instructions # https://chrismcleod.dev/blog/installing-arch-linux-with-secure-boot-on-a-microsoft-surface-laptop-studio/ -product_name="$(cat /sys/class/dmi/id/product_name 2>/dev/null)" -if [[ "$product_name" =~ Surface ]]; then +if omarchy-hw-surface; then + product_name="$(cat /sys/class/dmi/id/product_name 2>/dev/null)" echo "Detected Surface Device" # Modules already exist in the rootfs for the default kernel. - if [[ "$product_name" != "Surface Laptop 3" ]]; then + if [[ $product_name != "Surface Laptop 3" ]]; then echo "Untested Surface Device: $product_name, additional modules may be required for your device." fi echo "Attempting to autodetect required pinctrl module" pinctrl_module=$(lsmod | grep pinctrl_ | cut -f 1 -d" ") - if [[ -z "$pinctrl_module" ]]; then + if [[ -z $pinctrl_module ]]; then echo "Failed to autodetect pinctrl module." else echo "Detected pinctrl module: $pinctrl_module" diff --git a/install/config/hardware/fix-synaptic-touchpad.sh b/install/config/hardware/fix-synaptic-touchpad.sh new file mode 100644 index 00000000..cc726520 --- /dev/null +++ b/install/config/hardware/fix-synaptic-touchpad.sh @@ -0,0 +1,6 @@ +# Enable Synaptics InterTouch for confirmed touchpads if not already loaded + +if grep -qi synaptics /proc/bus/input/devices \ + && ! lsmod | grep -q '^psmouse'; then + modprobe psmouse synaptics_intertouch=1 +fi \ No newline at end of file diff --git a/install/config/hardware/fix-yt6801-ethernet-adapter.sh b/install/config/hardware/fix-yt6801-ethernet-adapter.sh new file mode 100644 index 00000000..34331a0f --- /dev/null +++ b/install/config/hardware/fix-yt6801-ethernet-adapter.sh @@ -0,0 +1,4 @@ +# Install drivers for Motorcomm YT6801 ethernet adapter used by the Slimbook Executive +if lspci | grep -i "YT6801\|Motorcomm.*Ethernet"; then + omarchy-pkg-add linux-headers yt6801-dkms +fi diff --git a/install/config/hardware/framework16-qmk-hid.sh b/install/config/hardware/framework16-qmk-hid.sh new file mode 100644 index 00000000..5fb46847 --- /dev/null +++ b/install/config/hardware/framework16-qmk-hid.sh @@ -0,0 +1,9 @@ +# Allow unprivileged access to the Framework 16 keyboard for RGB control via qmk_hid. + +if omarchy-hw-framework16; then + if [[ ! -f /etc/udev/rules.d/50-framework16-qmk-hid.rules ]]; then + sudo cp "$OMARCHY_PATH/default/udev/framework16-qmk-hid.rules" /etc/udev/rules.d/50-framework16-qmk-hid.rules + sudo udevadm control --reload-rules + sudo udevadm trigger + fi +fi diff --git a/install/config/hardware/intel.sh b/install/config/hardware/intel.sh index 546fe477..f1c375d7 100644 --- a/install/config/hardware/intel.sh +++ b/install/config/hardware/intel.sh @@ -2,10 +2,10 @@ # Check if we have an Intel GPU at all if INTEL_GPU=$(lspci | grep -iE 'vga|3d|display' | grep -i 'intel'); then # HD Graphics and newer uses intel-media-driver - if [[ "${INTEL_GPU,,}" =~ "hd graphics"|"xe"|"iris" ]]; then - sudo pacman -S --needed --noconfirm intel-media-driver - elif [[ "${INTEL_GPU,,}" =~ "gma" ]]; then + if [[ ${INTEL_GPU,,} =~ "hd graphics"|"xe"|"iris" ]]; then + omarchy-pkg-add intel-media-driver + elif [[ ${INTEL_GPU,,} =~ "gma" ]]; then # Older generations from 2008 to ~2014-2017 use libva-intel-driver - sudo pacman -S --needed --noconfirm libva-intel-driver + omarchy-pkg-add libva-intel-driver fi fi diff --git a/install/config/hardware/nvidia.sh b/install/config/hardware/nvidia.sh index d159dd6c..5fb37232 100644 --- a/install/config/hardware/nvidia.sh +++ b/install/config/hardware/nvidia.sh @@ -1,18 +1,20 @@ NVIDIA="$(lspci | grep -i 'nvidia')" -if [ -n "$NVIDIA" ]; then +if [[ -n $NVIDIA ]]; then # Check which kernel is installed and set appropriate headers package KERNEL_HEADERS="$(pacman -Qqs '^linux(-zen|-lts|-hardened)?$' | head -1)-headers" - if echo "$NVIDIA" | grep -qE "RTX [2-9][0-9]|GTX 16"; then - # Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules + # Turing+ (GTX 16xx, RTX 20xx-50xx, RTX Pro, Quadro RTX, datacenter A/H/T/L series) have GSP firmware + if echo "$NVIDIA" | grep -qE "GTX 16[0-9]{2}|RTX [2-5][0-9]{3}|RTX PRO [0-9]{4}|Quadro RTX|RTX A[0-9]{4}|A[1-9][0-9]{2}|H[1-9][0-9]{2}|T4|L[0-9]+"; then PACKAGES=(nvidia-open-dkms nvidia-utils lib32-nvidia-utils libva-nvidia-driver) - elif echo "$NVIDIA" | grep -qE "GTX 9|GTX 10|Quadro P|MX1|MX2|MX3"; then - # Pascal (10xx, Quadro Pxxx, MX150, MX2xx, and MX3xx) and Maxwell (9xx, MX110, and MX130) use legacy branch that can only be installed from AUR + GPU_ARCH="turing_plus" + # Maxwell (GTX 9xx), Pascal (GT/GTX 10xx, Quadro P, MX series), Volta (Titan V, Tesla V100, Quadro GV100) lack GSP + elif echo "$NVIDIA" | grep -qE "GTX (9[0-9]{2}|10[0-9]{2})|GT 10[0-9]{2}|Quadro [PM][0-9]{3,4}|Quadro GV100|MX *[0-9]+|Titan (X|Xp|V)|Tesla V100"; then PACKAGES=(nvidia-580xx-dkms nvidia-580xx-utils lib32-nvidia-580xx-utils) + GPU_ARCH="maxwell_pascal_volta" fi # Bail if no supported GPU - if [ -z "${PACKAGES+x}" ]; then + if [[ -z ${PACKAGES+x} ]]; then echo "No compatible driver for your NVIDIA GPU. See: https://wiki.archlinux.org/title/NVIDIA" exit 0 fi @@ -29,12 +31,23 @@ EOF MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm) EOF - # Add NVIDIA environment variables - cat >>$HOME/.config/hypr/envs.conf <<'EOF' + # Add NVIDIA environment variables based on GPU architecture + if [[ $GPU_ARCH = "turing_plus" ]]; then + # Turing+ (RTX 20xx, GTX 16xx, and newer) with GSP firmware support + cat >>"$HOME/.config/hypr/envs.conf" <<'EOF' -# NVIDIA +# NVIDIA (Turing+ with GSP firmware) env = NVD_BACKEND,direct env = LIBVA_DRIVER_NAME,nvidia env = __GLX_VENDOR_LIBRARY_NAME,nvidia EOF + elif [[ $GPU_ARCH = "maxwell_pascal_volta" ]]; then + # Maxwell/Pascal/Volta (GTX 9xx/10xx, GT 10xx, Quadro P/M/GV, MX series, Titan X/Xp/V) lack GSP firmware + cat >>"$HOME/.config/hypr/envs.conf" <<'EOF' + +# NVIDIA (Maxwell/Pascal/Volta without GSP firmware) +env = NVD_BACKEND,egl +env = __GLX_VENDOR_LIBRARY_NAME,nvidia +EOF + fi fi diff --git a/install/config/hardware/set-wireless-regdom.sh b/install/config/hardware/set-wireless-regdom.sh index 8f28407f..8524f2d3 100644 --- a/install/config/hardware/set-wireless-regdom.sh +++ b/install/config/hardware/set-wireless-regdom.sh @@ -1,13 +1,13 @@ # First check that wireless-regdb is there -if [ -f "/etc/conf.d/wireless-regdom" ]; then +if [[ -f "/etc/conf.d/wireless-regdom" ]]; then unset WIRELESS_REGDOM . /etc/conf.d/wireless-regdom fi # If the region is already set, we're done -if [ ! -n "${WIRELESS_REGDOM}" ]; then +if [[ ! -n ${WIRELESS_REGDOM} ]]; then # Get the current timezone - if [ -e "/etc/localtime" ]; then + if [[ -e "/etc/localtime" ]]; then TIMEZONE=$(readlink -f /etc/localtime) TIMEZONE=${TIMEZONE#/usr/share/zoneinfo/} @@ -15,12 +15,12 @@ if [ ! -n "${WIRELESS_REGDOM}" ]; then COUNTRY="${TIMEZONE%%/*}" # If we don't have a two letter country, get it from the timezone table - if [[ ! "$COUNTRY" =~ ^[A-Z]{2}$ ]] && [ -f "/usr/share/zoneinfo/zone.tab" ]; then + if [[ ! $COUNTRY =~ ^[A-Z]{2}$ ]] && [[ -f /usr/share/zoneinfo/zone.tab ]]; then COUNTRY=$(awk -v tz="$TIMEZONE" '$3 == tz {print $1; exit}' /usr/share/zoneinfo/zone.tab) fi # Check if we have a two letter country code - if [[ "$COUNTRY" =~ ^[A-Z]{2}$ ]]; then + if [[ $COUNTRY =~ ^[A-Z]{2}$ ]]; then # Append it to the wireless-regdom conf file that is used at boot echo "WIRELESS_REGDOM=\"$COUNTRY\"" | sudo tee -a /etc/conf.d/wireless-regdom >/dev/null diff --git a/install/config/hardware/vulkan.sh b/install/config/hardware/vulkan.sh new file mode 100644 index 00000000..a2447d46 --- /dev/null +++ b/install/config/hardware/vulkan.sh @@ -0,0 +1,20 @@ +# Install Vulkan drivers matching detected GPU hardware +# (NVIDIA Vulkan is handled by nvidia.sh via nvidia-utils) + +declare -A VULKAN_DRIVERS=( + [Intel]=vulkan-intel + [AMD]=vulkan-radeon + [Apple]=vulkan-asahi +) + +PACKAGES=() + +for vendor in "${!VULKAN_DRIVERS[@]}"; do + if lspci | grep -iE "(VGA|Display).*$vendor" > /dev/null; then + PACKAGES+=("${VULKAN_DRIVERS[$vendor]}") + fi +done + +if (( ${#PACKAGES[@]} > 0 )); then + omarchy-pkg-add "${PACKAGES[@]}" +fi diff --git a/install/config/increase-file-watchers.sh b/install/config/increase-file-watchers.sh new file mode 100644 index 00000000..a6be761a --- /dev/null +++ b/install/config/increase-file-watchers.sh @@ -0,0 +1,3 @@ +# Increase inotify file watchers for VS Code, webpack, and other dev tools (default 8192 is too low) +echo "fs.inotify.max_user_watches=524288" | sudo tee /etc/sysctl.d/90-omarchy-file-watchers.conf >/dev/null +sudo sysctl --system >/dev/null 2>&1 diff --git a/install/config/kernel-modules-hook.sh b/install/config/kernel-modules-hook.sh new file mode 100644 index 00000000..29d0ec4d --- /dev/null +++ b/install/config/kernel-modules-hook.sh @@ -0,0 +1 @@ +chrootable_systemctl_enable linux-modules-cleanup.service diff --git a/install/config/mimetypes.sh b/install/config/mimetypes.sh index ea8e1aff..4d7a32bf 100644 --- a/install/config/mimetypes.sh +++ b/install/config/mimetypes.sh @@ -1,6 +1,9 @@ omarchy-refresh-applications update-desktop-database ~/.local/share/applications +# Open directories in file manager +xdg-mime default org.gnome.Nautilus.desktop inode/directory + # Open all images with imv xdg-mime default imv.desktop image/png xdg-mime default imv.desktop image/jpeg diff --git a/install/config/mise-work.sh b/install/config/mise-work.sh index 532ad350..e919dee9 100644 --- a/install/config/mise-work.sh +++ b/install/config/mise-work.sh @@ -10,7 +10,7 @@ EOF mise trust ~/Work/.mise.toml -if [[ -n "${OMARCHY_CHROOT_INSTALL:-}" ]]; then +if [[ -n ${OMARCHY_CHROOT_INSTALL:-} ]]; then NODE_TARBALL=$(find /opt/packages -name "node-v*-linux-x64.tar.gz" -type f 2>/dev/null | head -n1) NODE_VERSION=$(basename "$NODE_TARBALL" | sed 's/node-v\(.*\)-linux-x64.tar.gz/\1/') diff --git a/install/config/powerprofilesctl-rules.sh b/install/config/powerprofilesctl-rules.sh new file mode 100644 index 00000000..3ff3a5b9 --- /dev/null +++ b/install/config/powerprofilesctl-rules.sh @@ -0,0 +1,22 @@ +if omarchy-battery-present; then + mapfile -t profiles < <(omarchy-powerprofiles-list) + + if (( ${#profiles[@]} > 1 )); then + + # Default AC profile: + # 3 profiles → performance + # 2 profiles → balanced + ac_profile="${profiles[2]:-${profiles[1]}}" + + # Default Battery profile (balanced) + battery_profile="${profiles[1]}" + + cat < /dev/null << EOF @@ -23,3 +27,4 @@ EOF # Link the visual theme menu config 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 diff --git a/install/config/wifi-powersave-rules.sh b/install/config/wifi-powersave-rules.sh new file mode 100644 index 00000000..08b8d49b --- /dev/null +++ b/install/config/wifi-powersave-rules.sh @@ -0,0 +1,9 @@ +if omarchy-battery-present; then + cat </dev/null </dev/null; then - # This computer runs on a battery +if omarchy-battery-present; then powerprofilesctl set balanced || true # Enable battery monitoring timer for low battery notifications systemctl --user enable --now omarchy-battery-monitor.timer else - # This computer runs on power outlet powerprofilesctl set performance || true fi diff --git a/install/helpers/chroot.sh b/install/helpers/chroot.sh index ab61972e..b9541972 100644 --- a/install/helpers/chroot.sh +++ b/install/helpers/chroot.sh @@ -1,6 +1,6 @@ # Starting the installer with OMARCHY_CHROOT_INSTALL=1 will put it into chroot mode chrootable_systemctl_enable() { - if [ -n "${OMARCHY_CHROOT_INSTALL:-}" ]; then + if [[ -n ${OMARCHY_CHROOT_INSTALL:-} ]]; then sudo systemctl enable $1 else sudo systemctl enable --now $1 diff --git a/install/helpers/errors.sh b/install/helpers/errors.sh index 2b63409b..d6683917 100644 --- a/install/helpers/errors.sh +++ b/install/helpers/errors.sh @@ -4,11 +4,11 @@ QR_CODE=' █ ███ █ ▄▄▄▄▀▄▀▄▀ █ ███ █ █ ▀▀▀ █ ▄█ ▄█▄▄▀ █ ▀▀▀ █ ▀▀▀▀▀▀▀ ▀▄█ █ █ █ ▀▀▀▀▀▀▀ -▀▀█▀▀▄▀▀▀▀▄█▀▀█ ▀ █ ▀ █ +▀▀█▀▀▄▀▀▀▀▄█▀▀█ ▀ █ ▀ █ █▄█ ▄▄▀▄▄ ▀ ▄ ▀█▄▄▄▄ ▀ ▀█ ▄ ▄▀█ ▀▄▀▀▀▄ ▄█▀▄█▀▄▀▄▀█▀ █ ▄▄█▄▀▄█ ▄▄▄ ▀ ▄▀██▀ ▀█ -▀ ▀ ▀ █ ▀▄ ▀▀█▀▀▀█▄▀ +▀ ▀ ▀ █ ▀▄ ▀▀█▀▀▀█▄▀ █▀▀▀▀▀█ ▀█ ▄▀▀ █ ▀ █▄▀██ █ ███ █ █▀▄▄▀ █▀███▀█▄██▄ █ ▀▀▀ █ ██ ▀ █▄█ ▄▄▄█▀ █ @@ -25,7 +25,7 @@ show_cursor() { # Display truncated log lines from the install log show_log_tail() { if [[ -f $OMARCHY_INSTALL_LOG_FILE ]]; then - local log_lines=$(($TERM_HEIGHT - $LOGO_HEIGHT - 35)) + local log_lines=$((TERM_HEIGHT - LOGO_HEIGHT - 35)) local max_line_width=$((LOGO_WIDTH - 4)) tail -n $log_lines "$OMARCHY_INSTALL_LOG_FILE" | while IFS= read -r line; do @@ -67,7 +67,7 @@ save_original_outputs() { # Restore stdout and stderr to original (saved in FD 3 and 4) # This ensures output goes to screen, not log file restore_outputs() { - if [ -e /proc/self/fd/3 ] && [ -e /proc/self/fd/4 ]; then + if [[ -e /proc/self/fd/3 ]] && [[ -e /proc/self/fd/4 ]]; then exec 1>&3 2>&4 fi } @@ -75,7 +75,7 @@ restore_outputs() { # Error handler catch_errors() { # Prevent recursive error handling - if [[ $ERROR_HANDLING == true ]]; then + if [[ $ERROR_HANDLING == "true" ]]; then return else ERROR_HANDLING=true @@ -133,7 +133,7 @@ catch_errors() { fi ;; "Upload log for support") - omarchy-upload-install-log + omarchy-upload-log ;; "Exit" | "") exit 1 @@ -147,7 +147,7 @@ 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 + if (( exit_code != 0 )) && [[ $ERROR_HANDLING != "true" ]]; then catch_errors else stop_log_output diff --git a/install/helpers/logging.sh b/install/helpers/logging.sh index 4ebe2a9e..88693657 100644 --- a/install/helpers/logging.sh +++ b/install/helpers/logging.sh @@ -24,12 +24,12 @@ start_log_output() { line="${current_lines[i]:-}" # Truncate if needed - if [ ${#line} -gt $max_line_width ]; then + if (( ${#line} > max_line_width )); then line="${line:0:$max_line_width}..." fi # Add clear line escape and formatted output for each line - if [ -n "$line" ]; then + if [[ -n $line ]]; then output+="${ANSI_CLEAR_LINE}${ANSI_GRAY}${PADDING_LEFT_SPACES} → ${line}${ANSI_RESET}\n" else output+="${ANSI_CLEAR_LINE}${PADDING_LEFT_SPACES}\n" @@ -45,7 +45,7 @@ start_log_output() { } stop_log_output() { - if [ -n "${monitor_pid:-}" ]; then + if [[ -n ${monitor_pid:-} ]]; then kill $monitor_pid 2>/dev/null || true wait $monitor_pid 2>/dev/null || true unset monitor_pid @@ -72,11 +72,11 @@ stop_install_log() { echo "" >>"$OMARCHY_INSTALL_LOG_FILE" echo "=== Installation Time Summary ===" >>"$OMARCHY_INSTALL_LOG_FILE" - if [ -f "/var/log/archinstall/install.log" ]; then + if [[ -f "/var/log/archinstall/install.log" ]]; then ARCHINSTALL_START=$(grep -m1 '^\[' /var/log/archinstall/install.log 2>/dev/null | sed 's/^\[\([^]]*\)\].*/\1/' || true) ARCHINSTALL_END=$(grep 'Installation completed without any errors' /var/log/archinstall/install.log 2>/dev/null | sed 's/^\[\([^]]*\)\].*/\1/' || true) - if [ -n "$ARCHINSTALL_START" ] && [ -n "$ARCHINSTALL_END" ]; then + if [[ -n $ARCHINSTALL_START ]] && [[ -n $ARCHINSTALL_END ]]; then ARCH_START_EPOCH=$(date -d "$ARCHINSTALL_START" +%s) ARCH_END_EPOCH=$(date -d "$ARCHINSTALL_END" +%s) ARCH_DURATION=$((ARCH_END_EPOCH - ARCH_START_EPOCH)) @@ -88,7 +88,7 @@ stop_install_log() { fi fi - if [ -n "$OMARCHY_START_TIME" ]; then + if [[ -n $OMARCHY_START_TIME ]]; then OMARCHY_START_EPOCH=$(date -d "$OMARCHY_START_TIME" +%s) OMARCHY_END_EPOCH=$(date -d "$OMARCHY_END_TIME" +%s) OMARCHY_DURATION=$((OMARCHY_END_EPOCH - OMARCHY_START_EPOCH)) @@ -98,7 +98,7 @@ stop_install_log() { echo "Omarchy: ${OMARCHY_MINS}m ${OMARCHY_SECS}s" >>"$OMARCHY_INSTALL_LOG_FILE" - if [ -n "$ARCH_DURATION" ]; then + if [[ -n $ARCH_DURATION ]]; then TOTAL_DURATION=$((ARCH_DURATION + OMARCHY_DURATION)) TOTAL_MINS=$((TOTAL_DURATION / 60)) TOTAL_SECS=$((TOTAL_DURATION % 60)) @@ -123,7 +123,7 @@ run_logged() { local exit_code=$? - if [ $exit_code -eq 0 ]; then + if (( exit_code == 0 )); then echo "[$(date '+%Y-%m-%d %H:%M:%S')] Completed: $script" >>"$OMARCHY_INSTALL_LOG_FILE" unset CURRENT_SCRIPT else diff --git a/install/helpers/presentation.sh b/install/helpers/presentation.sh index 70cab2e9..3f4c0656 100644 --- a/install/helpers/presentation.sh +++ b/install/helpers/presentation.sh @@ -1,13 +1,13 @@ # Ensure we have gum available if ! command -v gum &>/dev/null; then - sudo pacman -S --needed --noconfirm gum + omarchy-pkg-add gum fi # Get terminal size from /dev/tty (works in all scenarios: direct, sourced, or piped) -if [ -e /dev/tty ]; then +if [[ -e /dev/tty ]]; then TERM_SIZE=$(stty size 2>/dev/null max) max = length } END { print max+0 }' "$LOGO_PATH" 2>/dev/null || echo 0) export LOGO_HEIGHT=$(wc -l <"$LOGO_PATH" 2>/dev/null || echo 0) -export PADDING_LEFT=$((($TERM_WIDTH - $LOGO_WIDTH) / 2)) +export PADDING_LEFT=$(((TERM_WIDTH - LOGO_WIDTH) / 2)) export PADDING_LEFT_SPACES=$(printf "%*s" $PADDING_LEFT "") # Tokyo Night theme for gum confirm diff --git a/install/login/default-keyring.sh b/install/login/default-keyring.sh index 134fefb6..459a0cb4 100644 --- a/install/login/default-keyring.sh +++ b/install/login/default-keyring.sh @@ -2,9 +2,9 @@ KEYRING_DIR="$HOME/.local/share/keyrings" KEYRING_FILE="$KEYRING_DIR/Default_keyring.keyring" DEFAULT_FILE="$KEYRING_DIR/default" -mkdir -p $KEYRING_DIR +mkdir -p "$KEYRING_DIR" -cat << EOF | tee "$KEYRING_FILE" +cat << EOF > "$KEYRING_FILE" [keyring] display-name=Default keyring ctime=$(date +%s) @@ -13,7 +13,7 @@ lock-on-idle=false lock-after=false EOF -cat << EOF | tee "$DEFAULT_FILE" +cat << EOF > "$DEFAULT_FILE" Default_keyring EOF diff --git a/install/login/limine-snapper.sh b/install/login/limine-snapper.sh index a2a49637..734e2c48 100644 --- a/install/login/limine-snapper.sh +++ b/install/login/limine-snapper.sh @@ -38,14 +38,13 @@ EOF fi # Remove the original config file if it's not /boot/limine.conf - if [[ "$limine_config" != "/boot/limine.conf" ]] && [[ -f "$limine_config" ]]; then + if [[ $limine_config != "/boot/limine.conf" ]] && [[ -f $limine_config ]]; then sudo rm "$limine_config" fi # We overwrite the whole thing knowing the limine-update will add the entries for us sudo cp $OMARCHY_PATH/default/limine/limine.conf /boot/limine.conf - # Match Snapper configs if not installing from the ISO if [[ -z ${OMARCHY_CHROOT_INSTALL:-} ]]; then if ! sudo snapper list-configs 2>/dev/null | grep -q "root"; then @@ -73,11 +72,11 @@ fi echo "Re-enabling mkinitcpio hooks..." # Restore the specific mkinitcpio pacman hooks -if [ -f /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled ]; then +if [[ -f /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled ]]; then sudo mv /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled /usr/share/libalpm/hooks/90-mkinitcpio-install.hook fi -if [ -f /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled ]; then +if [[ -f /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled ]]; then sudo mv /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook fi @@ -85,25 +84,15 @@ echo "mkinitcpio hooks re-enabled" sudo limine-update +# Verify that limine-update actually added boot entries +if ! grep -q "^/+" /boot/limine.conf; then + echo "Error: limine-update failed to add boot entries to /boot/limine.conf" >&2 + exit 1 +fi + if [[ -n $EFI ]] && efibootmgr &>/dev/null; then - # Remove the archinstall-created Limine entry + # Remove the archinstall-created Limine entry while IFS= read -r bootnum; do sudo efibootmgr -b "$bootnum" -B >/dev/null 2>&1 done < <(efibootmgr | grep -E "^Boot[0-9]{4}\*? Arch Linux Limine" | sed 's/^Boot\([0-9]\{4\}\).*/\1/') fi - -# Move this to a utility to allow manual activation -# if [[ -n $EFI ]] && efibootmgr &>/dev/null && -# ! cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "American Megatrends" && -# ! cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "Apple"; then -# -# uki_file=$(find /boot/EFI/Linux/ -name "omarchy*.efi" -printf "%f\n" 2>/dev/null | head -1) -# -# if [[ -n "$uki_file" ]]; then -# sudo efibootmgr --create \ -# --disk "$(findmnt -n -o SOURCE /boot | sed 's/p\?[0-9]*$//')" \ -# --part "$(findmnt -n -o SOURCE /boot | grep -o 'p\?[0-9]*$' | sed 's/^p//')" \ -# --label "Omarchy" \ -# --loader "\\EFI\\Linux\\$uki_file" -# fi -# fi diff --git a/install/login/plymouth.sh b/install/login/plymouth.sh index fad64fe2..291c47ab 100644 --- a/install/login/plymouth.sh +++ b/install/login/plymouth.sh @@ -1,4 +1,4 @@ -if [ "$(plymouth-set-default-theme)" != "omarchy" ]; then +if [[ $(plymouth-set-default-theme) != "omarchy" ]]; then sudo cp -r "$HOME/.local/share/omarchy/default/plymouth" /usr/share/plymouth/themes/omarchy/ sudo plymouth-set-default-theme omarchy fi diff --git a/install/login/sddm.sh b/install/login/sddm.sh index 0098387e..a0366b3b 100644 --- a/install/login/sddm.sh +++ b/install/login/sddm.sh @@ -1,15 +1,23 @@ -sudo mkdir -p /etc/sddm.conf.d +# Install omarchy SDDM theme +omarchy-refresh-sddm -if [ ! -f /etc/sddm.conf.d/autologin.conf ]; then +# Setup SDDM login service +sudo mkdir -p /etc/sddm.conf.d +if [[ ! -f /etc/sddm.conf.d/autologin.conf ]]; then cat </dev/null; then echo TOTAL_TIME=$(tail -n 20 "$OMARCHY_INSTALL_LOG_FILE" | grep "^Total:" | sed 's/^Total:[[:space:]]*//') - if [ -n "$TOTAL_TIME" ]; then + if [[ -n $TOTAL_TIME ]]; then echo_in_style "Installed in $TOTAL_TIME" fi else @@ -29,7 +29,7 @@ if gum confirm --padding "0 0 0 $((PADDING_LEFT + 32))" --show-help=false --defa # Clear screen to hide any shutdown messages clear - if [[ -n "${OMARCHY_CHROOT_INSTALL:-}" ]]; then + if [[ -n ${OMARCHY_CHROOT_INSTALL:-} ]]; then touch /var/tmp/omarchy-install-completed exit 0 else diff --git a/install/post-install/hibernation.sh b/install/post-install/hibernation.sh new file mode 100644 index 00000000..17628ead --- /dev/null +++ b/install/post-install/hibernation.sh @@ -0,0 +1,2 @@ +# Enable hibernation +omarchy-hibernation-setup --force diff --git a/install/post-install/pacman.sh b/install/post-install/pacman.sh index 05ed163c..9d5747bc 100644 --- a/install/post-install/pacman.sh +++ b/install/post-install/pacman.sh @@ -1,12 +1,6 @@ # Configure pacman - -if [[ ${OMARCHY_MIRROR:-} == "edge" ]] ; then - sudo cp -f ~/.local/share/omarchy/default/pacman/pacman-edge.conf /etc/pacman.conf - sudo cp -f ~/.local/share/omarchy/default/pacman/mirrorlist-edge /etc/pacman.d/mirrorlist -else - sudo cp -f ~/.local/share/omarchy/default/pacman/pacman-stable.conf /etc/pacman.conf - sudo cp -f ~/.local/share/omarchy/default/pacman/mirrorlist-stable /etc/pacman.d/mirrorlist -fi +sudo cp -f ~/.local/share/omarchy/default/pacman/pacman-${OMARCHY_MIRROR:-stable}.conf /etc/pacman.conf +sudo cp -f ~/.local/share/omarchy/default/pacman/mirrorlist-${OMARCHY_MIRROR:-stable} /etc/pacman.d/mirrorlist if lspci -nn | grep -q "106b:180[12]"; then cat </dev/null diff --git a/install/preflight/disable-mkinitcpio.sh b/install/preflight/disable-mkinitcpio.sh index a1979c86..731816e8 100644 --- a/install/preflight/disable-mkinitcpio.sh +++ b/install/preflight/disable-mkinitcpio.sh @@ -4,11 +4,11 @@ echo "Temporarily disabling mkinitcpio hooks during installation..." # Move the specific mkinitcpio pacman hooks out of the way if they exist -if [ -f /usr/share/libalpm/hooks/90-mkinitcpio-install.hook ]; then +if [[ -f /usr/share/libalpm/hooks/90-mkinitcpio-install.hook ]]; then sudo mv /usr/share/libalpm/hooks/90-mkinitcpio-install.hook /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled fi -if [ -f /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook ]; then +if [[ -f /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook ]]; then sudo mv /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled fi diff --git a/install/preflight/guard.sh b/install/preflight/guard.sh index da312023..782614fd 100644 --- a/install/preflight/guard.sh +++ b/install/preflight/guard.sh @@ -11,18 +11,18 @@ fi # Must not be an Arch derivative distro for marker in /etc/cachyos-release /etc/eos-release /etc/garuda-release /etc/manjaro-release; do - if [[ -f "$marker" ]]; then + if [[ -f $marker ]]; then abort "Vanilla Arch" fi done # Must not be running as root -if [ "$EUID" -eq 0 ]; then +if (( EUID == 0 )); then abort "Running as root (not user)" fi # Must be x86 only to fully work -if [ "$(uname -m)" != "x86_64" ]; then +if [[ $(uname -m) != "x86_64" ]]; then abort "x86_64 CPU" fi @@ -40,7 +40,7 @@ fi command -v limine &>/dev/null || abort "Limine bootloader" # Must have btrfs root filesystem -[ "$(findmnt -n -o FSTYPE /)" = "btrfs" ] || abort "Btrfs root filesystem" +[[ $(findmnt -n -o FSTYPE /) = "btrfs" ]] || abort "Btrfs root filesystem" # Cleared all guards echo "Guards: OK" diff --git a/install/preflight/pacman.sh b/install/preflight/pacman.sh index adf6d4e5..c37d828d 100644 --- a/install/preflight/pacman.sh +++ b/install/preflight/pacman.sh @@ -1,23 +1,17 @@ if [[ -n ${OMARCHY_ONLINE_INSTALL:-} ]]; then # Install build tools - sudo pacman -S --needed --noconfirm base-devel + omarchy-pkg-add base-devel # Configure pacman - if [[ ${OMARCHY_MIRROR:-} == "edge" ]] ; then - sudo cp -f ~/.local/share/omarchy/default/pacman/pacman-edge.conf /etc/pacman.conf - sudo cp -f ~/.local/share/omarchy/default/pacman/mirrorlist-edge /etc/pacman.d/mirrorlist - else - sudo cp -f ~/.local/share/omarchy/default/pacman/pacman-stable.conf /etc/pacman.conf - sudo cp -f ~/.local/share/omarchy/default/pacman/mirrorlist-stable /etc/pacman.d/mirrorlist - fi + sudo cp -f ~/.local/share/omarchy/default/pacman/pacman-${OMARCHY_MIRROR:-stable}.conf /etc/pacman.conf + sudo cp -f ~/.local/share/omarchy/default/pacman/mirrorlist-${OMARCHY_MIRROR:-stable} /etc/pacman.d/mirrorlist sudo pacman-key --recv-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 --keyserver keys.openpgp.org sudo pacman-key --lsign-key 40DFB630FF42BCFFB047046CF0134EE680CAC571 sudo pacman -Sy - sudo pacman -S --noconfirm --needed omarchy-keyring - + omarchy-pkg-add omarchy-keyring # Refresh all repos - sudo pacman -Syyu --noconfirm + sudo pacman -Syyuu --noconfirm fi diff --git a/migrations/1751134560.sh b/migrations/1751134560.sh index 928b98fa..a5761181 100644 --- a/migrations/1751134560.sh +++ b/migrations/1751134560.sh @@ -10,6 +10,7 @@ export PATH=$OMARCHY_PATH/bin/:$PATH EOF # Ensure we have the latest repos and are ready to pull +omarchy-update-keyring omarchy-refresh-pacman sudo systemctl restart systemd-timesyncd sudo pacman -Sy # Normally not advisable, but we'll do a full -Syu before finishing diff --git a/migrations/1751134562.sh b/migrations/1751134562.sh index 0be8ee25..4f81f615 100644 --- a/migrations/1751134562.sh +++ b/migrations/1751134562.sh @@ -1,4 +1,5 @@ echo "Ensure all indexes and packages are up to date" +omarchy-update-keyring omarchy-refresh-pacman sudo pacman -Syu --noconfirm diff --git a/migrations/1751134564.sh b/migrations/1751134564.sh new file mode 100644 index 00000000..c61b2a08 --- /dev/null +++ b/migrations/1751134564.sh @@ -0,0 +1,3 @@ +echo "Ensure the Arch keyring is up to date" + +omarchy-update-keyring diff --git a/migrations/1751225707.sh b/migrations/1751225707.sh deleted file mode 100644 index 16387778..00000000 --- a/migrations/1751225707.sh +++ /dev/null @@ -1,6 +0,0 @@ -echo "Fixing persistent workspaces in waybar config" - -if [[ -f ~/.config/waybar/config ]]; then - sed -i 's/"persistent_workspaces":/"persistent-workspaces":/' ~/.config/waybar/config - omarchy-restart-waybar -fi diff --git a/migrations/1752153188.sh b/migrations/1752153188.sh deleted file mode 100644 index ec4beea5..00000000 --- a/migrations/1752153188.sh +++ /dev/null @@ -1,6 +0,0 @@ -echo "Migrate to the modular implementation of hyprlock" - -if [ -L ~/.config/hypr/hyprlock.conf ]; then - rm ~/.config/hypr/hyprlock.conf - cp ~/.local/share/omarchy/config/hypr/hyprlock.conf ~/.config/hypr/hyprlock.conf -fi diff --git a/migrations/1752251002.sh b/migrations/1752251002.sh deleted file mode 100644 index cea7a613..00000000 --- a/migrations/1752251002.sh +++ /dev/null @@ -1,6 +0,0 @@ -echo "Migrate to the modular, variable-based implementation of waybar style.css" - -if [ -L ~/.config/waybar/style.css ]; then - rm ~/.config/waybar/style.css - cp ~/.local/share/omarchy/config/waybar/style.css ~/.config/waybar/style.css -fi diff --git a/migrations/1752292967.sh b/migrations/1752292967.sh index d587fc4c..c1b8fa2b 100644 --- a/migrations/1752292967.sh +++ b/migrations/1752292967.sh @@ -4,13 +4,13 @@ if omarchy-cmd-missing uwsm; then sudo rm -f /etc/systemd/system/getty@tty1.service.d/override.conf sudo rmdir /etc/systemd/system/getty@tty1.service.d/ 2>/dev/null || true - if [ -f "$HOME/.bash_profile" ]; then + if [[ -f $HOME/.bash_profile ]]; then # Remove the specific line sed -i '/^\[\[ -z \$DISPLAY && \$(tty) == \/dev\/tty1 \]\] && exec Hyprland$/d' "$HOME/.bash_profile" echo "Cleaned up .bash_profile" fi - if [ -f "$HOME/.config/environment.d/fcitx.conf" ]; then + if [[ -f $HOME/.config/environment.d/fcitx.conf ]]; then echo "Removing GTK_IM_MODULE from fcitx config for Wayland..." sed -i 's/^GTK_IM_MODULE=fcitx$//' "$HOME/.config/environment.d/fcitx.conf" fi diff --git a/migrations/1752365998.sh b/migrations/1752365998.sh deleted file mode 100644 index 5b759f62..00000000 --- a/migrations/1752365998.sh +++ /dev/null @@ -1,10 +0,0 @@ -echo "Add override to only require one network interface to be online" - -if [[ ! -f /etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf ]]; then - sudo mkdir -p /etc/systemd/system/systemd-networkd-wait-online.service.d - sudo tee /etc/systemd/system/systemd-networkd-wait-online.service.d/wait-for-only-one-interface.conf >/dev/null </dev/null <<'EOF' auth sufficient pam_fprintd.so auth required pam_unix.so @@ -13,9 +13,9 @@ EOF fi # If fido2 is in sudo, it won't be in polkit either way -if grep -q pam_u2f.so /etc/pam.d/sudo && [ -f /etc/pam.d/polkit-1 ] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then +if grep -q pam_u2f.so /etc/pam.d/sudo && [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then sudo sed -i '1i auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/polkit-1 -elif grep -q pam_u2f.so /etc/pam.d/sudo && [ ! -f /etc/pam.d/polkit-1 ]; then +elif grep -q pam_u2f.so /etc/pam.d/sudo && [[ ! -f /etc/pam.d/polkit-1 ]]; then sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF' auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2 auth required pam_unix.so diff --git a/migrations/1754919057.sh b/migrations/1754919057.sh deleted file mode 100644 index b065bbc9..00000000 --- a/migrations/1754919057.sh +++ /dev/null @@ -1,5 +0,0 @@ -echo "Improve tooltip for Omarchy menu icon" - -if grep -q "SUPER + ALT + SPACE" ~/.config/waybar/config.jsonc; then - sed -i 's/SUPER + ALT + SPACE/Omarchy Menu\\n\\nSuper + Alt + Space/' ~/.config/waybar/config.jsonc -fi diff --git a/migrations/1754929475.sh b/migrations/1754929475.sh deleted file mode 100644 index ac4f650b..00000000 --- a/migrations/1754929475.sh +++ /dev/null @@ -1,32 +0,0 @@ -echo "Add start burst limit to login" - -if [ -f /etc/systemd/system/omarchy-seamless-login.service ]; then - cat <&1 | grep -oP '^\d+' || echo "0") -if [[ "$WALKER_MAJOR" -lt 2 ]]; then +if (( WALKER_MAJOR < 2 )); then NEEDS_MIGRATION=true fi diff --git a/migrations/1758142943.sh b/migrations/1758142943.sh index ef800abc..e9ed7944 100644 --- a/migrations/1758142943.sh +++ b/migrations/1758142943.sh @@ -9,7 +9,7 @@ VS_CODE_SETTINGS="$HOME/.config/Code/User/settings.json" if omarchy-cmd-present code; then mkdir -p "$(dirname "$VS_CODE_SETTINGS")" - if [[ ! -f "$VS_CODE_SETTINGS" ]]; then + if [[ ! -f $VS_CODE_SETTINGS ]]; then # If settings.json doesn't exist, create it with just the update.mode setting printf '{\n "update.mode": "none"\n}\n' > "$VS_CODE_SETTINGS" elif ! grep -q '"update.mode"' "$VS_CODE_SETTINGS"; then diff --git a/migrations/1758436991.sh b/migrations/1758436991.sh index b9a2e7b5..d8ae9ebb 100644 --- a/migrations/1758436991.sh +++ b/migrations/1758436991.sh @@ -5,13 +5,12 @@ ICON_DIR="$APP_DIR/icons" # Don't use omarchy-tui-remove to preserve icons -if [[ -f "$APP_DIR/Docker.desktop" ]]; then +if [[ -f $APP_DIR/Docker.desktop ]]; then rm "$APP_DIR/Docker.desktop" omarchy-tui-install "Docker" "lazydocker" tile "$ICON_DIR/Docker.png" fi -if [[ -f "$APP_DIR/Disk Usage.desktop" ]]; then +if [[ -f $APP_DIR/"Disk Usage.desktop" ]]; then rm "$APP_DIR/Disk Usage.desktop" omarchy-tui-install "Disk Usage" "bash -c 'dust -r; read -n 1 -s'" float "$ICON_DIR/Disk Usage.png" fi - diff --git a/migrations/1758487662_move_to_custom_uki.sh b/migrations/1758487662_move_to_custom_uki.sh index 731bba2a..a29376d8 100644 --- a/migrations/1758487662_move_to_custom_uki.sh +++ b/migrations/1758487662_move_to_custom_uki.sh @@ -15,7 +15,7 @@ if command -v limine &>/dev/null && [[ -f /etc/default/limine ]]; then uki_file=$(find /boot/EFI/Linux/ -name "omarchy*.efi" -printf "%f\n" 2>/dev/null | head -1) - if [[ -n "$uki_file" ]]; then + if [[ -n $uki_file ]]; then while IFS= read -r bootnum; do sudo efibootmgr -b "$bootnum" -B >/dev/null 2>&1 done < <(efibootmgr | grep -E "^Boot[0-9]{4}\*? Omarchy" | sed 's/^Boot\([0-9]\{4\}\).*/\1/') diff --git a/migrations/1760304963.sh b/migrations/1760304963.sh index e1c519c6..588d4f46 100644 --- a/migrations/1760304963.sh +++ b/migrations/1760304963.sh @@ -1,6 +1,6 @@ echo "Add a default keyring for gnome-keyring that unlocks on login" -if [ -f "$HOME/.local/share/keyrings/Default_keyring.keyring" ] || [ -f "$HOME/.local/share/keyrings/default" ]; then +if [[ -f $HOME/.local/share/keyrings/Default_keyring.keyring ]] || [[ -f $HOME/.local/share/keyrings/default ]]; then if gum confirm "Do you want to replace existing keyring with one that's auto-unlocked on login?"; then bash "$OMARCHY_PATH/install/login/default-keyring.sh" fi diff --git a/migrations/1760401344.sh b/migrations/1760401344.sh deleted file mode 100644 index 5e5ca300..00000000 --- a/migrations/1760401344.sh +++ /dev/null @@ -1,15 +0,0 @@ -echo "Add Chromium crash workaround flag for Hyprland to existing configs" - -# Add flag to chromium-flags.conf if it exists and doesn't already have it -if [[ -f ~/.config/chromium-flags.conf ]]; then - if ! grep -qF -- "--disable-features=WaylandWpColorManagerV1" ~/.config/chromium-flags.conf; then - sed -i '$a # Chromium crash workaround for Wayland color management on Hyprland - see https://github.com/hyprwm/Hyprland/issues/11957\n--disable-features=WaylandWpColorManagerV1' ~/.config/chromium-flags.conf - fi -fi - -# Add flag to brave-flags.conf if it exists and doesn't already have it -if [[ -f ~/.config/brave-flags.conf ]]; then - if ! grep -qF -- "--disable-features=WaylandWpColorManagerV1" ~/.config/brave-flags.conf; then - sed -i '$a # Chromium crash workaround for Wayland color management on Hyprland - see https://github.com/hyprwm/Hyprland/issues/11957\n--disable-features=WaylandWpColorManagerV1' ~/.config/brave-flags.conf - fi -fi diff --git a/migrations/1760724931.sh b/migrations/1760724931.sh deleted file mode 100644 index f418914d..00000000 --- a/migrations/1760724931.sh +++ /dev/null @@ -1,6 +0,0 @@ -echo "Change to openai-codex instead of openai-codex-bin" - -if omarchy-pkg-present openai-codex-bin; then - omarchy-pkg-drop openai-codex-bin - omarchy-pkg-add openai-codex -fi diff --git a/migrations/1760724934.sh b/migrations/1760724934.sh index cc218ffb..62cec752 100644 --- a/migrations/1760724934.sh +++ b/migrations/1760724934.sh @@ -12,12 +12,12 @@ echo "Copy hooks examples" cp -r $OMARCHY_PATH/config/omarchy/* $HOME/.config/omarchy/ echo "Add packages for updated omarchy-cmd-screenshot" -omarchy-pkg-add grim slurp wayfreeze-git +omarchy-pkg-add grim slurp echo "Add nfs support by default to Nautilus" omarchy-pkg-add gvfs-nfs -if [ ! -d "$HOME/.config/nvim" ]; then +if [[ ! -d $HOME/.config/nvim ]]; then echo "Add missing nvim config" omarchy-nvim-setup fi diff --git a/migrations/1760974946.sh b/migrations/1760974946.sh deleted file mode 100644 index ef800abc..00000000 --- a/migrations/1760974946.sh +++ /dev/null @@ -1,21 +0,0 @@ -echo "Turn off VSCode's own auto-update feature (we rely on pacman)" - -# Note: We cannot use `jq` to update settings.json because it’s JSONC (allows comments), -# which jq doesn’t support. - -VS_CODE_SETTINGS="$HOME/.config/Code/User/settings.json" - -# If VSCode is installed, ensure that the "update.mode" setting is set to "none" -if omarchy-cmd-present code; then - mkdir -p "$(dirname "$VS_CODE_SETTINGS")" - - if [[ ! -f "$VS_CODE_SETTINGS" ]]; then - # If settings.json doesn't exist, create it with just the update.mode setting - printf '{\n "update.mode": "none"\n}\n' > "$VS_CODE_SETTINGS" - elif ! grep -q '"update.mode"' "$VS_CODE_SETTINGS"; then - # Insert "update.mode": "none", immediately after the first "{" - # Use sed's first-match range (0,/{/) to only replace the first "{ - sed -i --follow-symlinks -E '0,/\{/{s/\{/{\ - "update.mode": "none",/}' "$VS_CODE_SETTINGS" - fi -fi diff --git a/migrations/1761180745.sh b/migrations/1761180745.sh index 5a6b1e0f..c0e31eb5 100644 --- a/migrations/1761180745.sh +++ b/migrations/1761180745.sh @@ -2,6 +2,6 @@ echo "Ensure interactive shell check is at the top of .bashrc" BASHRC="$HOME/.bashrc" -if [ -f "$BASHRC" ] && ! grep -q '\[\[ $- != \*i\* \]\] && return' "$BASHRC"; then +if [[ -f $BASHRC ]] && ! grep -q '\[\[ $- != \*i\* \]\] && return' "$BASHRC"; then sed -i '1i# If not running interactively, don'\''t do anything (leave this at the top of this file)\n[[ $- != *i* ]] && return\n' "$BASHRC" fi diff --git a/migrations/1761181166.sh b/migrations/1761181166.sh deleted file mode 100644 index fb7c54e4..00000000 --- a/migrations/1761181166.sh +++ /dev/null @@ -1,3 +0,0 @@ -echo "Change to pinned version of wayfreeze" -omarchy-pkg-drop wayfreeze-git -omarchy-pkg-add wayfreeze diff --git a/migrations/1761269603.sh b/migrations/1761269603.sh index 8d29f613..700a3efa 100644 --- a/migrations/1761269603.sh +++ b/migrations/1761269603.sh @@ -2,6 +2,6 @@ echo "Add right-click terminal action to waybar omarchy menu icon" WAYBAR_CONFIG="$HOME/.config/waybar/config.jsonc" -if [[ -f "$WAYBAR_CONFIG" ]] && ! grep -A5 '"custom/omarchy"' "$WAYBAR_CONFIG" | grep -q '"on-click-right"'; then +if [[ -f $WAYBAR_CONFIG ]] && ! grep -A5 '"custom/omarchy"' "$WAYBAR_CONFIG" | grep -q '"on-click-right"'; then sed -i '/"on-click": "omarchy-menu",/a\ "on-click-right": "omarchy-launch-terminal",' "$WAYBAR_CONFIG" fi diff --git a/migrations/1761569743.sh b/migrations/1761569743.sh index f45e7bfd..976df478 100644 --- a/migrations/1761569743.sh +++ b/migrations/1761569743.sh @@ -1,6 +1,6 @@ echo "Add default Ctrl+P binding for imv; backup existing config if present" -if [ -f ~/.config/imv/config ]; then +if [[ -f ~/.config/imv/config ]]; then cp ~/.config/imv/config ~/.config/imv/config.bak.$(date +%s) else mkdir -p ~/.config/imv diff --git a/migrations/1762121828.sh b/migrations/1762121828.sh index e56d16ca..b7b86c91 100644 --- a/migrations/1762121828.sh +++ b/migrations/1762121828.sh @@ -3,21 +3,21 @@ echo "Setting up xdg-terminal-exec for gtk-launch terminal support" # https://github.com/basecamp/omarchy/issues/1852 # Remove old symlink if it exists -- if someone ran the previous migration early -if [ -L /usr/local/bin/xdg-terminal-exec ]; then +if [[ -L /usr/local/bin/xdg-terminal-exec ]]; then sudo rm /usr/local/bin/xdg-terminal-exec fi omarchy-pkg-add xdg-terminal-exec # Set up xdg-terminals.list based on current $TERMINAL -if [ -n "$TERMINAL" ]; then +if [[ -n $TERMINAL ]]; then case "$TERMINAL" in alacritty) desktop_id="Alacritty.desktop" ;; ghostty) desktop_id="com.mitchellh.ghostty.desktop" ;; kitty) desktop_id="kitty.desktop" ;; esac - if [ -n "$desktop_id" ]; then + if [[ -n $desktop_id ]]; then mkdir -p ~/.config cat > ~/.config/xdg-terminals.list << EOF # Terminal emulator preference order for xdg-terminal-exec @@ -42,7 +42,7 @@ sed -i 's/export TERMINAL=.*/export TERMINAL=xdg-terminal-exec/' ~/.config/uwsm/ # Update waybar config to use xdg-terminal-exec waybar_config=~/.config/waybar/config.jsonc -if [ -f "$waybar_config" ]; then +if [[ -f $waybar_config ]]; then sed -i 's|"on-click-right": "omarchy-launch-terminal"|"on-click-right": "xdg-terminal-exec"|' "$waybar_config" sed -i 's|"on-click": "\$TERMINAL -e btop"|"on-click": "xdg-terminal-exec btop"|' "$waybar_config" sed -i 's|"on-click": "\$TERMINAL --class=Wiremix -e wiremix"|"on-click": "xdg-terminal-exec --app-id=com.omarchy.Wiremix -e wiremix"|' "$waybar_config" @@ -51,7 +51,7 @@ fi # Update hyprland window rules to use DNS-format class names system_conf=~/.config/hypr/apps/system.conf -if [ -f "$system_conf" ]; then +if [[ -f $system_conf ]]; then if grep -q 'class:(.*|Impala|' "$system_conf" || grep -q 'class:(.*|Wiremix|' "$system_conf" || grep -q '|Omarchy|' "$system_conf"; then sed -i 's/\bImpala\b/com.omarchy.Impala/g; s/\bWiremix\b/com.omarchy.Wiremix/g; s/|Omarchy|/|com.omarchy.Omarchy|/g' "$system_conf" fi diff --git a/migrations/1762156000.sh b/migrations/1762156000.sh new file mode 100644 index 00000000..42b82248 --- /dev/null +++ b/migrations/1762156000.sh @@ -0,0 +1,3 @@ +echo "Drop wayfreeze as hyprpicker replaces its function" + +omarchy-pkg-drop wayfreeze \ No newline at end of file diff --git a/migrations/1762446739.sh b/migrations/1762446739.sh index 37ad3b1b..c58de3f5 100644 --- a/migrations/1762446739.sh +++ b/migrations/1762446739.sh @@ -1,7 +1,7 @@ echo "Remove alternative limine.conf files" if omarchy-cmd-present limine; then - if [ ! -f /boot/limine.conf ]; then + if [[ ! -f /boot/limine.conf ]]; then echo "Error: /boot/limine.conf does not exist. Do not reboot without resolving this issue!" exit 1 fi diff --git a/migrations/1762684663.sh b/migrations/1762684663.sh index 3ef9a1cd..0d35aecb 100644 --- a/migrations/1762684663.sh +++ b/migrations/1762684663.sh @@ -2,7 +2,7 @@ echo "Update hyprlock font to match current system font" font_name=$(omarchy-font-current) -if [[ -n "$font_name" ]]; then +if [[ -n $font_name ]]; then cp ~/.config/hypr/hyprlock.conf ~/.config/hypr/hyprlock.conf.bak.$(date +%s) echo "Found font '$font_name', updating hyprlock" diff --git a/migrations/1765729055.sh b/migrations/1765729055.sh index 620b33fb..23c11e77 100644 --- a/migrations/1765729055.sh +++ b/migrations/1765729055.sh @@ -1,7 +1,7 @@ echo "Add emergency entry for Walker" CONFIG_FILE="$HOME/.config/walker/config.toml" -if [[ -f "$CONFIG_FILE" ]] && ! grep -q 'command = "omarchy-restart-walker"' "$CONFIG_FILE"; then +if [[ -f $CONFIG_FILE ]] && ! grep -q 'command = "omarchy-restart-walker"' "$CONFIG_FILE"; then cat >> "$CONFIG_FILE" << 'EOF' [[emergencies]] diff --git a/migrations/1767138576.sh b/migrations/1767138576.sh index 5df9ce2b..9771e316 100644 --- a/migrations/1767138576.sh +++ b/migrations/1767138576.sh @@ -1,9 +1,9 @@ echo "Update terminal scrolltouchpad setting to Hyprland 0.53 style" if grep -q "scrolltouchpad" ~/.config/hypr/input.conf; then - sed -Ei 's/^windowrule = scrolltouchpad ([^,]+), class:\(([^)]+)\)$/windowrule = match:class (\2), scroll_touchpad \1/' ~/.config/hypr/input.conf - sed -Ei 's/^windowrule = scrolltouchpad ([^,]+), class:([^ ]+)$/windowrule = match:class \2, scroll_touchpad \1/' ~/.config/hypr/input.conf - sed -Ei 's/^windowrule = scrolltouchpad ([^,]+), tag:terminal$/windowrule = match:class (Alacritty|kitty), scroll_touchpad 1.5\nwindowrule = match:class com.mitchellh.ghostty, scroll_touchpad 0.2/' ~/.config/hypr/input.conf + sed -Ei 's/^windowrule = scrolltouchpad ([^,]+), class:\(([^)]+)\)\s*$/windowrule = match:class (\2), scroll_touchpad \1/' ~/.config/hypr/input.conf + sed -Ei 's/^windowrule = scrolltouchpad ([^,]+), class:([^ ]+)\s*$/windowrule = match:class \2, scroll_touchpad \1/' ~/.config/hypr/input.conf + sed -Ei 's/^windowrule = scrolltouchpad ([^,]+), tag:terminal\s*$/windowrule = match:class (Alacritty|kitty), scroll_touchpad 1.5\nwindowrule = match:class com.mitchellh.ghostty, scroll_touchpad 0.2/' ~/.config/hypr/input.conf fi # Ensure we restart to pair new Hyprland settings with new version diff --git a/migrations/1767306902.sh b/migrations/1767306902.sh index b8166e49..18d1b395 100644 --- a/migrations/1767306902.sh +++ b/migrations/1767306902.sh @@ -4,7 +4,7 @@ echo "Migrate to new theme setup" OMARCHY_DIR="$HOME/.local/share/omarchy" USER_BACKGROUNDS_DIR="$HOME/.config/omarchy/backgrounds" -if [[ -d "$OMARCHY_DIR/themes" ]]; then +if [[ -d $OMARCHY_DIR/themes ]]; then cd "$OMARCHY_DIR" # Get list of git-tracked background files (relative to omarchy dir) @@ -15,21 +15,21 @@ if [[ -d "$OMARCHY_DIR/themes" ]]; then theme_name=$(basename "$theme_dir") backgrounds_dir="themes/$theme_name/backgrounds" - [[ -d "$backgrounds_dir" ]] || continue + [[ -d $backgrounds_dir ]] || continue for bg_file in "$backgrounds_dir"/*; do - [[ -f "$bg_file" ]] || continue + [[ -f $bg_file ]] || continue # Check if this file is tracked by git is_tracked=false for tracked in "${TRACKED_BACKGROUNDS[@]}"; do - if [[ "$tracked" == "$bg_file" ]]; then + if [[ $tracked == $bg_file ]]; then is_tracked=true break fi done - if [[ "$is_tracked" == "false" ]]; then + if [[ $is_tracked == "false" ]]; then # This is a user-added background, move it to user config user_theme_bg_dir="$USER_BACKGROUNDS_DIR/$theme_name" mkdir -p "$user_theme_bg_dir" @@ -49,7 +49,7 @@ if [[ -L $CURRENT_THEME_LINK ]]; then CURRENT_THEME_NAME=$(basename "$(readlink "$CURRENT_THEME_LINK")") elif [[ -d $CURRENT_THEME_LINK ]]; then CURRENT_THEME_NAME=$(basename "$CURRENT_THEME_LINK") -elif [[ -f "$HOME/.config/omarchy/current/theme.name" ]]; then +elif [[ -f $HOME/.config/omarchy/current/theme.name ]]; then CURRENT_THEME_NAME=$(cat "$HOME/.config/omarchy/current/theme.name") fi diff --git a/migrations/1768236764.sh b/migrations/1768236764.sh new file mode 100644 index 00000000..38e02bd6 --- /dev/null +++ b/migrations/1768236764.sh @@ -0,0 +1,4 @@ +echo "Prevent kernel upgrades from making current modules unavailable" + +omarchy-pkg-add kernel-modules-hook +sudo systemctl enable --now linux-modules-cleanup.service diff --git a/migrations/1768270644.sh b/migrations/1768270644.sh new file mode 100644 index 00000000..59083d19 --- /dev/null +++ b/migrations/1768270644.sh @@ -0,0 +1,14 @@ +echo "Add icon for headset audio profile in Waybar" + +if ! grep -q '"headset": ""' "$HOME/.config/waybar/config.jsonc"; then + sed -i ' + /"pulseaudio": {/,/^[ ]*}/{ + /"format-icons": {/,/^[ ]*}/{ + /"default":/i\ +\ "headset": "", + } + } + ' "$HOME/.config/waybar/config.jsonc" + + omarchy-restart-waybar +fi diff --git a/migrations/1768916735.sh b/migrations/1768916735.sh new file mode 100644 index 00000000..0c5c6408 --- /dev/null +++ b/migrations/1768916735.sh @@ -0,0 +1,8 @@ +echo "Fix microphone gain and audio mixing on Asus ROG laptops" + +source "$OMARCHY_PATH/install/config/hardware/fix-asus-rog-mic.sh" +source "$OMARCHY_PATH/install/config/hardware/fix-asus-rog-audio-mixer.sh" + +if omarchy-hw-asus-rog; then + omarchy-restart-pipewire +fi diff --git a/migrations/1769182209.sh b/migrations/1769182209.sh new file mode 100644 index 00000000..ae4825de --- /dev/null +++ b/migrations/1769182209.sh @@ -0,0 +1,4 @@ +echo "Enable auto-pasting for the emoji picker" + +omarchy-refresh-config elephant/symbols.toml +omarchy-restart-walker diff --git a/migrations/1769183359.sh b/migrations/1769183359.sh new file mode 100644 index 00000000..dbdbedf2 --- /dev/null +++ b/migrations/1769183359.sh @@ -0,0 +1,3 @@ +echo "Add nautilus-python package for 'Open in Ghostty' shortcut in Nautilus" + +omarchy-pkg-add nautilus-python diff --git a/migrations/1769510847.sh b/migrations/1769510847.sh index 381d396d..d9c5b260 100644 --- a/migrations/1769510847.sh +++ b/migrations/1769510847.sh @@ -1,6 +1,10 @@ echo "Switch back to mainline chromium now that it supports full live themeing" -echo "Note: This required resetting cookies and settings!" -omarchy-pkg-drop omarchy-chromium -omarchy-pkg-add chromium -omarchy-theme-set-browser +if omarchy-pkg-present omarchy-chromium; then + if gum confirm "Ready to switch to mainstream chromium? (Will close Chromium + reset settings)"; then + pkill -x chromium + omarchy-pkg-drop omarchy-chromium + omarchy-pkg-add chromium + omarchy-theme-set-browser + fi +fi diff --git a/migrations/1769543550.sh b/migrations/1769543550.sh new file mode 100644 index 00000000..44c657c7 --- /dev/null +++ b/migrations/1769543550.sh @@ -0,0 +1,6 @@ +echo "Add SUPER+ALT+SHIFT+F shortcut to open nautilus in cwd" + +# Add the new CWD binding if it doesn't exist +if ! grep -q "SUPER ALT SHIFT, F" ~/.config/hypr/bindings.conf; then + sed -i '/bindd = SUPER SHIFT, F, File manager, exec, uwsm-app -- nautilus --new-window/a bindd = SUPER ALT SHIFT, F, File manager (cwd), exec, uwsm-app -- nautilus --new-window "$(omarchy-cmd-terminal-cwd)"' ~/.config/hypr/bindings.conf +fi diff --git a/migrations/1769566732.sh b/migrations/1769566732.sh new file mode 100644 index 00000000..f2df93c0 --- /dev/null +++ b/migrations/1769566732.sh @@ -0,0 +1,3 @@ +echo "Set power profile based on source switching (AC or Battery)" + +source $OMARCHY_PATH/install/config/powerprofilesctl-rules.sh diff --git a/migrations/1769616857.sh b/migrations/1769616857.sh new file mode 100644 index 00000000..34e57bdf --- /dev/null +++ b/migrations/1769616857.sh @@ -0,0 +1,3 @@ +echo "Turn off opencode's own auto-update feature (we rely on pacman)" + +omarchy-refresh-config opencode/opencode.json diff --git a/migrations/1769619823.sh b/migrations/1769619823.sh new file mode 100644 index 00000000..47f1f482 --- /dev/null +++ b/migrations/1769619823.sh @@ -0,0 +1,3 @@ +echo "Open directories in file manager using the shell open command" + +xdg-mime default org.gnome.Nautilus.desktop inode/directory diff --git a/migrations/1769964367.sh b/migrations/1769964367.sh new file mode 100644 index 00000000..487f4d32 --- /dev/null +++ b/migrations/1769964367.sh @@ -0,0 +1,6 @@ +echo "Improve audio controls icon for default selection" + +if [[ ! -f ~/.config/wiremix/wiremix.toml ]]; then + mkdir -p ~/.config/wiremix + cp -f $OMARCHY_PATH/config/wiremix/wiremix.toml ~/.config/wiremix/ +fi diff --git a/migrations/1770159912.sh b/migrations/1770159912.sh new file mode 100644 index 00000000..41d8115d --- /dev/null +++ b/migrations/1770159912.sh @@ -0,0 +1,32 @@ +echo "Fix NVIDIA environment variables for Maxwell/Pascal/Volta GPUs" + +# Detect if user has Maxwell/Pascal/Volta GPU (pre-Turing cards without GSP firmware) +# Maxwell (GTX 9xx), Pascal (GT/GTX 10xx, Quadro P, MX series), Volta (Titan V, Tesla V100, Quadro GV100) +NVIDIA="$(lspci | grep -i 'nvidia')" +if echo "$NVIDIA" | grep -qE "GTX (9[0-9]{2}|10[0-9]{2})|GT 10[0-9]{2}|Quadro [PM][0-9]{3,4}|Quadro GV100|MX *[0-9]+|Titan (X|Xp|V)|Tesla V100"; then + ENVS_CONF="$HOME/.config/hypr/envs.conf" + + if [[ -f $ENVS_CONF ]]; then + # Check if file contains problematic variables + if grep -qE "env = (NVD_BACKEND,direct|LIBVA_DRIVER_NAME,nvidia)" "$ENVS_CONF"; then + echo "Removing incompatible NVIDIA environment variables for legacy GPU..." + + # Create backup + cp "$ENVS_CONF" "$ENVS_CONF.bak.$(date +%s)" + + # Remove all NVIDIA env lines and section headers (we re-add the correct ones below) + sed -i '/^env = \(NVD_BACKEND\|LIBVA_DRIVER_NAME\|__GLX_VENDOR_LIBRARY_NAME\),/d; /^# NVIDIA/d' "$ENVS_CONF" + + # Add correct environment variables for legacy GPUs + cat >>"$ENVS_CONF" <<'EOF' + +# NVIDIA (Maxwell/Pascal/Volta without GSP firmware) +env = NVD_BACKEND,egl +env = __GLX_VENDOR_LIBRARY_NAME,nvidia +EOF + + echo "NVIDIA environment variables updated. A backup was saved to $ENVS_CONF.bak.*" + echo "Please restart Hyprland for changes to take effect." + fi + fi +fi diff --git a/migrations/1770372978.sh b/migrations/1770372978.sh new file mode 100644 index 00000000..8ce213b6 --- /dev/null +++ b/migrations/1770372978.sh @@ -0,0 +1,5 @@ +echo "Disable fingerprint in hyprlock if fingerprint auth is not configured" + +if omarchy-cmd-missing fprintd-list || ! fprintd-list "$USER" 2>/dev/null | grep -q "finger"; then + sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf +fi diff --git a/migrations/1770375655.sh b/migrations/1770375655.sh new file mode 100644 index 00000000..8c2f3727 --- /dev/null +++ b/migrations/1770375655.sh @@ -0,0 +1,5 @@ +echo "Add Super+Shift+Return binding for browser" + +if [[ -f ~/.config/hypr/bindings.conf ]] && ! grep -q "SUPER SHIFT, RETURN.*Browser" ~/.config/hypr/bindings.conf; then + sed -i '/^bindd = SUPER, RETURN, Terminal/a bindd = SUPER SHIFT, RETURN, Browser, exec, omarchy-launch-browser' ~/.config/hypr/bindings.conf +fi diff --git a/migrations/1770375817.sh b/migrations/1770375817.sh new file mode 100644 index 00000000..28e03f8a --- /dev/null +++ b/migrations/1770375817.sh @@ -0,0 +1,6 @@ +echo "Ensure walker service is restarted if it's killed or crashes" + +mkdir -p ~/.config/systemd/user/app-walker@autostart.service.d/ +cp $OMARCHY_PATH/default/walker/restart.conf ~/.config/systemd/user/app-walker@autostart.service.d/restart.conf +systemctl --user daemon-reload + diff --git a/migrations/1770380577.sh b/migrations/1770380577.sh new file mode 100644 index 00000000..a9b0ca8b --- /dev/null +++ b/migrations/1770380577.sh @@ -0,0 +1,5 @@ +echo "Use interactive background selector menu" + +mkdir -p ~/.config/elephant/menus +ln -snf $OMARCHY_PATH/default/elephant/omarchy_background_selector.lua ~/.config/elephant/menus/omarchy_background_selector.lua +omarchy-restart-walker diff --git a/migrations/1770393078.sh b/migrations/1770393078.sh new file mode 100644 index 00000000..79238051 --- /dev/null +++ b/migrations/1770393078.sh @@ -0,0 +1,7 @@ +echo "Add async-backend = epoll to ghostty config to fix high IO pressure" + +if [[ -f ~/.config/ghostty/config ]] && ! grep -q "^async-backend" ~/.config/ghostty/config; then + echo "" >> ~/.config/ghostty/config + echo "# Fix general slowness on hyprland (https://github.com/ghostty-org/ghostty/discussions/3224)" >> ~/.config/ghostty/config + echo "async-backend = epoll" >> ~/.config/ghostty/config +fi diff --git a/migrations/1770483021.sh b/migrations/1770483021.sh new file mode 100644 index 00000000..fb8c7f9e --- /dev/null +++ b/migrations/1770483021.sh @@ -0,0 +1,4 @@ +echo "Install Framework 16 keyboard RGB support" + +source $OMARCHY_PATH/install/packaging/framework16.sh +source $OMARCHY_PATH/install/config/hardware/framework16-qmk-hid.sh diff --git a/migrations/1770638893.sh b/migrations/1770638893.sh new file mode 100644 index 00000000..0e5f2e54 --- /dev/null +++ b/migrations/1770638893.sh @@ -0,0 +1,9 @@ +echo "Add Tmux as an option with themed styling" + +omarchy-pkg-add tmux + +if [[ ! -f ~/.config/tmux/tmux.conf ]]; then + mkdir -p ~/.config/tmux + cp $OMARCHY_PATH/config/tmux/tmux.conf ~/.config/tmux/tmux.conf + omarchy-theme-refresh +fi diff --git a/migrations/1770811646.sh b/migrations/1770811646.sh new file mode 100644 index 00000000..efb50931 --- /dev/null +++ b/migrations/1770811646.sh @@ -0,0 +1,3 @@ +echo "Disable WiFi power save on AC power" + +source $OMARCHY_PATH/install/config/wifi-powersave-rules.sh diff --git a/migrations/1771002522.sh b/migrations/1771002522.sh new file mode 100644 index 00000000..a4550bc5 --- /dev/null +++ b/migrations/1771002522.sh @@ -0,0 +1,11 @@ +echo "Add full OSC 52 support to Alacritty" + +ALACRITTY_CONFIG=~/.config/alacritty/alacritty.toml + +if [[ -f $ALACRITTY_CONFIG ]] && ! grep -q 'osc52' "$ALACRITTY_CONFIG"; then + cat >> "$ALACRITTY_CONFIG" << 'EOF' + +[terminal] +osc52 = "CopyPaste" +EOF +fi diff --git a/migrations/1771188969.sh b/migrations/1771188969.sh new file mode 100644 index 00000000..e89716e1 --- /dev/null +++ b/migrations/1771188969.sh @@ -0,0 +1,14 @@ +echo "Remove temporary Wayland color manager disabling flag from existing Chromium configs" + +# This reverts the workaround originally added by migration 1760401344.sh +# Remove flag and comment from chromium-flags.conf only if found +if [[ -f ~/.config/chromium-flags.conf ]]; then + sed -i '/--disable-features=WaylandWpColorManagerV1/d' ~/.config/chromium-flags.conf + sed -i '/# Chromium crash workaround for Wayland color management on Hyprland/d' ~/.config/chromium-flags.conf +fi + +# Remove flag and comment from brave-flags.conf only if found +if [[ -f ~/.config/brave-flags.conf ]]; then + sed -i '/--disable-features=WaylandWpColorManagerV1/d' ~/.config/brave-flags.conf + sed -i '/# Chromium crash workaround for Wayland color management on Hyprland/d' ~/.config/brave-flags.conf +fi diff --git a/migrations/1771403119.sh b/migrations/1771403119.sh index fb27c296..59bd6bda 100644 --- a/migrations/1771403119.sh +++ b/migrations/1771403119.sh @@ -1,3 +1,3 @@ echo "Cure Chromium crash bug caused by mixing 145 and 144 sync logs" -rm -rf ~/.config/chromium/Default/Sync\ Data/LevelDB/*.log +rm -f ~/.config/chromium/Default/"Sync Data"/LevelDB/*.log diff --git a/migrations/1771602477.sh b/migrations/1771602477.sh new file mode 100644 index 00000000..f7bb4a61 --- /dev/null +++ b/migrations/1771602477.sh @@ -0,0 +1,37 @@ +echo "Add idle lock indicator to Waybar" + +STYLE_FILE=~/.config/waybar/style.css +CONFIG_FILE=~/.config/waybar/config.jsonc + +# Add idle-indicator to modules-center if not present +if ! grep -q "custom/idle-indicator" "$CONFIG_FILE"; then + sed -i 's/"custom\/screenrecording-indicator"]/"custom\/screenrecording-indicator", "custom\/idle-indicator"]/' "$CONFIG_FILE" + + sed -i '/"tray": {/i\ "custom/idle-indicator": {\n "on-click": "omarchy-toggle-idle",\n "exec": "$OMARCHY_PATH/default/waybar/indicators/idle.sh",\n "signal": 9,\n "return-type": "json"\n },' "$CONFIG_FILE" +fi + +# Add idle-indicator CSS if not present +if ! grep -q "#custom-idle-indicator" "$STYLE_FILE"; then + # Remove screenrecording-indicator from shared margin block and pair it with idle-indicator instead + sed -i 's/^#custom-screenrecording-indicator,$//' "$STYLE_FILE" + + # Add shared rule for both indicators and idle-indicator active state + sed -i '/#custom-screenrecording-indicator.active {/i\#custom-screenrecording-indicator,\n#custom-idle-indicator {\n min-width: 12px;\n margin-left: 5px;\n margin-right: 0;\n font-size: 10px;\n padding-bottom: 1px;\n}\n' "$STYLE_FILE" + + # Remove the now-duplicated properties from the standalone screenrecording block + sed -i '/#custom-screenrecording-indicator {/,/^}/ { + /min-width:/d + /margin-left:/d + /font-size:/d + /padding-bottom:/d + /^#custom-screenrecording-indicator {/d + /^}$/d + }' "$STYLE_FILE" + + cat >> "$STYLE_FILE" << 'EOF' + +#custom-idle-indicator.active { + color: #a55555; +} +EOF +fi diff --git a/migrations/1771602647.sh b/migrations/1771602647.sh new file mode 100644 index 00000000..fa880780 --- /dev/null +++ b/migrations/1771602647.sh @@ -0,0 +1,22 @@ +echo "Add notification silencing indicator to Waybar" + +STYLE_FILE=~/.config/waybar/style.css +CONFIG_FILE=~/.config/waybar/config.jsonc + +# Add notification-silencing-indicator to modules-center if not present +if ! grep -q "custom/notification-silencing-indicator" "$CONFIG_FILE"; then + sed -i 's/"custom\/idle-indicator"]/"custom\/idle-indicator", "custom\/notification-silencing-indicator"]/' "$CONFIG_FILE" + + sed -i '/"tray": {/i\ "custom/notification-silencing-indicator": {\n "on-click": "omarchy-toggle-notification-silencing",\n "exec": "$OMARCHY_PATH/default/waybar/indicators/notification-silencing.sh",\n "signal": 10,\n "return-type": "json"\n },' "$CONFIG_FILE" +fi + +# Add notification-silencing-indicator CSS if not present +if ! grep -q "#custom-notification-silencing-indicator" "$STYLE_FILE"; then + # Add to the shared indicator rule + sed -i 's/#custom-idle-indicator {/#custom-idle-indicator,\n#custom-notification-silencing-indicator {/' "$STYLE_FILE" + + # Add to the shared active color rule + sed -i 's/#custom-idle-indicator.active {/#custom-idle-indicator.active,\n#custom-notification-silencing-indicator.active {/' "$STYLE_FILE" +fi + +omarchy-restart-waybar diff --git a/migrations/1771606080.sh b/migrations/1771606080.sh new file mode 100644 index 00000000..da064f38 --- /dev/null +++ b/migrations/1771606080.sh @@ -0,0 +1,3 @@ +echo "Increase inotify file watchers for dev tools" + +bash $OMARCHY_PATH/install/config/increase-file-watchers.sh diff --git a/migrations/1771606249.sh b/migrations/1771606249.sh new file mode 100644 index 00000000..af341555 --- /dev/null +++ b/migrations/1771606249.sh @@ -0,0 +1,9 @@ +echo "Re-run scrolltouchpad migration for configs with trailing whitespace" + +if grep -q "scrolltouchpad" ~/.config/hypr/input.conf; then + sed -Ei 's/^windowrule = scrolltouchpad ([^,]+), class:\(([^)]+)\)\s*$/windowrule = match:class (\2), scroll_touchpad \1/' ~/.config/hypr/input.conf + sed -Ei 's/^windowrule = scrolltouchpad ([^,]+), class:([^ ]+)\s*$/windowrule = match:class \2, scroll_touchpad \1/' ~/.config/hypr/input.conf + sed -Ei 's/^windowrule = scrolltouchpad ([^,]+), tag:terminal\s*$/windowrule = match:class (Alacritty|kitty), scroll_touchpad 1.5\nwindowrule = match:class com.mitchellh.ghostty, scroll_touchpad 0.2/' ~/.config/hypr/input.conf + + omarchy-state set reboot-required +fi diff --git a/migrations/1771615907.sh b/migrations/1771615907.sh new file mode 100644 index 00000000..dc21029b --- /dev/null +++ b/migrations/1771615907.sh @@ -0,0 +1,3 @@ +echo "Add emoji font fallback to fontconfig" +cp $OMARCHY_PATH/config/fontconfig/fonts.conf ~/.config/fontconfig/fonts.conf +fc-cache -f diff --git a/migrations/1771618300.sh b/migrations/1771618300.sh new file mode 100644 index 00000000..28794966 --- /dev/null +++ b/migrations/1771618300.sh @@ -0,0 +1,2 @@ +echo "Turn off keyboard backlight when idle" +cp $OMARCHY_PATH/config/hypr/hypridle.conf ~/.config/hypr/hypridle.conf diff --git a/migrations/1771651931.sh b/migrations/1771651931.sh new file mode 100644 index 00000000..2baba8fe --- /dev/null +++ b/migrations/1771651931.sh @@ -0,0 +1,4 @@ +echo "Hide wiremix and limine-snapper-restore from app launcher" + +cp $OMARCHY_PATH/applications/hidden/wiremix.desktop ~/.local/share/applications/ +cp $OMARCHY_PATH/applications/hidden/limine-snapper-restore.desktop ~/.local/share/applications/ diff --git a/migrations/1771667323.sh b/migrations/1771667323.sh new file mode 100644 index 00000000..d93b58af --- /dev/null +++ b/migrations/1771667323.sh @@ -0,0 +1,7 @@ +echo "Fix colored gutter in nvim by making line numbers transparent" + +TRANSPARENCY_FILE="$HOME/.config/nvim/plugin/after/transparency.lua" + +if [[ -f $TRANSPARENCY_FILE ]] && ! grep -q "LineNr" "$TRANSPARENCY_FILE"; then + sed -i '/SignColumn/a vim.api.nvim_set_hl(0, "LineNr", { bg = "none" })\nvim.api.nvim_set_hl(0, "CursorLineNr", { bg = "none" })' "$TRANSPARENCY_FILE" +fi diff --git a/migrations/1771670389.sh b/migrations/1771670389.sh new file mode 100644 index 00000000..1cc282a1 --- /dev/null +++ b/migrations/1771670389.sh @@ -0,0 +1,7 @@ +echo "Add Logout option to system menu" + +omarchy-refresh-sddm + +if [[ -f /etc/sddm.conf.d/autologin.conf ]]; then + sudo sed -i 's/^Current=.*/Current=omarchy/' /etc/sddm.conf.d/autologin.conf +fi diff --git a/migrations/1771682500.sh b/migrations/1771682500.sh new file mode 100644 index 00000000..d84e987f --- /dev/null +++ b/migrations/1771682500.sh @@ -0,0 +1,12 @@ +echo "Prevent SDDM password login from creating encrypted login keyring" + +# Rename the encrypted login keyring if it exists (it conflicts with the passwordless Default_keyring) +if [[ -f $HOME/.local/share/keyrings/login.keyring ]]; then + mv "$HOME/.local/share/keyrings/login.keyring" "$HOME/.local/share/keyrings/login.keyring.bak" +fi + +# Remove gnome-keyring auth/password lines from sddm PAM so password-based logins +# don't create an encrypted login keyring. Keep the session line to start the daemon, +# which will auto-unlock the passwordless Default_keyring. +sudo sed -i '/-auth.*pam_gnome_keyring\.so/d' /etc/pam.d/sddm +sudo sed -i '/-password.*pam_gnome_keyring\.so/d' /etc/pam.d/sddm diff --git a/migrations/1771683168.sh b/migrations/1771683168.sh new file mode 100644 index 00000000..f5a47427 --- /dev/null +++ b/migrations/1771683168.sh @@ -0,0 +1,2 @@ +echo "Fix User Manager hanging on shutdown" +source $OMARCHY_PATH/install/config/fast-shutdown.sh diff --git a/migrations/1771683296.sh b/migrations/1771683296.sh new file mode 100644 index 00000000..5a7b9543 --- /dev/null +++ b/migrations/1771683296.sh @@ -0,0 +1,13 @@ +echo "Migrate suspend toggle from opt-in to opt-out" + +SUSPEND_ON=~/.local/state/omarchy/toggles/suspend-on +SUSPEND_OFF=~/.local/state/omarchy/toggles/suspend-off + +if [[ -f $SUSPEND_ON ]]; then + # User had suspend enabled, remove old file (suspend is now on by default) + rm -f $SUSPEND_ON +else + # User had suspend disabled, create opt-out file to preserve their choice + mkdir -p "$(dirname $SUSPEND_OFF)" + touch $SUSPEND_OFF +fi diff --git a/migrations/1771847961.sh b/migrations/1771847961.sh new file mode 100644 index 00000000..99808cba --- /dev/null +++ b/migrations/1771847961.sh @@ -0,0 +1,7 @@ +echo "Add Tmux binding (Super+Alt+Return) to hypr/bindings.conf" + +bindings_file="$HOME/.config/hypr/bindings.conf" + +if [[ -f $bindings_file ]] && ! grep -qE '^bindd?\s*=\s*SUPER\s+ALT\s*,\s*RETURN' "$bindings_file"; then + sed -i '1a bindd = SUPER ALT, RETURN, Tmux, exec, uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd)" tmux new' "$bindings_file" +fi diff --git a/migrations/1772051864.sh b/migrations/1772051864.sh new file mode 100644 index 00000000..2d9d9861 --- /dev/null +++ b/migrations/1772051864.sh @@ -0,0 +1,5 @@ +echo "Disable Ruby compilation in mise (if mise and ruby are installed)" + +if omarchy-cmd-present mise && mise which ruby &>/dev/null; then + mise settings set ruby.compile false +fi diff --git a/themes/catppuccin-latte/backgrounds/1-catppuccin-latte.png b/themes/catppuccin-latte/backgrounds/1-color-fade.png similarity index 100% rename from themes/catppuccin-latte/backgrounds/1-catppuccin-latte.png rename to themes/catppuccin-latte/backgrounds/1-color-fade.png diff --git a/themes/catppuccin/backgrounds/1-catppuccin.png b/themes/catppuccin/backgrounds/1-totoro.png similarity index 100% rename from themes/catppuccin/backgrounds/1-catppuccin.png rename to themes/catppuccin/backgrounds/1-totoro.png diff --git a/themes/catppuccin/backgrounds/2-cat-waves-mocha.png b/themes/catppuccin/backgrounds/2-waves.png similarity index 100% rename from themes/catppuccin/backgrounds/2-cat-waves-mocha.png rename to themes/catppuccin/backgrounds/2-waves.png diff --git a/themes/catppuccin/backgrounds/3-cat-blue-eye-mocha.png b/themes/catppuccin/backgrounds/3-blue-eye.png similarity index 100% rename from themes/catppuccin/backgrounds/3-cat-blue-eye-mocha.png rename to themes/catppuccin/backgrounds/3-blue-eye.png diff --git a/themes/catppuccin/waybar.css b/themes/catppuccin/waybar.css new file mode 100644 index 00000000..bf35a404 --- /dev/null +++ b/themes/catppuccin/waybar.css @@ -0,0 +1,2 @@ +@define-color foreground #cdd6f4; +@define-color background #181824; diff --git a/themes/ethereal/backgrounds/1.jpg b/themes/ethereal/backgrounds/1-cosmic.jpg similarity index 100% rename from themes/ethereal/backgrounds/1.jpg rename to themes/ethereal/backgrounds/1-cosmic.jpg diff --git a/themes/ethereal/backgrounds/2.jpg b/themes/ethereal/backgrounds/2-meadow.jpg similarity index 100% rename from themes/ethereal/backgrounds/2.jpg rename to themes/ethereal/backgrounds/2-meadow.jpg diff --git a/themes/everforest/backgrounds/1-everforest.jpg b/themes/everforest/backgrounds/1-tree-tops.jpg similarity index 100% rename from themes/everforest/backgrounds/1-everforest.jpg rename to themes/everforest/backgrounds/1-tree-tops.jpg diff --git a/themes/flexoki-light/backgrounds/1-flexoki-light-orb.png b/themes/flexoki-light/backgrounds/1-orb.png similarity index 100% rename from themes/flexoki-light/backgrounds/1-flexoki-light-orb.png rename to themes/flexoki-light/backgrounds/1-orb.png diff --git a/themes/flexoki-light/backgrounds/2-flexoki-light-omarchy.png b/themes/flexoki-light/backgrounds/2-omarchy.png similarity index 100% rename from themes/flexoki-light/backgrounds/2-flexoki-light-omarchy.png rename to themes/flexoki-light/backgrounds/2-omarchy.png diff --git a/themes/gruvbox/backgrounds/1-grubox.jpg b/themes/gruvbox/backgrounds/1-the-backwater.jpg similarity index 100% rename from themes/gruvbox/backgrounds/1-grubox.jpg rename to themes/gruvbox/backgrounds/1-the-backwater.jpg diff --git a/themes/gruvbox/backgrounds/2-gruvbox.jpg b/themes/gruvbox/backgrounds/2-leaves.jpg similarity index 100% rename from themes/gruvbox/backgrounds/2-gruvbox.jpg rename to themes/gruvbox/backgrounds/2-leaves.jpg diff --git a/themes/hackerman/backgrounds/1.jpg b/themes/hackerman/backgrounds/1-synth-scape.jpg similarity index 100% rename from themes/hackerman/backgrounds/1.jpg rename to themes/hackerman/backgrounds/1-synth-scape.jpg diff --git a/themes/hackerman/backgrounds/2.jpg b/themes/hackerman/backgrounds/2-geometric.jpg similarity index 100% rename from themes/hackerman/backgrounds/2.jpg rename to themes/hackerman/backgrounds/2-geometric.jpg diff --git a/themes/matte-black/backgrounds/1-matte-black.jpg b/themes/matte-black/backgrounds/1-dark-waters.jpg similarity index 100% rename from themes/matte-black/backgrounds/1-matte-black.jpg rename to themes/matte-black/backgrounds/1-dark-waters.jpg diff --git a/themes/matte-black/backgrounds/2-matte-black-hands.jpg b/themes/matte-black/backgrounds/2-dot-hands.jpg similarity index 100% rename from themes/matte-black/backgrounds/2-matte-black-hands.jpg rename to themes/matte-black/backgrounds/2-dot-hands.jpg diff --git a/themes/miasma/backgrounds/01-nature-of-fear.jpg b/themes/miasma/backgrounds/01-nature-of-fear.jpg new file mode 100644 index 00000000..16cf45b7 Binary files /dev/null and b/themes/miasma/backgrounds/01-nature-of-fear.jpg differ diff --git a/themes/miasma/backgrounds/02-crowned.jpg b/themes/miasma/backgrounds/02-crowned.jpg new file mode 100644 index 00000000..3a83fb3a Binary files /dev/null and b/themes/miasma/backgrounds/02-crowned.jpg differ diff --git a/themes/miasma/btop.theme b/themes/miasma/btop.theme new file mode 100644 index 00000000..4db76eb7 --- /dev/null +++ b/themes/miasma/btop.theme @@ -0,0 +1,70 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#222222" + +# Main text color +theme[main_fg]="#c2c2b0" + +# Title color for boxes +theme[title]="#bb7744" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#c9a554" + +# Background color of selected item in processes box +theme[selected_bg]="#e4c47a" + +# Foreground color of selected item in processes box +theme[selected_fg]="#000000" + +# Color of inactive/disabled text +theme[inactive_fg]="#666666" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#bb7744" + +# Box outline and divider line color +theme[cpu_box]="#5f875f" +theme[mem_box]="#5f875f" +theme[net_box]="#5f875f" +theme[proc_box]="#5f875f" +theme[div_line]="#666666" + +# Gradient for all meters and graphs +theme[temp_start]="#c9a554" +theme[temp_mid]="#78824b" +theme[temp_end]="#5f875f" + + +theme[cpu_start]="#c9a554" +theme[cpu_mid]="#78824b" +theme[cpu_end]="#5f875f" + + +theme[free_start]="#78824b" +theme[free_mid]="#b36d43" +theme[free_end]="#b36d43" + + +theme[cached_start]="#b36d43" +theme[cached_mid]="#b36d43" +theme[cached_end]="#b36d43" + + +theme[available_start]="#c9a554" +theme[available_mid]="#c9a554" +theme[available_end]="#c9a554" + + +theme[used_start]="#5f875f" +theme[used_mid]="#5f875f" +theme[used_end]="#5f875f" + + +theme[download_start]="#b36d43" +theme[download_mid]="#c9a554" +theme[download_end]="#78824b" + + +theme[upload_start]="#b36d43" +theme[upload_mid]="#c9a554" +theme[upload_end]="#78824b" diff --git a/themes/miasma/colors.toml b/themes/miasma/colors.toml new file mode 100644 index 00000000..705ce2e4 --- /dev/null +++ b/themes/miasma/colors.toml @@ -0,0 +1,23 @@ +accent = "#78824b" +cursor = "#c7c7c7" +foreground = "#c2c2b0" +background = "#222222" +selection_foreground = "#c2c2b0" +selection_background = "#78824b" + +color0 = "#000000" +color1 = "#685742" +color2 = "#5f875f" +color3 = "#b36d43" +color4 = "#78824b" +color5 = "#bb7744" +color6 = "#c9a554" +color7 = "#d7c483" +color8 = "#666666" +color9 = "#685742" +color10 = "#5f875f" +color11 = "#b36d43" +color12 = "#78824b" +color13 = "#bb7744" +color14 = "#c9a554" +color15 = "#d7c483" diff --git a/themes/miasma/icons.theme b/themes/miasma/icons.theme new file mode 100644 index 00000000..37b2350b --- /dev/null +++ b/themes/miasma/icons.theme @@ -0,0 +1 @@ +Yaru-wartybrown \ No newline at end of file diff --git a/themes/miasma/neovim.lua b/themes/miasma/neovim.lua new file mode 100644 index 00000000..f6a31035 --- /dev/null +++ b/themes/miasma/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "xero/miasma.nvim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "miasma", + }, + }, +} diff --git a/themes/miasma/preview.png b/themes/miasma/preview.png new file mode 100644 index 00000000..690c4364 Binary files /dev/null and b/themes/miasma/preview.png differ diff --git a/themes/miasma/vscode.json b/themes/miasma/vscode.json new file mode 100644 index 00000000..9d28bdb1 --- /dev/null +++ b/themes/miasma/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "In The Fog Dark", + "extension": "ganevru.in-the-fog-theme" +} diff --git a/themes/nord/backgrounds/0-black-moon.jpg b/themes/nord/backgrounds/0-black-moon.jpg new file mode 100644 index 00000000..55df3774 Binary files /dev/null and b/themes/nord/backgrounds/0-black-moon.jpg differ diff --git a/themes/nord/backgrounds/1-nord.png b/themes/nord/backgrounds/1-city-view.png similarity index 100% rename from themes/nord/backgrounds/1-nord.png rename to themes/nord/backgrounds/1-city-view.png diff --git a/themes/nord/backgrounds/2-nord.png b/themes/nord/backgrounds/2-night-hawks.png similarity index 100% rename from themes/nord/backgrounds/2-nord.png rename to themes/nord/backgrounds/2-night-hawks.png diff --git a/themes/osaka-jade/backgrounds/1-osaka-jade-bg.jpg b/themes/osaka-jade/backgrounds/1-glowing-city.jpg similarity index 100% rename from themes/osaka-jade/backgrounds/1-osaka-jade-bg.jpg rename to themes/osaka-jade/backgrounds/1-glowing-city.jpg diff --git a/themes/osaka-jade/backgrounds/2-osaka-jade-bg.jpg b/themes/osaka-jade/backgrounds/2-shaded-entrance.jpg similarity index 100% rename from themes/osaka-jade/backgrounds/2-osaka-jade-bg.jpg rename to themes/osaka-jade/backgrounds/2-shaded-entrance.jpg diff --git a/themes/osaka-jade/backgrounds/3-osaka-jade-bg.jpg b/themes/osaka-jade/backgrounds/3-mountain-moon.jpg similarity index 100% rename from themes/osaka-jade/backgrounds/3-osaka-jade-bg.jpg rename to themes/osaka-jade/backgrounds/3-mountain-moon.jpg diff --git a/themes/ristretto/backgrounds/1-ristretto.jpg b/themes/ristretto/backgrounds/1-color-curves.jpg similarity index 100% rename from themes/ristretto/backgrounds/1-ristretto.jpg rename to themes/ristretto/backgrounds/1-color-curves.jpg diff --git a/themes/ristretto/backgrounds/2-ristretto.jpg b/themes/ristretto/backgrounds/2-coffee-beans.jpg similarity index 100% rename from themes/ristretto/backgrounds/2-ristretto.jpg rename to themes/ristretto/backgrounds/2-coffee-beans.jpg diff --git a/themes/ristretto/backgrounds/3-ristretto.jpg b/themes/ristretto/backgrounds/3-industrial-moon.jpg similarity index 100% rename from themes/ristretto/backgrounds/3-ristretto.jpg rename to themes/ristretto/backgrounds/3-industrial-moon.jpg diff --git a/themes/rose-pine/backgrounds/1-rose-pine.jpg b/themes/rose-pine/backgrounds/1-funky-shapes.jpg similarity index 100% rename from themes/rose-pine/backgrounds/1-rose-pine.jpg rename to themes/rose-pine/backgrounds/1-funky-shapes.jpg diff --git a/themes/rose-pine/backgrounds/2-wave-light.png b/themes/rose-pine/backgrounds/2-dot-map.png similarity index 100% rename from themes/rose-pine/backgrounds/2-wave-light.png rename to themes/rose-pine/backgrounds/2-dot-map.png diff --git a/themes/rose-pine/backgrounds/3-leafy-dawn-omarchy.png b/themes/rose-pine/backgrounds/3-omarchy-plants.png similarity index 100% rename from themes/rose-pine/backgrounds/3-leafy-dawn-omarchy.png rename to themes/rose-pine/backgrounds/3-omarchy-plants.png diff --git a/themes/tokyo-night/backgrounds/0-swirl-buck.jpg b/themes/tokyo-night/backgrounds/0-swirl-buck.jpg new file mode 100644 index 00000000..504f3db2 Binary files /dev/null and b/themes/tokyo-night/backgrounds/0-swirl-buck.jpg differ diff --git a/themes/tokyo-night/backgrounds/1-scenery-pink-lakeside-sunset-lake-landscape-scenic-panorama-7680x3215-144.png b/themes/tokyo-night/backgrounds/1-sunset-lake.png similarity index 100% rename from themes/tokyo-night/backgrounds/1-scenery-pink-lakeside-sunset-lake-landscape-scenic-panorama-7680x3215-144.png rename to themes/tokyo-night/backgrounds/1-sunset-lake.png diff --git a/themes/tokyo-night/backgrounds/2-Pawel-Czerwinski-Abstract-Purple-Blue.jpg b/themes/tokyo-night/backgrounds/2-pawel-czerwinski.jpg similarity index 100% rename from themes/tokyo-night/backgrounds/2-Pawel-Czerwinski-Abstract-Purple-Blue.jpg rename to themes/tokyo-night/backgrounds/2-pawel-czerwinski.jpg diff --git a/themes/tokyo-night/backgrounds/3-Milad-Fakurian-Abstract-Purple-Blue.jpg b/themes/tokyo-night/backgrounds/3-milad-fakurian.jpg similarity index 100% rename from themes/tokyo-night/backgrounds/3-Milad-Fakurian-Abstract-Purple-Blue.jpg rename to themes/tokyo-night/backgrounds/3-milad-fakurian.jpg diff --git a/themes/tokyo-night/keyboard.rgb b/themes/tokyo-night/keyboard.rgb new file mode 100644 index 00000000..c9f4a7cc --- /dev/null +++ b/themes/tokyo-night/keyboard.rgb @@ -0,0 +1 @@ +ff00ff diff --git a/themes/vantablack/backgrounds/1-twisted-stairs.jpg b/themes/vantablack/backgrounds/1-twisted-stairs.jpg new file mode 100644 index 00000000..ad81cf17 Binary files /dev/null and b/themes/vantablack/backgrounds/1-twisted-stairs.jpg differ diff --git a/themes/vantablack/backgrounds/2-layers-deep.jpg b/themes/vantablack/backgrounds/2-layers-deep.jpg new file mode 100644 index 00000000..e0f04b62 Binary files /dev/null and b/themes/vantablack/backgrounds/2-layers-deep.jpg differ diff --git a/themes/vantablack/backgrounds/3-layers-stacked.jpg b/themes/vantablack/backgrounds/3-layers-stacked.jpg new file mode 100644 index 00000000..4a81b945 Binary files /dev/null and b/themes/vantablack/backgrounds/3-layers-stacked.jpg differ diff --git a/themes/vantablack/btop.theme b/themes/vantablack/btop.theme new file mode 100644 index 00000000..cf3d98ca --- /dev/null +++ b/themes/vantablack/btop.theme @@ -0,0 +1,70 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#0d0d0d" + +# Main text color +theme[main_fg]="#ffffff" + +# Title color for boxes +theme[title]="#9b9b9b" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#b0b0b0" + +# Background color of selected item in processes box +theme[selected_bg]="#fdfdfd" + +# Foreground color of selected item in processes box +theme[selected_fg]="#ffffff" + +# Color of inactive/disabled text +theme[inactive_fg]="#fdfdfd" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#9b9b9b" + +# Box outline and divider line color +theme[cpu_box]="#b6b6b6" +theme[mem_box]="#b6b6b6" +theme[net_box]="#b6b6b6" +theme[proc_box]="#b6b6b6" +theme[div_line]="#fdfdfd" + +# Gradient for all meters and graphs +theme[temp_start]="#b0b0b0" +theme[temp_mid]="#8d8d8d" +theme[temp_end]="#b6b6b6" + + +theme[cpu_start]="#b0b0b0" +theme[cpu_mid]="#8d8d8d" +theme[cpu_end]="#b6b6b6" + + +theme[free_start]="#8d8d8d" +theme[free_mid]="#cecece" +theme[free_end]="#cecece" + + +theme[cached_start]="#cecece" +theme[cached_mid]="#cecece" +theme[cached_end]="#cecece" + + +theme[available_start]="#b0b0b0" +theme[available_mid]="#b0b0b0" +theme[available_end]="#b0b0b0" + + +theme[used_start]="#b6b6b6" +theme[used_mid]="#b6b6b6" +theme[used_end]="#b6b6b6" + + +theme[download_start]="#cecece" +theme[download_mid]="#b0b0b0" +theme[download_end]="#8d8d8d" + + +theme[upload_start]="#cecece" +theme[upload_mid]="#b0b0b0" +theme[upload_end]="#8d8d8d" \ No newline at end of file diff --git a/themes/vantablack/colors.toml b/themes/vantablack/colors.toml new file mode 100644 index 00000000..96e095fc --- /dev/null +++ b/themes/vantablack/colors.toml @@ -0,0 +1,31 @@ +# UI Colors (extended) +accent = "#8d8d8d" +cursor = "#ffffff" + +# Primary colors +foreground = "#ffffff" +background = "#0d0d0d" + +# Selection colors +selection_foreground = "#0d0d0d" +selection_background = "#ffffff" + +# Normal colors (ANSI 0-7) +color0 = "#0d0d0d" +color1 = "#a4a4a4" +color2 = "#b6b6b6" +color3 = "#cecece" +color4 = "#8d8d8d" +color5 = "#9b9b9b" +color6 = "#b0b0b0" +color7 = "#ececec" + +# Bright colors (ANSI 8-15) +color8 = "#fdfdfd" +color9 = "#a4a4a4" +color10 = "#b6b6b6" +color11 = "#cecece" +color12 = "#8d8d8d" +color13 = "#9b9b9b" +color14 = "#b0b0b0" +color15 = "#ffffff" diff --git a/themes/vantablack/icons.theme b/themes/vantablack/icons.theme new file mode 100644 index 00000000..0bc3e2d5 --- /dev/null +++ b/themes/vantablack/icons.theme @@ -0,0 +1 @@ +Yaru-gray diff --git a/themes/vantablack/neovim.lua b/themes/vantablack/neovim.lua new file mode 100644 index 00000000..f9d96169 --- /dev/null +++ b/themes/vantablack/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "bjarneo/vantablack.nvim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "vantablack", + }, + }, +} diff --git a/themes/vantablack/preview.png b/themes/vantablack/preview.png new file mode 100644 index 00000000..e25805d0 Binary files /dev/null and b/themes/vantablack/preview.png differ diff --git a/themes/vantablack/vscode.json b/themes/vantablack/vscode.json new file mode 100644 index 00000000..4221b9ea --- /dev/null +++ b/themes/vantablack/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "Vantablack", + "extension": "Bjarne.vantablack-omarchy" +} diff --git a/themes/white/backgrounds/1-white.jpg b/themes/white/backgrounds/1-white.jpg new file mode 100644 index 00000000..0e6121f7 Binary files /dev/null and b/themes/white/backgrounds/1-white.jpg differ diff --git a/themes/white/backgrounds/2-white.jpg b/themes/white/backgrounds/2-white.jpg new file mode 100644 index 00000000..b8c5a7dc Binary files /dev/null and b/themes/white/backgrounds/2-white.jpg differ diff --git a/themes/white/backgrounds/3-white.jpg b/themes/white/backgrounds/3-white.jpg new file mode 100644 index 00000000..4ec45534 Binary files /dev/null and b/themes/white/backgrounds/3-white.jpg differ diff --git a/themes/white/btop.theme b/themes/white/btop.theme new file mode 100644 index 00000000..244253ac --- /dev/null +++ b/themes/white/btop.theme @@ -0,0 +1,70 @@ +# Main background, empty for terminal default, need to be empty if you want transparent background +theme[main_bg]="#ffffff" + +# Main text color +theme[main_fg]="#000000" + +# Title color for boxes +theme[title]="#2e2e2e" + +# Highlight color for keyboard shortcuts +theme[hi_fg]="#3e3e3e" + +# Background color of selected item in processes box +theme[selected_bg]="#c0c0c0" + +# Foreground color of selected item in processes box +theme[selected_fg]="#000000" + +# Color of inactive/disabled text +theme[inactive_fg]="#c0c0c0" + +# Misc colors for processes box including mini cpu graphs, details memory graph and details status text +theme[proc_misc]="#2e2e2e" + +# Box outline and divider line color +theme[cpu_box]="#3a3a3a" +theme[mem_box]="#3a3a3a" +theme[net_box]="#3a3a3a" +theme[proc_box]="#3a3a3a" +theme[div_line]="#c0c0c0" + +# Gradient for all meters and graphs +theme[temp_start]="#3e3e3e" +theme[temp_mid]="#1a1a1a" +theme[temp_end]="#3a3a3a" + + +theme[cpu_start]="#3e3e3e" +theme[cpu_mid]="#1a1a1a" +theme[cpu_end]="#3a3a3a" + + +theme[free_start]="#1a1a1a" +theme[free_mid]="#4a4a4a" +theme[free_end]="#4a4a4a" + + +theme[cached_start]="#4a4a4a" +theme[cached_mid]="#4a4a4a" +theme[cached_end]="#4a4a4a" + + +theme[available_start]="#3e3e3e" +theme[available_mid]="#3e3e3e" +theme[available_end]="#3e3e3e" + + +theme[used_start]="#3a3a3a" +theme[used_mid]="#3a3a3a" +theme[used_end]="#3a3a3a" + + +theme[download_start]="#4a4a4a" +theme[download_mid]="#3e3e3e" +theme[download_end]="#1a1a1a" + + +theme[upload_start]="#4a4a4a" +theme[upload_mid]="#3e3e3e" +theme[upload_end]="#1a1a1a" \ No newline at end of file diff --git a/themes/white/colors.toml b/themes/white/colors.toml new file mode 100644 index 00000000..de6cce97 --- /dev/null +++ b/themes/white/colors.toml @@ -0,0 +1,31 @@ +# UI Colors (extended) +accent = "#6e6e6e" +cursor = "#000000" + +# Primary colors +foreground = "#000000" +background = "#ffffff" + +# Selection colors +selection_foreground = "#ffffff" +selection_background = "#1a1a1a" + +# Normal colors (ANSI 0-7) +color0 = "#ffffff" +color1 = "#2a2a2a" +color2 = "#3a3a3a" +color3 = "#4a4a4a" +color4 = "#1a1a1a" +color5 = "#2e2e2e" +color6 = "#3e3e3e" +color7 = "#000000" + +# Bright colors (ANSI 8-15) +color8 = "#c0c0c0" +color9 = "#2a2a2a" +color10 = "#3a3a3a" +color11 = "#4a4a4a" +color12 = "#1a1a1a" +color13 = "#2e2e2e" +color14 = "#3e3e3e" +color15 = "#000000" diff --git a/themes/white/icons.theme b/themes/white/icons.theme new file mode 100644 index 00000000..6ce2f147 --- /dev/null +++ b/themes/white/icons.theme @@ -0,0 +1 @@ +Yaru-blue diff --git a/themes/white/light.mode b/themes/white/light.mode new file mode 100644 index 00000000..66bb2d04 --- /dev/null +++ b/themes/white/light.mode @@ -0,0 +1 @@ +# This will set "prefer-light" and use "Adwaita" as the theme diff --git a/themes/white/neovim.lua b/themes/white/neovim.lua new file mode 100644 index 00000000..f9afa389 --- /dev/null +++ b/themes/white/neovim.lua @@ -0,0 +1,12 @@ +return { + { + "bjarneo/white.nvim", + priority = 1000, + }, + { + "LazyVim/LazyVim", + opts = { + colorscheme = "white", + }, + }, +} diff --git a/themes/white/preview.png b/themes/white/preview.png new file mode 100644 index 00000000..3d7dd81c Binary files /dev/null and b/themes/white/preview.png differ diff --git a/themes/white/vscode.json b/themes/white/vscode.json new file mode 100644 index 00000000..88d16fcd --- /dev/null +++ b/themes/white/vscode.json @@ -0,0 +1,4 @@ +{ + "name": "White Omarchy", + "extension": "Bjarne.white-theme" +} diff --git a/version b/version index 619b5376..18091983 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.3.3 +3.4.0