Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion bin/omarchy-cmd-screenshot
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,34 @@ get_rectangles() {
hyprctl clients -j | jq -r --arg ws "$active_workspace" '.[] | select(.workspace.id == ($ws | tonumber)) | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"'
}

# Check if we're on an HDR display (NVIDIA GPUs often have issues with HDR screenshots)
is_hdr_nvidia() {
if command -v nvidia-smi &>/dev/null; then
# Check if any monitor is in HDR mode
hyprctl monitors -j 2>/dev/null | jq -e '.[] | select(.dynamic == true or .activeMonitor != null)' >/dev/null 2>&1
return $?
fi
return 1
}

# Take screenshot with proper color handling for HDR displays
take_screenshot() {
local selection="$1"
local filepath="$2"
local use_wayfreeze="${3:-false}"

if [[ $use_wayfreeze == "true" && -x $(command -v wayfreeze) ]]; then
# Use wayfreeze for HDR displays where hyprpicker causes color issues
wayfreeze -w &
FREEZE_PID=$!
sleep 0.2
grim -g "$selection" "$filepath" || { kill $FREEZE_PID 2>/dev/null; return 1; }
kill $FREEZE_PID 2>/dev/null
else
grim -g "$selection" "$filepath" || return 1
fi
}

# Select based on mode
case "$MODE" in
region)
Expand Down Expand Up @@ -121,7 +149,13 @@ FILENAME="screenshot-$(date +'%Y-%m-%d_%H-%M-%S').png"
FILEPATH="$OUTPUT_DIR/$FILENAME"

if [[ $PROCESSING == "slurp" ]]; then
grim -g "$SELECTION" "$FILEPATH" || exit 1
# Use wayfreeze if available and we have HDR issues, otherwise use hyprpicker
USE_WAYFREEZE="false"
if [[ -x $(command -v wayfreeze) ]]; then
USE_WAYFREEZE="true"
fi

take_screenshot "$SELECTION" "$FILEPATH" "$USE_WAYFREEZE" || exit 1
wl-copy <"$FILEPATH"

