* Pick window transparency from Appearance > Window Transparency Transparent, the default, keeps today's windows. Opaque turns the windows Omarchy makes transparent solid. Glassy is the frosted glass Starship (#14726): its blur behind every see-through window and shell surface, and a see-through, blurred background in the theme's terminal files, since foot turns compositor blur down and a Hyprland opacity rule fades text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Leave window transparency to Appearance when animations are off Turning animations off no longer makes windows opaque. VM installs start with opaque windows instead, and a migration keeps them opaque for anyone who already has animations off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add a Glassy bar background, under Menu Bar > Bar Background Menu Bar > Bar Background picks Opaque Bar, Glassy Bar or Clear Bar, and Indicators becomes Bar Indicators to match. Glassy keeps the theme background faintly and Hyprland blurs what is behind it, with the same blur as Glassy windows. omarchy bar background opaque|glassy|none|cycle sets it and prints it when given nothing. omarchy bar transparent true|false|toggle stays for compatibility, as none and opaque. Double-clicking the bar cycles through the three backgrounds the same way, from clear to glassy to opaque. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Stop when a saved corner choice can't be removed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Make btop follow glassy windows --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
71 lines
2.1 KiB
Bash
Executable File
71 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Show or set how see-through windows are: opaque, transparent, or glassy
|
|
# omarchy:args=[opaque|transparent|glassy]
|
|
# omarchy:examples=omarchy hyprland window transparency | omarchy hyprland window transparency glassy
|
|
|
|
TOGGLES_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/toggles/hypr"
|
|
|
|
# Opaque and glassy are toggle files loaded after every theme: opaque makes the
|
|
# windows Omarchy makes transparent solid, and glassy blurs what is behind any
|
|
# see-through window and gives terminals a see-through background. Transparent,
|
|
# the default, removes both.
|
|
current_mode() {
|
|
if [[ -f $TOGGLES_DIR/window-opaque.lua ]]; then
|
|
echo "opaque"
|
|
elif [[ -f $TOGGLES_DIR/window-glassy.lua ]]; then
|
|
echo "glassy"
|
|
else
|
|
echo "transparent"
|
|
fi
|
|
}
|
|
|
|
# Save the new choice before dropping the old one, so a failed save keeps it.
|
|
save_mode() {
|
|
if [[ $1 != "transparent" ]]; then
|
|
mkdir -p "$TOGGLES_DIR" && cp "$OMARCHY_PATH/default/hypr/toggles/window-$1.lua" "$TOGGLES_DIR/window-$1.lua" || return 1
|
|
fi
|
|
local mode
|
|
for mode in opaque glassy; do
|
|
[[ $mode == "$1" ]] || rm -f "$TOGGLES_DIR/window-$mode.lua" || return 1
|
|
done
|
|
}
|
|
|
|
if (( $# == 0 )); then
|
|
current_mode
|
|
exit 0
|
|
fi
|
|
|
|
case $1 in
|
|
opaque) LABEL="Opaque windows" ;;
|
|
transparent) LABEL="Transparent windows" ;;
|
|
glassy) LABEL="Glassy windows" ;;
|
|
*)
|
|
echo "Usage: omarchy-hyprland-window-transparency [opaque|transparent|glassy]" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# A theme switch renders the next theme's terminal files from the saved choice
|
|
# and then replaces the current theme, so the choice and the glass written into
|
|
# the current theme are changed under its lock, or the switch could drop them.
|
|
exec 9>"${XDG_RUNTIME_DIR:-/tmp}/omarchy-theme-set.lock"
|
|
flock 9
|
|
|
|
# A choice whose glass cannot be written is taken back, so the saved choice
|
|
# is always the one on screen.
|
|
previous=$(current_mode)
|
|
save_mode "$1" || exit 1
|
|
if ! omarchy-theme-set-glass; then
|
|
save_mode "$previous"
|
|
omarchy-theme-set-glass
|
|
exit 1
|
|
fi
|
|
flock -u 9
|
|
|
|
hyprctl reload >/dev/null || exit 1
|
|
omarchy-restart-terminal
|
|
omarchy-theme-set-foot
|
|
omarchy-restart-btop
|
|
omarchy-notification-send -g "$LABEL"
|