From a7893c8af46eea024552f8ed1b9c714aebd60dca Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 15 Apr 2026 10:00:49 +0200 Subject: [PATCH 01/10] Catch brave-origin too Closes #5304 Co-authored-by: @Cleptomania --- bin/omarchy-launch-webapp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/omarchy-launch-webapp b/bin/omarchy-launch-webapp index 607ef6ce..71606efa 100755 --- a/bin/omarchy-launch-webapp +++ b/bin/omarchy-launch-webapp @@ -5,7 +5,7 @@ browser=$(xdg-settings get default-web-browser) case $browser in -google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi* | helium*) ;; +google-chrome* | brave* | microsoft-edge* | opera* | vivaldi* | helium*) ;; *) browser="chromium.desktop" ;; esac From 092b16489de1a34b9ab974d832477e829c854165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor?= Date: Wed, 15 Apr 2026 05:03:15 -0300 Subject: [PATCH 02/10] Add Logitech MX Keys key bindings (#5301) * Add Logitech MX Keys key bindings * Update config/hypr/bindings.conf Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update config/hypr/bindings.conf Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- config/hypr/bindings.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/hypr/bindings.conf b/config/hypr/bindings.conf index 62ad87c6..351fbe46 100644 --- a/config/hypr/bindings.conf +++ b/config/hypr/bindings.conf @@ -32,3 +32,8 @@ bindd = SUPER SHIFT ALT, X, X Post, exec, omarchy-launch-webapp "https://x.com/c # Overwrite existing bindings, like putting Omarchy Menu on Super + Space # unbind = SUPER, SPACE # bindd = SUPER, SPACE, Omarchy menu, exec, omarchy-menu + +# Logitech MX Keys +# bind = SUPER SHIFT, S, exec, omarchy-cmd-screenshot # Print Screen Button +# bind = SUPER, H, exec, voxtype record toggle # Dictation Button +# bind = SUPER, PERIOD, exec, omarchy-launch-walker -m symbols # Emoji Button From 0204db05784cabe34bcf0e25d515bbc0b4fbe56c Mon Sep 17 00:00:00 2001 From: Liam Mitchell Date: Wed, 15 Apr 2026 10:07:39 +0200 Subject: [PATCH 03/10] Fix intel video acceleration migration scripts (#5288) --- migrations/1757483378.sh | 2 +- migrations/1772981757.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/1757483378.sh b/migrations/1757483378.sh index 999e4f06..a0c8d1bb 100644 --- a/migrations/1757483378.sh +++ b/migrations/1757483378.sh @@ -1,4 +1,4 @@ echo "6Ghz Wi-Fi + Intel graphics acceleration for existing installations" bash "$OMARCHY_PATH/install/config/hardware/set-wireless-regdom.sh" -bash "$OMARCHY_PATH/install/config/hardware/intel.sh" +bash "$OMARCHY_PATH/install/config/hardware/intel/video-acceleration.sh" diff --git a/migrations/1772981757.sh b/migrations/1772981757.sh index 145938b6..e19c9301 100644 --- a/migrations/1772981757.sh +++ b/migrations/1772981757.sh @@ -1,5 +1,5 @@ echo "Install Intel GPU hardware acceleration drivers if missing" if lspci | grep -iE 'vga|3d|display' | grep -qi 'intel'; then - source "$OMARCHY_PATH/install/config/hardware/intel.sh" + source "$OMARCHY_PATH/install/config/hardware/intel/video-acceleration.sh" fi From a43915f91da002573c225ef38b8731c725b10640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=BCndel?= Date: Wed, 15 Apr 2026 10:13:37 +0200 Subject: [PATCH 04/10] update btop.conf for v1.4.6 (#5286) --- config/btop/btop.conf | 120 +++++++++++++++++++++++++----------------- 1 file changed, 73 insertions(+), 47 deletions(-) diff --git a/config/btop/btop.conf b/config/btop/btop.conf index c150ea0a..b53509d2 100644 --- a/config/btop/btop.conf +++ b/config/btop/btop.conf @@ -1,18 +1,18 @@ -#? Config file for btop +#? Config file for btop v.1.4.6 #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" color_theme = "current" #* If the theme set background should be shown, set to False if you want terminal background transparency. -theme_background = True +theme_background = true #* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. -truecolor = True +truecolor = true #* Set to true to force tty mode regardless if a real tty has been detected or not. #* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols. -force_tty = False +force_tty = false #* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets. #* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box. @@ -22,10 +22,13 @@ presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:defaul #* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. #* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. -vim_keys = True +vim_keys = true #* Rounded corners on boxes, is ignored if TTY mode is ON. -rounded_corners = True +rounded_corners = true + +#* Use terminal synchronized output sequences to reduce flickering on supported terminals. +terminal_sync = true #* Default symbols to use for graph creation, "braille", "block" or "tty". #* "braille" offers the highest resolution but might not be included in all fonts. @@ -60,37 +63,40 @@ update_ms = 2000 proc_sorting = "cpu lazy" #* Reverse sorting order, True or False. -proc_reversed = False +proc_reversed = false #* Show processes as a tree. -proc_tree = False +proc_tree = false #* Use the cpu graph colors in the process list. -proc_colors = True +proc_colors = true #* Use a darkening gradient in the process list. -proc_gradient = True +proc_gradient = true #* If process cpu usage should be of the core it's running on or usage of the total available cpu power. -proc_per_core = False +proc_per_core = false #* Show process memory as bytes instead of percent. -proc_mem_bytes = True +proc_mem_bytes = true #* Show cpu graph for each process. -proc_cpu_graphs = True +proc_cpu_graphs = true #* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate) -proc_info_smaps = False +proc_info_smaps = false #* Show proc box on left side of screen instead of right. -proc_left = False +proc_left = false #* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop). -proc_filter_kernel = False +proc_filter_kernel = false #* In tree-view, always accumulate child process resources in the parent process. -proc_aggregate = False +proc_aggregate = false + +#* Should cpu and memory usage display be preserved for dead processes when paused. +keep_dead_proc_usage = false #* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available. #* Select from a list of detected attributes from the options menu. @@ -104,25 +110,28 @@ cpu_graph_lower = "Auto" show_gpu_info = "Auto" #* Toggles if the lower CPU graph should be inverted. -cpu_invert_lower = True +cpu_invert_lower = true #* Set to True to completely disable the lower CPU graph. -cpu_single_graph = False +cpu_single_graph = false #* Show cpu box at bottom of screen instead of top. -cpu_bottom = False +cpu_bottom = false #* Shows the system uptime in the CPU box. -show_uptime = True +show_uptime = true + +#* Shows the CPU package current power consumption in watts. Requires running `make setcap` or `make setuid` or running with sudo. +show_cpu_watts = true #* Show cpu temperature. -check_temp = True +check_temp = true #* Which sensor to use for cpu temperature, use options menu to select from list of available sensors. cpu_sensor = "Auto" #* Show temperatures for cpu cores also if check_temp is True and sensors has been found. -show_coretemp = True +show_coretemp = true #* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core. #* Use lm-sensors or similar to see which cores are reporting temperatures on your machine. @@ -134,63 +143,66 @@ cpu_core_map = "" temp_scale = "celsius" #* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. -base_10_sizes = False +base_10_sizes = false #* Show CPU frequency. -show_cpu_freq = True +show_cpu_freq = true + +#* How to calculate CPU frequency, available values: "first", "range", "lowest", "highest" and "average". +freq_mode = "first" #* Draw a clock at top of screen, formatting according to strftime, empty string to disable. #* Special formatting: /host = hostname | /user = username | /uptime = system uptime clock_format = "%X" #* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort. -background_update = True +background_update = true #* Custom cpu model name, empty string to disable. custom_cpu_name = "" #* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ". -#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user". +#* Only disks matching the filter will be shown. Prepend exclude= to only show disks not matching the filter. Examples: disk_filter="/boot /home/user", disks_filter="exclude=/boot /home/user" disks_filter = "" #* Show graphs instead of meters for memory values. -mem_graphs = True +mem_graphs = true #* Show mem box below net box instead of above. -mem_below_net = False +mem_below_net = false #* Count ZFS ARC in cached and available memory. -zfs_arc_cached = True +zfs_arc_cached = true #* If swap memory should be shown in memory box. -show_swap = True +show_swap = true #* Show swap as a disk, ignores show_swap value above, inserts itself after first disk. -swap_disk = True +swap_disk = true #* If mem box should be split to also show disks info. -show_disks = True +show_disks = true #* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. -only_physical = True +only_physical = true #* Read disks list from /etc/fstab. This also disables only_physical. -use_fstab = True +use_fstab = true #* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool) -zfs_hide_datasets = False +zfs_hide_datasets = false #* Set to true to show available disk space for privileged users. -disk_free_priv = False +disk_free_priv = false #* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. -show_io_stat = True +show_io_stat = true #* Toggles io mode for disks, showing big graphs for disk read/write speeds. -io_mode = False +io_mode = false #* Set to True to show combined read/write io graphs in io mode. -io_graph_combined = False +io_graph_combined = false #* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ". #* Example: "/mnt/media:100 /:20 /boot:1". @@ -202,29 +214,44 @@ net_download = 100 net_upload = 100 #* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest. -net_auto = True +net_auto = true #* Sync the auto scaling for download and upload to whichever currently has the highest scale. -net_sync = True +net_sync = true #* Starts with the Network Interface specified here. net_iface = "" +#* "True" shows bitrates in base 10 (Kbps, Mbps). "False" shows bitrates in binary sizes (Kibps, Mibps, etc.). "Auto" uses base_10_sizes. +base_10_bitrate = "Auto" + #* Show battery stats in top right if battery is present. -show_battery = True +show_battery = true #* Which battery to use if multiple are present. "Auto" for auto detection. selected_battery = "Auto" -#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". +#* Show power stats of battery next to charge indicator. +show_battery_watts = true + +#* Set loglevel for "~/.local/state/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". #* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. log_level = "WARNING" +#* Automatically save current settings to config file on exit. +save_config_on_exit = true + #* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards. -nvml_measure_pcie_speeds = True +nvml_measure_pcie_speeds = true + +#* Measure PCIe throughput on AMD cards, may impact performance on certain cards. +rsmi_measure_pcie_speeds = true #* Horizontally mirror the GPU graph. -gpu_mirror_graph = True +gpu_mirror_graph = true + +#* Set which GPU vendors to show. Available values are "nvidia amd intel" +shown_gpus = "nvidia amd intel" #* Custom gpu0 model name, empty string to disable. custom_gpu_name0 = "" @@ -243,4 +270,3 @@ custom_gpu_name4 = "" #* Custom gpu5 model name, empty string to disable. custom_gpu_name5 = "" - From 18ab3421194e99e7d79588f0e6d5214046ca59ef Mon Sep 17 00:00:00 2001 From: Felipe Gonzalez Date: Wed, 15 Apr 2026 03:14:07 -0500 Subject: [PATCH 05/10] fix: suppress Chromium/Brave stderr noise during theme switch (#5285) Redirect stderr to /dev/null alongside stdout when refreshing browser platform policy, preventing shared_memory_switch errors from cluttering the terminal. --- bin/omarchy-theme-set-browser | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/omarchy-theme-set-browser b/bin/omarchy-theme-set-browser index 9278e90d..a069c167 100755 --- a/bin/omarchy-theme-set-browser +++ b/bin/omarchy-theme-set-browser @@ -14,11 +14,11 @@ if omarchy-cmd-present chromium || omarchy-cmd-present brave; then if omarchy-cmd-present chromium; then echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\", \"BrowserColorScheme\": \"device\"}" | tee "/etc/chromium/policies/managed/color.json" >/dev/null - chromium --refresh-platform-policy --no-startup-window >/dev/null + chromium --refresh-platform-policy --no-startup-window &>/dev/null fi if omarchy-cmd-present brave; then echo "{\"BrowserThemeColor\": \"$THEME_HEX_COLOR\", \"BrowserColorScheme\": \"device\"}" | tee "/etc/brave/policies/managed/color.json" >/dev/null - brave --refresh-platform-policy --no-startup-window >/dev/null + brave --refresh-platform-policy --no-startup-window &>/dev/null fi fi From a49b8d255cb20a453a940dab2660a6d27a73fd8b Mon Sep 17 00:00:00 2001 From: Marco <77896841+annoyedmilk@users.noreply.github.com> Date: Wed, 15 Apr 2026 10:28:42 +0200 Subject: [PATCH 06/10] Fix AC power udev rules failing silently at boot (#5275) * Don't use the names here since they break the all-themes setup in omarchy-nvim * Fix AC power udev rules to use systemd-run * Migrate AC power udev rules to systemd-run * Add --collect and stable unit names to systemd-run udev rules * Add unit name, replace, and After ordering to power profile udev rules * Remove invalid --replace flag from systemd-run power profile rules * We don't need --replace becuase it's not needed --------- Co-authored-by: David Heinemeier Hansson --- install/config/wifi-powersave-rules.sh | 4 ++-- install/first-run/powerprofilesctl-rules.sh | 4 ++-- migrations/1775897694.sh | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 migrations/1775897694.sh diff --git a/install/config/wifi-powersave-rules.sh b/install/config/wifi-powersave-rules.sh index 08b8d49b..55739059 100644 --- a/install/config/wifi-powersave-rules.sh +++ b/install/config/wifi-powersave-rules.sh @@ -1,7 +1,7 @@ if omarchy-battery-present; then cat < Date: Wed, 15 Apr 2026 10:36:45 +0200 Subject: [PATCH 07/10] No longer need first-run to set these powerprofilectl rules --- bin/omarchy-cmd-first-run | 1 - install/config/all.sh | 1 + install/{first-run => config}/powerprofilesctl-rules.sh | 0 migrations/1769566732.sh | 2 +- migrations/1775897694.sh | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) rename install/{first-run => config}/powerprofilesctl-rules.sh (100%) diff --git a/bin/omarchy-cmd-first-run b/bin/omarchy-cmd-first-run index a1734cfb..830bef54 100755 --- a/bin/omarchy-cmd-first-run +++ b/bin/omarchy-cmd-first-run @@ -15,7 +15,6 @@ 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/install/config/all.sh b/install/config/all.sh index e7c962be..6b2f3dfa 100644 --- a/install/config/all.sh +++ b/install/config/all.sh @@ -23,6 +23,7 @@ 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/first-run/powerprofilesctl-rules.sh b/install/config/powerprofilesctl-rules.sh similarity index 100% rename from install/first-run/powerprofilesctl-rules.sh rename to install/config/powerprofilesctl-rules.sh diff --git a/migrations/1769566732.sh b/migrations/1769566732.sh index 1a5256ea..f2df93c0 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/first-run/powerprofilesctl-rules.sh +source $OMARCHY_PATH/install/config/powerprofilesctl-rules.sh diff --git a/migrations/1775897694.sh b/migrations/1775897694.sh index aeeefc34..a5935a03 100644 --- a/migrations/1775897694.sh +++ b/migrations/1775897694.sh @@ -1,4 +1,4 @@ echo "Fix AC power udev rules to use systemd-run" -source $OMARCHY_PATH/install/config/powerprofilesctl-rules.sh +source $OMARCHY_PATH/install/first-run/powerprofilesctl-rules.sh source $OMARCHY_PATH/install/config/wifi-powersave-rules.sh From 9389c1f57ad49de12abeb9c1e8ef7048f08725cf Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 15 Apr 2026 10:39:21 +0200 Subject: [PATCH 08/10] Fix path --- migrations/1775897694.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/1775897694.sh b/migrations/1775897694.sh index a5935a03..aeeefc34 100644 --- a/migrations/1775897694.sh +++ b/migrations/1775897694.sh @@ -1,4 +1,4 @@ echo "Fix AC power udev rules to use systemd-run" -source $OMARCHY_PATH/install/first-run/powerprofilesctl-rules.sh +source $OMARCHY_PATH/install/config/powerprofilesctl-rules.sh source $OMARCHY_PATH/install/config/wifi-powersave-rules.sh From f7dc63ca72ebb361b78ae284ff47bed6b42bb7e5 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 15 Apr 2026 02:26:37 -0700 Subject: [PATCH 09/10] Work around the return-from-sleep sluggishness on panther lake This is due to slow ramp after s2idle --- default/systemd/system-sleep/resume-boost | 10 ++++++++++ install/config/all.sh | 1 + install/config/hardware/intel/resume-boost.sh | 8 ++++++++ 3 files changed, 19 insertions(+) create mode 100755 default/systemd/system-sleep/resume-boost create mode 100644 install/config/hardware/intel/resume-boost.sh diff --git a/default/systemd/system-sleep/resume-boost b/default/systemd/system-sleep/resume-boost new file mode 100755 index 00000000..0ce02d94 --- /dev/null +++ b/default/systemd/system-sleep/resume-boost @@ -0,0 +1,10 @@ +#!/bin/bash + +# Temporarily switch to performance power profile on resume +# to avoid sluggishness while the system catches up, then +# drop back to balanced after 10 seconds. + +if [[ $1 == "post" ]]; then + powerprofilesctl set performance + (sleep 10 && powerprofilesctl set balanced) & +fi diff --git a/install/config/all.sh b/install/config/all.sh index 6b2f3dfa..b09332e6 100644 --- a/install/config/all.sh +++ b/install/config/all.sh @@ -43,6 +43,7 @@ run_logged $OMARCHY_INSTALL/config/hardware/intel/thermald.sh run_logged $OMARCHY_INSTALL/config/hardware/intel/ipu7-camera.sh run_logged $OMARCHY_INSTALL/config/hardware/intel/ptl-kernel.sh run_logged $OMARCHY_INSTALL/config/hardware/intel/fix-wifi7-eht.sh +run_logged $OMARCHY_INSTALL/config/hardware/intel/resume-boost.sh run_logged $OMARCHY_INSTALL/config/hardware/dell/fix-xps-haptic-touchpad.sh run_logged $OMARCHY_INSTALL/config/hardware/dell/fix-xps-ptl-display.sh diff --git a/install/config/hardware/intel/resume-boost.sh b/install/config/hardware/intel/resume-boost.sh new file mode 100644 index 00000000..8a1f48cd --- /dev/null +++ b/install/config/hardware/intel/resume-boost.sh @@ -0,0 +1,8 @@ +# Boost CPU performance for 10 seconds after resume on Panther Lake systems. +# The powersave governor with balance_power EPP is slow to ramp frequency +# after long suspends, causing noticeable sluggishness on wake. + +if omarchy-hw-intel-ptl; then + sudo mkdir -p /usr/lib/systemd/system-sleep + sudo install -m 0755 -o root -g root "$OMARCHY_PATH/default/systemd/system-sleep/resume-boost" /usr/lib/systemd/system-sleep/ +fi From 0017f2eab02ad8ba509f4d54382a54c0afc904ea Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 15 Apr 2026 11:49:02 +0200 Subject: [PATCH 10/10] Make hibernation offset safer --- bin/omarchy-hibernation-setup | 25 ++++++++++++++++++++----- migrations/1776246235.sh | 17 +++++++++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 migrations/1776246235.sh diff --git a/bin/omarchy-hibernation-setup b/bin/omarchy-hibernation-setup index 0ebca84f..482e5470 100755 --- a/bin/omarchy-hibernation-setup +++ b/bin/omarchy-hibernation-setup @@ -14,9 +14,22 @@ if ! command -v limine-mkinitcpio &>/dev/null; then fi MKINITCPIO_CONF="/etc/mkinitcpio.conf.d/omarchy_resume.conf" +SWAP_FILE="/swap/swapfile" +RESUME_DROP_IN="/etc/limine-entry-tool.d/resume.conf" # Check if hibernation is already configured if [[ -f $MKINITCPIO_CONF ]] && grep -q "^HOOKS+=(resume)$" "$MKINITCPIO_CONF"; then + # Fix empty resume_offset if btrfs map-swapfile failed during initial setup + if [[ -f $RESUME_DROP_IN ]] && grep -q 'resume_offset="$' "$RESUME_DROP_IN" && [[ -f $SWAP_FILE ]]; then + RESUME_OFFSET=$(sudo btrfs inspect-internal map-swapfile -r "$SWAP_FILE" 2>/dev/null) + if [[ -n $RESUME_OFFSET ]]; then + echo "Fixing empty resume_offset ($RESUME_OFFSET)" + sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" "$RESUME_DROP_IN" + sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" /etc/default/limine + sudo limine-mkinitcpio + sudo limine-update + fi + fi echo "Hibernation is already set up" exit 0 fi @@ -29,7 +42,6 @@ if [[ $1 != "--force" ]]; then fi SWAP_SUBVOLUME="/swap" -SWAP_FILE="$SWAP_SUBVOLUME/swapfile" # Create btrfs subvolume for swap if ! sudo btrfs subvolume show "$SWAP_SUBVOLUME" &>/dev/null; then @@ -68,15 +80,18 @@ sudo cp -p "$OMARCHY_PATH/default/systemd/system-sleep/keyboard-backlight" /usr/ # 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=$(sudo 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 - sudo tee -a /etc/default/limine < "$RESUME_DROP_IN" >/dev/null + if [[ -n $RESUME_OFFSET ]]; then + 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 + sudo tee -a /etc/default/limine < "$RESUME_DROP_IN" >/dev/null + else + echo "Warning: Could not determine resume offset for $SWAP_FILE" >&2 + fi fi # Use ACPI alarm for RTC wakeup on s2idle systems (needed for suspend-then-hibernate) diff --git a/migrations/1776246235.sh b/migrations/1776246235.sh new file mode 100644 index 00000000..a58be056 --- /dev/null +++ b/migrations/1776246235.sh @@ -0,0 +1,17 @@ +echo "Fix empty resume_offset in hibernation config" + +RESUME_DROP_IN="/etc/limine-entry-tool.d/resume.conf" +SWAP_FILE="/swap/swapfile" + +if [[ -f $RESUME_DROP_IN ]] && grep -q 'resume_offset="$' "$RESUME_DROP_IN" && [[ -f $SWAP_FILE ]]; then + RESUME_OFFSET=$(sudo btrfs inspect-internal map-swapfile -r "$SWAP_FILE" 2>/dev/null) + if [[ -n $RESUME_OFFSET ]]; then + sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" "$RESUME_DROP_IN" + sudo sed -i "s/resume_offset=\"$/resume_offset=$RESUME_OFFSET\"/" /etc/default/limine + sudo limine-mkinitcpio + sudo limine-update + echo "Fixed: resume_offset=$RESUME_OFFSET" + else + echo "Warning: Could not determine resume offset for $SWAP_FILE" + fi +fi