From 35647d799b2d3d155123f68af54cf02a6bef1c61 Mon Sep 17 00:00:00 2001 From: SirBlobby Date: Mon, 20 Apr 2026 13:17:54 -0400 Subject: [PATCH] Add blob_glass script to toggle transparency and disable it --- hypr/looknfeel.conf | 3 +++ scripts/blob_glass.sh | 49 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100755 scripts/blob_glass.sh diff --git a/hypr/looknfeel.conf b/hypr/looknfeel.conf index 5dc4e59..d0ca8aa 100644 --- a/hypr/looknfeel.conf +++ b/hypr/looknfeel.conf @@ -32,3 +32,6 @@ layout { # Avoid overly wide single-window layouts on wide screens # single_window_aspect_ratio = 1 1 } + +# Remove default window transparency +windowrule = opacity 1.0 override 1.0 override, match:tag default-opacity diff --git a/scripts/blob_glass.sh b/scripts/blob_glass.sh new file mode 100755 index 0000000..9c159a0 --- /dev/null +++ b/scripts/blob_glass.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# Configuration files to modify +ACTIVE_CONF="$HOME/.config/hypr/looknfeel.conf" +REPO_CONF="$HOME/Documents/dotfiles/hypr/looknfeel.conf" + +# The rule to enforce solid opacity +OVERRIDE_RULE="windowrule = opacity 1.0 override 1.0 override, match:tag default-opacity" +# A marker comment +MARKER="# Remove default window transparency" + +ACTION=$1 + +if [ -z "$ACTION" ]; then + ACTION="toggle" +fi + +enable_glass() { + # Remove the rules + sed -i "/$MARKER/d" "$ACTIVE_CONF" "$REPO_CONF" 2>/dev/null + sed -i "/opacity 1.0 override/d" "$ACTIVE_CONF" "$REPO_CONF" 2>/dev/null + echo "Transparency enabled (glass on)." + hyprctl reload >/dev/null +} + +disable_glass() { + # Add the rules if they don't exist + if ! grep -q "opacity 1.0 override" "$ACTIVE_CONF"; then + echo -e "\n$MARKER\n$OVERRIDE_RULE" >> "$ACTIVE_CONF" + echo -e "\n$MARKER\n$OVERRIDE_RULE" >> "$REPO_CONF" + fi + echo "Transparency disabled (glass off)." + hyprctl reload >/dev/null +} + +if [ "$ACTION" == "on" ]; then + enable_glass +elif [ "$ACTION" == "off" ]; then + disable_glass +elif [ "$ACTION" == "toggle" ]; then + if grep -q "opacity 1.0 override" "$ACTIVE_CONF"; then + enable_glass + else + disable_glass + fi +else + echo "Usage: blob_glass [on|off|toggle]" + exit 1 +fi \ No newline at end of file