blob: b3fa40d36661aa2d7a66a6d1fc6595fef5bf28c6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/usr/bin/env bash
# ==================================================
# KoolDots (2026)
# Project URL: https://github.com/LinuxBeginnings
# License: GNU GPLv3
# SPDX-License-Identifier: GPL-3.0-or-later
# ==================================================
# Toggle active window opacity (opaque property).
# Uses flock so that if both .conf and .lua binds fire simultaneously
# (dual-config load), only the first execution runs and the second exits.
LOCK="/tmp/.hypr_toggle_opacity_${HYPRLAND_INSTANCE_SIGNATURE:-default}.lock"
(
flock -n 200 || exit 0
ADDR=$(hyprctl activewindow -j 2>/dev/null | jq -r '.address // empty')
[ -z "$ADDR" ] && exit 0
hyprctl setprop "address:${ADDR}" opaque toggle
) 200>"$LOCK"
|