(
Expand Down
20 changes: 18 additions & 2 deletions bin/omarchy-launch-walker
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,23 @@ fi

# Ensure walker service is running
if ! pgrep -f "walker --gapplication-service" > /dev/null; then
setsid uwsm-app -- env GSK_RENDERER=cairo walker --gapplication-service &
setsid uwsm-app -- walker --gapplication-service &
fi

exec walker --width 644 --maxheight 300 --minheight 300 "$@"
# Use default settings unless overridden by arguments
WALKER_WIDTH="${WALKER_WIDTH:-644}"
WALKER_MAXHEIGHT="${WALKER_MAXHEIGHT:-300}"
WALKER_MINHEIGHT="${WALKER_MINHEIGHT:-300}"

# Check if --width, --maxheight, --minheight are passed in arguments
if [[ "$*" != *"--width"* ]]; then
WALKER_ARGS+=("--width" "$WALKER_WIDTH")
fi
if [[ "$*" != *"--maxheight"* ]]; then
WALKER_ARGS+=("--maxheight" "$WALKER_MAXHEIGHT")
fi
if [[ "$*" != *"--minheight"* ]]; then
WALKER_ARGS+=("--minheight" "$WALKER_MINHEIGHT")
fi

exec walker "${WALKER_ARGS[@]}" "$@"
1 change: 1 addition & 0 deletions default/hypr/apps.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ source = ~/.local/share/omarchy/default/hypr/apps/typora.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
source = ~/.local/share/omarchy/default/hypr/apps/screen-sharing.conf
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default/hypr/apps/browser.conf already has a rule that moves screen-sharing bars matching .*is sharing.* to a special workspace (hiding them). If the goal is to make the bar clickable (so the Hide button works), that existing rule may still apply and effectively bypass this new config; consider updating/removing the older rule to avoid conflicting behavior.

Suggested change
source = ~/.local/share/omarchy/default/hypr/apps/screen-sharing.conf
# screen-sharing.conf is intentionally not sourced here because browser.conf
# already contains screen-sharing window rules; loading both creates
# conflicting behavior until the older browser rule is updated/removed.

Copilot uses AI. Check for mistakes.
17 changes: 17 additions & 0 deletions default/hypr/apps/screen-sharing.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Screen sharing notification bar fixes
# Fix for: Screen sharing notification bar "Hide" button not responding to clicks
# The notification bar from Chromium/Chrome needs proper input handling

# Note: These rules use Hyprland 0.53+ match: syntax

# WebRTC indicator windows from Chromium should float and not steal focus
# but should still receive input for the Hide button
windowrule = float on, match:title ^(chrome-shill-webui|chrome-webui-media-router)$
windowrule = no_focus on, match:title ^(chrome-shill-webui|chrome-webui-media-router)$

# Screen sharing notification bar - float and receive input
windowrule = float on, match:title .*(screen sharing|Sharing|is sharing|Stop sharing|Hide).*
windowrule = noborder on, match:title .*(screen sharing|Sharing|is sharing|Stop sharing|Hide).*

# Ensure WebRTC indicator layer windows can receive input
# Note: layerrule uses match:namespace for namespace matching
28 changes: 28 additions & 0 deletions install/config/nvidia-chromium-flags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Install Chromium flags for better NVIDIA Wayland stability
# Fix for: System lockups on NVIDIA GPUs when browsing media-heavy sites

CHROMIUM_FLAGS_DIR="$HOME/.config"
mkdir -p "$CHROMIUM_FLAGS_DIR"

# Write NVIDIA-optimized Chromium flags to the config file Omarchy reads
cat > "$CHROMIUM_FLAGS_DIR/chromium-flags.conf" << 'CONFEOF'
# NVIDIA-optimized Chromium flags for Wayland systems with NVIDIA GPUs
--ozone-platform=x11
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder
--disable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan
CONFEOF

# Also set environment variables for Electron apps
NVIDIA_ENV_FILE="$HOME/.config/hypr/envs.conf"
if ! grep -q "OZONE_PLATFORM,x11" "$NVIDIA_ENV_FILE" 2>/dev/null; then
cat >> "$NVIDIA_ENV_FILE" << 'ENVEOF'

# NVIDIA Chromium/Electron stability
env = ELECTRON_OZONE_PLATFORM_HINT,x11
env = OZONE_PLATFORM,x11
ENVEOF
fi

Comment on lines +7 to +27
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omarchy’s Chromium flag management appears to use ~/.config/chromium-flags.conf (see bin/omarchy-refresh-chromium). This installer writes a separate ~/.config/chromium-flags/set-flags script, but nothing in the repo invokes or sources it, so the NVIDIA flags likely never apply.

Suggested change
mkdir -p "$CHROMIUM_FLAGS_DIR"
# Create a helper script that sets NVIDIA-optimized flags
cat > "$HOME/.config/chromium-flags/set-flags" << 'EOF'
#!/bin/bash
# NVIDIA-optimized Chromium flags for Wayland
# Prevents system lockups on media-heavy sites
# Use X11 backend instead of Wayland for Chromium on NVIDIA
# Wayland + NVIDIA + Chromium can cause lockups
export CHROMIUM_FLAGS="--ozone-platform=x11 --enable-features=VaapiVideoDecoder,VaapiVideoEncoder --disable-features=Vulkan, VulkanFromANGLE, DefaultANGLEVulkan"
# Apply to Electron apps too
export ELECTRON_OZONE_PLATFORM_HINT=x11
EOF
chmod +x "$HOME/.config/chromium-flags/set-flags"
CHROMIUM_FLAGS_FILE="$HOME/.config/chromium-flags.conf"
mkdir -p "$CHROMIUM_FLAGS_DIR"
# Write NVIDIA-optimized Chromium flags to the config file Omarchy reads
cat > "$CHROMIUM_FLAGS_FILE" << 'EOF'
# NVIDIA-optimized Chromium flags for Wayland systems with NVIDIA GPUs
--ozone-platform=x11
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder
--disable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan
EOF

Copilot uses AI. Check for mistakes.
notify-send "NVIDIA Chromium flags installed" "Stability improvements applied for NVIDIA GPUs"
22 changes: 22 additions & 0 deletions migrations/1777007316.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Fix screen sharing notification bar "Hide" button not responding
# See: https://github.com/basecamp/omarchy/issues/5373

echo "Adding screen sharing notification bar fixes"

# Add screen-sharing.conf to the app configs if it doesn't exist
SCREEN_SHARING_CONF="$HOME/.config/hypr/apps/screen-sharing.conf"
if [[ ! -f $SCREEN_SHARING_CONF ]]; then
cat > "$SCREEN_SHARING_CONF" << 'CONFEOF'
# Screen sharing notification bar fixes
# Fix for: Screen sharing notification bar "Hide" button not responding to clicks
# The notification bar from Chromium/Chrome needs to be on a layer that receives input

# Ensure notification popups from browsers receive input
windowrule = float, class:^(chrome|chromium|brave|microsoft-edge),title:.*(screen sharing|Sharing|is sharing|Stop sharing|Hide)
windowrule = noborder, class:^(chrome|chromium|brave|microsoft-edge),title:.*(screen sharing|Sharing|is sharing|Stop sharing|Hide)
windowrule = noblur, class:^(chrome|chromium|brave|microsoft-edge),title:.*(screen sharing|Sharing|is sharing|Stop sharing|Hide)
Comment on lines +17 to +19
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The windowrule syntax emitted by this migration (class:/title: qualifiers and windowrule = float without match: selectors) doesn’t match the Hyprland 0.53+ syntax used in the shipped configs. This likely results in the rules being ignored, so the migration wouldn’t fix #5373.

Suggested change
windowrule = float, class:^(chrome|chromium|brave|microsoft-edge),title:.*(screen sharing|Sharing|is sharing|Stop sharing|Hide)
windowrule = noborder, class:^(chrome|chromium|brave|microsoft-edge),title:.*(screen sharing|Sharing|is sharing|Stop sharing|Hide)
windowrule = noblur, class:^(chrome|chromium|brave|microsoft-edge),title:.*(screen sharing|Sharing|is sharing|Stop sharing|Hide)
windowrule = float, match:(class:^(chrome|chromium|brave|microsoft-edge)$,title:.*(screen sharing|Sharing|is sharing|Stop sharing|Hide))
windowrule = noborder, match:(class:^(chrome|chromium|brave|microsoft-edge)$,title:.*(screen sharing|Sharing|is sharing|Stop sharing|Hide))
windowrule = noblur, match:(class:^(chrome|chromium|brave|microsoft-edge)$,title:.*(screen sharing|Sharing|is sharing|Stop sharing|Hide))

Copilot uses AI. Check for mistakes.
CONFEOF
notify-send "Screen sharing fix applied" "Restart Hyprland to apply changes"
fi
35 changes: 35 additions & 0 deletions migrations/1777007317.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Fix NVIDIA GPU system lockups on media-heavy sites
# See: https://github.com/basecamp/omarchy/issues/5372

echo "Adding NVIDIA Wayland stability fixes"

# Check if we're on NVIDIA
if command -v nvidia-smi &>/dev/null; then
# Add NVIDIA-specific environment variables to the existing envs.conf
NVIDIA_ENV_FILE="$HOME/.config/hypr/envs.conf"

# Ensure the file exists and is sourced
if [[ ! -f $NVIDIA_ENV_FILE ]]; then
mkdir -p "$(dirname "$NVIDIA_ENV_FILE")"
touch "$NVIDIA_ENV_FILE"
fi

# Check if NVIDIA fixes are already applied
if ! grep -q "# NVIDIA Wayland stability fixes" "$NVIDIA_ENV_FILE" 2>/dev/null; then
cat >> "$NVIDIA_ENV_FILE" << 'CONFEOF'

# NVIDIA Wayland stability fixes
# Use X11 platform hint for Chromium/Electron on NVIDIA Wayland
# This prevents VA-API/Vulkan conflicts that cause lockups
env = ELECTRON_OZONE_PLATFORM_HINT,x11
env = OZONE_PLATFORM,x11
CONFEOF
notify-send "NVIDIA stability fix applied" "Restart Hyprland to apply NVIDIA stability improvements"
else
echo "NVIDIA stability fix already applied"
fi
else
echo "No NVIDIA GPU detected, skipping NVIDIA-specific fixes"
fi
23 changes: 23 additions & 0 deletions migrations/1777007318.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Fix screenshot regression with hyprpicker on HDR displays
# See: https://github.com/basecamp/omarchy/issues/5376

echo "Adding screenshot HDR fix"

# Backup existing screenshot script
if [[ -f ~/.local/share/omarchy/bin/omarchy-cmd-screenshot ]]; then
cp ~/.local/share/omarchy/bin/omarchy-cmd-screenshot ~/.local/share/omarchy/bin/omarchy-cmd-screenshot.bak
fi

# The fix adds wayfreeze fallback for HDR displays where hyprpicker causes color issues
# wayfreeze was removed in migration 1762156000, but it may still be needed for HDR compatibility
# This migration reinstalls wayfreeze for users who need it

if ! omarchy-cmd-present wayfreeze; then
if gum confirm "Install wayfreeze for better HDR screenshot support?"; then
omarchy-pkg-add wayfreeze
fi
fi

notify-send "Screenshot HDR fix applied" "Restart Hyprland to apply changes"