chore 🔧: Some changes in transperancy in hyprland, waybar script

This commit is contained in:
Ayush Dumasia 2025-05-15 15:29:43 +05:30
parent b1654ddf1e
commit 2ef529de45
3 changed files with 23 additions and 9 deletions

View file

@ -8,14 +8,20 @@ if [[ ! -f "$CONFIG_FILE" ]]; then
fi
CURRENT_OPACITY=$(grep -E "^\s*active_opacity\s*=\s*" "$CONFIG_FILE" | awk -F'=' '{print $2}' | tr -d ' ')
CURRENT_OPACITY_2=$(grep -E "^\s*inactive_opacity\s*=\s*" "$CONFIG_FILE" | awk -F'=' '{print $2}' | tr -d ' ')
if [[ "$CURRENT_OPACITY" == "1" ]]; then
NEW_OPACITY="0.85"
else
if [[ "$CURRENT_OPACITY" == "0.95" ]]; then
NEW_OPACITY="1"
INACTIVE_OPACITY="1"
notify-send -i "Transpenecy" "📝 Switched into Note Mode" -t 1000
else
NEW_OPACITY="0.95"
INACTIVE_OPACITY="0.75"
notify-send -i "Transpenecy" "Switched into Normal Mode" -t 1000
fi
sed -i "s/^\s*active_opacity\s*=\s*[0-9.]*/ active_opacity = $NEW_OPACITY/" "$CONFIG_FILE"
sed -i "s/^\s*inactive_opacity\s*=\s*[0-7.]*/ inactive_opacity = $INACTIVE_OPACITY/" "$CONFIG_FILE"
echo "Toggled active_opacity to $NEW_OPACITY"