diff --git a/bin/omarchy-cmd-audio-switch b/bin/omarchy-cmd-audio-switch index 1cb51086..de81cc3f 100755 --- a/bin/omarchy-cmd-audio-switch +++ b/bin/omarchy-cmd-audio-switch @@ -2,7 +2,7 @@ # Switch between audio outputs while preserving the mute status. By default mapped to Super + Mute. -focused_monitor="$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')" +focused_monitor=$(omarchy-hyprland-monitor-focused) sinks=$(pactl -f json list sinks | jq '[.[] | select((.ports | length == 0) or ([.ports[]? | .availability != "not available"] | any))]') sinks_count=$(echo "$sinks" | jq '. | length') diff --git a/bin/omarchy-cmd-first-run b/bin/omarchy-cmd-first-run index 830bef54..a1734cfb 100755 --- a/bin/omarchy-cmd-first-run +++ b/bin/omarchy-cmd-first-run @@ -15,6 +15,7 @@ if [[ -f $FIRST_RUN_MODE ]]; then bash "$OMARCHY_PATH/install/first-run/dns-resolver.sh" bash "$OMARCHY_PATH/install/first-run/gnome-theme.sh" bash "$OMARCHY_PATH/install/first-run/elephant.sh" + bash "$OMARCHY_PATH/install/first-run/powerprofilesctl-rules.sh" sudo rm -f /etc/sudoers.d/first-run bash "$OMARCHY_PATH/install/first-run/welcome.sh" diff --git a/bin/omarchy-cmd-mic-mute b/bin/omarchy-cmd-mic-mute new file mode 100755 index 00000000..7f10fa94 --- /dev/null +++ b/bin/omarchy-cmd-mic-mute @@ -0,0 +1,9 @@ +#!/bin/bash + +# Toggle microphone mute. Dell XPS systems get special handling for the hardware LED. + +if omarchy-hw-match "XPS"; then + omarchy-cmd-mic-mute-xps +else + swayosd-client --monitor "$(omarchy-hyprland-monitor-focused)" --input-volume mute-toggle +fi diff --git a/bin/omarchy-cmd-mic-mute-xps b/bin/omarchy-cmd-mic-mute-xps new file mode 100755 index 00000000..8e7ca135 --- /dev/null +++ b/bin/omarchy-cmd-mic-mute-xps @@ -0,0 +1,44 @@ +#!/bin/bash + +# Toggle microphone mute on Dell XPS systems. Uses wpctl for reliable toggling +# and syncs the ALSA capture switch so the hardware mic mute LED follows state. + +wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle >/dev/null + +if pactl get-source-mute @DEFAULT_SOURCE@ | rg -q 'yes'; then + alsa_value='off,off' + osd_message='Microphone muted' + osd_icon='microphone-sensitivity-muted-symbolic' +else + alsa_value='on,on' + osd_message='Microphone on' + osd_icon='audio-input-microphone-symbolic' +fi + +if [[ -e /sys/class/leds/platform::micmute/brightness ]]; then + default_source=$(pactl get-default-source) + alsa_card=$(pactl -f json list sources | jq -r --arg source "$default_source" ' + .[] | select(.name == $source) | + .properties["alsa.card"] // .properties["api.alsa.card"] // .properties["api.alsa.pcm.card"] // empty + ' | head -1) + + if [[ -n $alsa_card ]]; then + cards=("$alsa_card") + else + mapfile -t cards < <(compgen -G '/proc/asound/card*' | rg -o 'card[0-9]+' | sed 's/card//' | sort -u) + fi + + for card in "${cards[@]}"; do + while IFS= read -r control; do + if [[ $control != *"Jack Microphone"* ]]; then + amixer -c "$card" cset "$control" "$alsa_value" >/dev/null 2>&1 || true + break 2 + fi + done < <(amixer -c "$card" controls 2>/dev/null | rg -o "name='[^']*Microphone Capture Switch'") + done +fi + +swayosd-client \ + --monitor "$(omarchy-hyprland-monitor-focused)" \ + --custom-message "$osd_message" \ + --custom-icon "$osd_icon" diff --git a/bin/omarchy-haptic-touchpad b/bin/omarchy-haptic-touchpad index f800f0d0..f0240116 100755 --- a/bin/omarchy-haptic-touchpad +++ b/bin/omarchy-haptic-touchpad @@ -11,7 +11,6 @@ Trigger protocol used by these Synaptics touchpads. import fcntl, glob, os, struct, sys VENDOR = "06CB" -PRODUCT = "D01A" REPORT_ID = 0x37 INTENSITY = 40 # 0-100 @@ -34,7 +33,7 @@ def find_hidraw(): try: with open(uevent) as f: content = f.read().upper() - if f"0000{VENDOR}" in content and f"0000{PRODUCT}" in content: + if f"0000{VENDOR}" in content: return os.path.join("/dev", os.path.basename(path)) except OSError: continue @@ -46,7 +45,7 @@ def find_touchpad_event(): try: with open(path) as f: name = f.read().strip().upper() - if VENDOR in name and PRODUCT in name and "TOUCHPAD" in name: + if VENDOR in name and "TOUCHPAD" in name: event = path.split("/")[-3] return os.path.join("/dev/input", event) except OSError: diff --git a/bin/omarchy-hyprland-monitor-focused b/bin/omarchy-hyprland-monitor-focused new file mode 100755 index 00000000..2b4b8eea --- /dev/null +++ b/bin/omarchy-hyprland-monitor-focused @@ -0,0 +1,5 @@ +#!/bin/bash + +# Print the name of the currently focused Hyprland monitor. + +hyprctl monitors -j | jq -r '.[] | select(.focused == true).name' diff --git a/bin/omarchy-hyprland-monitor-internal-toggle b/bin/omarchy-hyprland-monitor-internal-toggle new file mode 100755 index 00000000..325f7589 --- /dev/null +++ b/bin/omarchy-hyprland-monitor-internal-toggle @@ -0,0 +1,22 @@ +#!/bin/bash + +# Toggle the internal laptop display on/off. +# Useful when connected to an external monitor and you want to close the lid +# or just use the external display only. + +INTERNAL=$(hyprctl monitors all -j | jq -r '.[] | select(.name | startswith("eDP")) | .name') + +if [[ -z $INTERNAL ]]; then + notify-send -u low "󰍹 No internal display found" + exit 1 +fi + +DISABLED=$(hyprctl monitors all -j | jq -r --arg m "$INTERNAL" '.[] | select(.name == $m) | .disabled') + +if [[ $DISABLED == "true" ]]; then + hyprctl keyword monitor "$INTERNAL,preferred,auto,auto" + notify-send -u low "󰍹 Internal display on" +else + hyprctl keyword monitor "$INTERNAL,disable" + notify-send -u low "󰍹 Internal display off" +fi diff --git a/bin/omarchy-hyprland-monitor-scaling-cycle b/bin/omarchy-hyprland-monitor-scaling-cycle index a3b24243..233ec06c 100755 --- a/bin/omarchy-hyprland-monitor-scaling-cycle +++ b/bin/omarchy-hyprland-monitor-scaling-cycle @@ -18,7 +18,5 @@ case "$CURRENT_INT" in *) NEW_SCALE=1 ;; esac -hyprctl keyword misc:disable_scale_notification true hyprctl keyword monitor "$ACTIVE_MONITOR,${WIDTH}x${HEIGHT}@${REFRESH_RATE},auto,$NEW_SCALE" -hyprctl keyword misc:disable_scale_notification false notify-send -u low "󰍹 Display scaling set to ${NEW_SCALE}x" diff --git a/bin/omarchy-launch-screensaver b/bin/omarchy-launch-screensaver index 03d1159a..aab3cb0e 100755 --- a/bin/omarchy-launch-screensaver +++ b/bin/omarchy-launch-screensaver @@ -18,7 +18,7 @@ fi # Silently quit Walker on overlay walker -q -focused=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name') +focused=$(omarchy-hyprland-monitor-focused) terminal=$(xdg-terminal-exec --print-id) for m in $(hyprctl monitors -j | jq -r '.[] | .name'); do diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 53d2b4cf..92fdd952 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -168,7 +168,7 @@ show_share_menu() { } show_toggle_menu() { - case $(menu "Toggle" "󱄄 Screensaver\n󰔎 Nightlight\n󱫖 Idle Lock\n󰍜 Top Bar\n󱂬 Workspace Layout\n Window Gaps\n 1-Window Ratio\n󰍹 Display Scaling") in + case $(menu "Toggle" "󱄄 Screensaver\n󰔎 Nightlight\n󱫖 Idle Lock\n󰍜 Top Bar\n󱂬 Workspace Layout\n Window Gaps\n 1-Window Ratio\n󰍹 Monitor Scaling\n󰛧 Laptop Display") in *Screensaver*) omarchy-toggle-screensaver ;; *Nightlight*) omarchy-toggle-nightlight ;; @@ -178,6 +178,7 @@ show_toggle_menu() { *Ratio*) omarchy-hyprland-window-single-square-aspect-toggle ;; *Gaps*) omarchy-hyprland-window-gaps-toggle ;; *Scaling*) omarchy-hyprland-monitor-scaling-cycle ;; + *Laptop*) omarchy-hyprland-monitor-internal-toggle ;; *) back_to show_trigger_menu ;; esac } diff --git a/bin/omarchy-npx-install b/bin/omarchy-npx-install index 3c294c7b..2ec926d9 100755 --- a/bin/omarchy-npx-install +++ b/bin/omarchy-npx-install @@ -18,7 +18,7 @@ mkdir -p "$HOME/.local/bin" cat > "$HOME/.local/bin/$command" < /dev/null + sleep 1 + echo "$I2C_DEVICE" | sudo tee /sys/bus/i2c/drivers/i2c_hid_acpi/bind > /dev/null + echo "Done" +done + +# Also try THC path +if lsmod | grep -q intel_quicki2c; then + echo "Reloading intel_quicki2c..." + sudo modprobe -r intel_quicki2c && sudo modprobe intel_quicki2c +fi diff --git a/bin/omarchy-swayosd-brightness b/bin/omarchy-swayosd-brightness index 1fb492a1..0dbe44d2 100755 --- a/bin/omarchy-swayosd-brightness +++ b/bin/omarchy-swayosd-brightness @@ -9,7 +9,7 @@ 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')" \ + --monitor "$(omarchy-hyprland-monitor-focused)" \ --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 index 4c0a30bb..bf51d749 100755 --- a/bin/omarchy-swayosd-kbd-brightness +++ b/bin/omarchy-swayosd-kbd-brightness @@ -9,7 +9,7 @@ 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')" \ + --monitor "$(omarchy-hyprland-monitor-focused)" \ --custom-icon keyboard-brightness \ --custom-progress "$progress" \ --custom-progress-text "${percent}%" diff --git a/bin/omarchy-update b/bin/omarchy-update index 76fb755b..a9b2ba8d 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -2,6 +2,13 @@ set -e +# Run the update inside a PTY so pacman/yay keep showing download progress +# while still logging the full session for later analysis. +if [[ -z $OMARCHY_UPDATE_LOGGED ]]; then + script_command=$(printf '%q ' "$0" "$@") + exec env OMARCHY_UPDATE_LOGGED=1 script -qefc "$script_command" "/tmp/omarchy-update.log" +fi + 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 diff --git a/bin/omarchy-update-git b/bin/omarchy-update-git index 42516230..04e428bb 100755 --- a/bin/omarchy-update-git +++ b/bin/omarchy-update-git @@ -6,5 +6,10 @@ echo -e "\e[32mUpdate Omarchy\e[0m" omarchy-update-time +# Suppress Hyprland config errors while git updates default config files mid-pull +hyprctl keyword debug:suppress_errors true &>/dev/null || true + git -C $OMARCHY_PATH pull --autostash git -C $OMARCHY_PATH --no-pager diff --check || git -C $OMARCHY_PATH reset --merge + +hyprctl reload &>/dev/null || true diff --git a/bin/omarchy-update-perform b/bin/omarchy-update-perform index 8965c0c2..d98b96c3 100755 --- a/bin/omarchy-update-perform +++ b/bin/omarchy-update-perform @@ -2,13 +2,6 @@ set -e -# Run the update inside a PTY so pacman/yay keep showing download progress -# while still logging the full session for later analysis. -if [[ -z $OMARCHY_UPDATE_LOGGED ]]; then - script_command=$(printf '%q ' "$0" "$@") - exec env OMARCHY_UPDATE_LOGGED=1 script -qefc "$script_command" "/tmp/omarchy-update.log" -fi - # Ensure screensaver/sleep doesn't set in during updates hyprctl dispatch tagwindow +noidle &>/dev/null || true diff --git a/config/autostart/org.fcitx.Fcitx5.desktop b/config/autostart/org.fcitx.Fcitx5.desktop new file mode 100644 index 00000000..e1e3e173 --- /dev/null +++ b/config/autostart/org.fcitx.Fcitx5.desktop @@ -0,0 +1,2 @@ +[Desktop Entry] +Hidden=true diff --git a/default/bash/init b/default/bash/init index 4c5e6e39..2d363fa7 100644 --- a/default/bash/init +++ b/default/bash/init @@ -2,7 +2,7 @@ if command -v mise &> /dev/null; then eval "$(mise activate bash)" fi -if command -v starship &> /dev/null; then +if [[ $- == *i* ]] && [[ ${TERM:-} != "dumb" ]] && command -v starship &> /dev/null; then eval "$(starship init bash)" fi diff --git a/default/hypr/bindings/media.conf b/default/hypr/bindings/media.conf index 9506ff41..88763037 100644 --- a/default/hypr/bindings/media.conf +++ b/default/hypr/bindings/media.conf @@ -1,11 +1,11 @@ # Only display the OSD on the currently focused monitor -$osdclient = swayosd-client --monitor "$(hyprctl monitors -j | jq -r '.[] | select(.focused == true).name')" +$osdclient = swayosd-client --monitor "$(omarchy-hyprland-monitor-focused)" # Laptop multimedia keys for volume and LCD brightness (with OSD) bindeld = ,XF86AudioRaiseVolume, Volume up, exec, $osdclient --output-volume raise 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 = ,XF86AudioMicMute, Mute microphone, exec, omarchy-cmd-mic-mute 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 diff --git a/default/hypr/looknfeel.conf b/default/hypr/looknfeel.conf index cd3417bd..b73c9548 100644 --- a/default/hypr/looknfeel.conf +++ b/default/hypr/looknfeel.conf @@ -122,6 +122,7 @@ master { misc { disable_hyprland_logo = true disable_splash_rendering = true + disable_scale_notification = true focus_on_activate = true anr_missed_pings = 3 on_focus_under_fullscreen = 1 diff --git a/install/config/all.sh b/install/config/all.sh index 79383094..e7c962be 100644 --- a/install/config/all.sh +++ b/install/config/all.sh @@ -15,7 +15,6 @@ run_logged $OMARCHY_INSTALL/config/fix-powerprofilesctl-shebang.sh run_logged $OMARCHY_INSTALL/config/docker.sh run_logged $OMARCHY_INSTALL/config/mimetypes.sh run_logged $OMARCHY_INSTALL/config/nautilus-python.sh -run_logged $OMARCHY_INSTALL/config/remove-fcitx5-autostart.sh run_logged $OMARCHY_INSTALL/config/localdb.sh run_logged $OMARCHY_INSTALL/config/walker-elephant.sh run_logged $OMARCHY_INSTALL/config/fast-shutdown.sh @@ -24,7 +23,6 @@ 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/plocate-ac-only.sh diff --git a/install/config/hardware/dell/fix-xps-haptic-touchpad.sh b/install/config/hardware/dell/fix-xps-haptic-touchpad.sh index 427f3783..dd079611 100644 --- a/install/config/hardware/dell/fix-xps-haptic-touchpad.sh +++ b/install/config/hardware/dell/fix-xps-haptic-touchpad.sh @@ -1,5 +1,5 @@ # Fix Dell XPS haptic touchpad. -# The Synaptics haptic touchpad (06CB:D01A) uses the HID Manual Trigger +# The Synaptics haptic touchpad (vendor 06CB) uses the HID Manual Trigger # protocol, but the kernel's HID haptic subsystem only supports Auto Trigger. # This sets up a lightweight daemon that monitors touchpad button events and # sends haptic pulses via HID feature reports on the hidraw device. diff --git a/install/config/hardware/dell/fix-xps-ptl-display.sh b/install/config/hardware/dell/fix-xps-ptl-display.sh index 6bd18c2e..17941e2c 100644 --- a/install/config/hardware/dell/fix-xps-ptl-display.sh +++ b/install/config/hardware/dell/fix-xps-ptl-display.sh @@ -1,21 +1,21 @@ # Fix display issues on Dell XPS 2026+ with LG OLED panel and Intel Panther Lake (Xe3) GPU. -# Power-saving features cause the screen to run at 10hz. +# Power-saving features (PSR and Panel Replay) cause freezes and display glitches. if omarchy-hw-match "XPS" \ && omarchy-hw-intel-ptl \ && test "$(od -An -tx1 -j8 -N2 /sys/class/drm/card*-eDP-*/edid 2>/dev/null | tr -d ' \n')" = "30e4"; then echo "Detected Dell XPS with LG OLED panel on Panther Lake, applying display power-saving fix..." - CMDLINE='KERNEL_CMDLINE[default]+=" xe.enable_panel_replay=0"' + CMDLINE='KERNEL_CMDLINE[default]+=" xe.enable_psr=0 xe.enable_panel_replay=0"' sudo mkdir -p /etc/limine-entry-tool.d cat </dev/null -# Fix Dell XPS OLED display issues by disabling Xe PSR2 power-saving feature +# Fix Dell XPS OLED display issues by disabling Xe PSR and Panel Replay power-saving features $CMDLINE EOF # Also append to /etc/default/limine if it exists, since it overrides drop-in configs - if [ -f /etc/default/limine ] && ! grep -q 'xe.enable_panel_replay' /etc/default/limine; then + if [ -f /etc/default/limine ] && ! grep -q 'xe.enable_psr' /etc/default/limine; then echo "$CMDLINE" | sudo tee -a /etc/default/limine >/dev/null fi fi diff --git a/install/config/hardware/intel/lpmd.sh b/install/config/hardware/intel/lpmd.sh index 8fcfccdb..ad8cf374 100644 --- a/install/config/hardware/intel/lpmd.sh +++ b/install/config/hardware/intel/lpmd.sh @@ -6,5 +6,6 @@ if omarchy-hw-intel && omarchy-battery-present; then cpu_model=$(grep -m1 "^model\s*:" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | tr -d ' ') if [[ "$cpu_model" =~ ^(151|154|170|172|183|186|189|191|204)$ ]]; then omarchy-pkg-add intel-lpmd + sudo systemctl enable intel_lpmd.service fi fi diff --git a/install/config/remove-fcitx5-autostart.sh b/install/config/remove-fcitx5-autostart.sh deleted file mode 100644 index 62cc1790..00000000 --- a/install/config/remove-fcitx5-autostart.sh +++ /dev/null @@ -1 +0,0 @@ -sudo rm -f /etc/xdg/autostart/org.fcitx.Fcitx5.desktop diff --git a/install/config/powerprofilesctl-rules.sh b/install/first-run/powerprofilesctl-rules.sh similarity index 100% rename from install/config/powerprofilesctl-rules.sh rename to install/first-run/powerprofilesctl-rules.sh diff --git a/install/preflight/first-run-mode.sh b/install/preflight/first-run-mode.sh index 536058cc..f56f071b 100644 --- a/install/preflight/first-run-mode.sh +++ b/install/preflight/first-run-mode.sh @@ -10,6 +10,8 @@ $USER ALL=(ALL) NOPASSWD: /usr/bin/systemctl $USER ALL=(ALL) NOPASSWD: /usr/bin/ufw $USER ALL=(ALL) NOPASSWD: /usr/bin/ufw-docker $USER ALL=(ALL) NOPASSWD: /usr/bin/gtk-update-icon-cache +$USER ALL=(ALL) NOPASSWD: /usr/bin/tee /etc/udev/rules.d/* +$USER ALL=(ALL) NOPASSWD: /usr/bin/udevadm $USER ALL=(ALL) NOPASSWD: SYMLINK_RESOLVED $USER ALL=(ALL) NOPASSWD: FIRST_RUN_CLEANUP EOF diff --git a/migrations/1769566732.sh b/migrations/1769566732.sh index f2df93c0..1a5256ea 100644 --- a/migrations/1769566732.sh +++ b/migrations/1769566732.sh @@ -1,3 +1,3 @@ echo "Set power profile based on source switching (AC or Battery)" -source $OMARCHY_PATH/install/config/powerprofilesctl-rules.sh +source $OMARCHY_PATH/install/first-run/powerprofilesctl-rules.sh diff --git a/migrations/1772120972.sh b/migrations/1772120972.sh deleted file mode 100644 index 7ef79f37..00000000 --- a/migrations/1772120972.sh +++ /dev/null @@ -1,3 +0,0 @@ -echo "Remove Fcitx5 XDG autostart desktop entry" - -source $OMARCHY_PATH/install/config/remove-fcitx5-autostart.sh diff --git a/migrations/1775236589.sh b/migrations/1775236589.sh new file mode 100644 index 00000000..f78ef54b --- /dev/null +++ b/migrations/1775236589.sh @@ -0,0 +1,3 @@ +echo "Update npx wrappers to run through mise node@latest" + +source "$OMARCHY_PATH/install/packaging/npx.sh" diff --git a/migrations/1775546086.sh b/migrations/1775546086.sh new file mode 100644 index 00000000..403705ae --- /dev/null +++ b/migrations/1775546086.sh @@ -0,0 +1,5 @@ +echo "Enable Intel LPMD service if installed" + +if pacman -Q intel-lpmd &>/dev/null; then + sudo systemctl enable --now intel_lpmd.service +fi diff --git a/migrations/1775691486.sh b/migrations/1775691486.sh new file mode 100644 index 00000000..e6fdf909 --- /dev/null +++ b/migrations/1775691486.sh @@ -0,0 +1,6 @@ +echo "Copy Fcitx5 autostart desktop file to ~/.config/autostart" + +mkdir -p ~/.config/autostart/ +cp "$OMARCHY_PATH/config/autostart/org.fcitx.Fcitx5.desktop" ~/.config/autostart/ + +omarchy-restart-xcompose