diff options
| author | Don Williams <don.e.williams@gmail.com> | 2026-08-15 11:26:57 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:41:34 -0700 |
| commit | 912130c3b2c09123d933addde1fcf97373a5cdc1 (patch) | |
| tree | ba57dce1e2002552898476269955d687e7f67bb5 /config | |
| parent | 16a0414b0e6cf4c27fc5550e7acee3e731cddbb7 (diff) | |
Fixed opacity keybinds add: ToggleOpacity script
Signed-off-by: Don Williams <don.e.williams@gmail.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: CHANGELOG.md
modified: config/hypr/configs/Keybinds.conf
modified: config/hypr/configs/system_keybinds.lua
modified: config/hypr/lua/keybind_helpers.lua
new file: config/hypr/scripts/ToggleOpacity.sh
Diffstat (limited to 'config')
| -rw-r--r-- | config/hypr/configs/Keybinds.conf | 2 | ||||
| -rw-r--r-- | config/hypr/configs/system_keybinds.lua | 2 | ||||
| -rw-r--r-- | config/hypr/lua/keybind_helpers.lua | 2 | ||||
| -rw-r--r-- | config/hypr/scripts/ToggleOpacity.sh | 21 |
4 files changed, 24 insertions, 3 deletions
diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index 612ecc95..844f4905 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -70,7 +70,7 @@ bindd = $mainMod SHIFT, M, Online music, exec, $UserScripts/RofiBeats.sh bindd = $mainMod, W, Select Wallpaper, exec, $scriptsDir/WallpaperSelect.sh bindd = $mainMod SHIFT, W, Wallpaper effects, exec, $scriptsDir/WallpaperEffects.sh bindd = CTRL ALT, W, Random wallpaper, exec, $scriptsDir/WallpaperRandom.sh -bindd = $mainMod CTRL, O, Toggle active window opacity, setprop, active opaque toggle +bindd = $mainMod CTRL, O, Toggle active window opacity, exec, $scriptsDir/ToggleOpacity.sh bindd = $mainMod SHIFT, K, Search keybinds, exec, $scriptsDir/KeyBinds.sh bindd = $mainMod SHIFT, A, Animations menu, exec, $scriptsDir/Animations.sh bindd = $mainMod SHIFT, O, Change ZSH (oh-my-zsh) theme, exec, $scriptsDir/ZshChangeTheme.sh diff --git a/config/hypr/configs/system_keybinds.lua b/config/hypr/configs/system_keybinds.lua index ca03b2b9..dd654ccd 100644 --- a/config/hypr/configs/system_keybinds.lua +++ b/config/hypr/configs/system_keybinds.lua @@ -402,7 +402,7 @@ bind( exec_cmd("$HOME/.config/hypr/UserScripts/WallpaperRandom.sh"), { description = "random wallpaper" } ) -bind("SUPER CTRL", "O", dispatch("setprop", "active opaque toggle"), { description = "toggle active window opacity" }) +bind("SUPER CTRL", "O", exec_cmd("$HOME/.config/hypr/scripts/ToggleOpacity.sh"), { description = "toggle active window opacity" }) bind("SUPER SHIFT", "K", exec_cmd("$HOME/.config/hypr/scripts/KeyBinds.sh"), { description = "search keybinds" }) bind("SUPER SHIFT", "A", exec_cmd("$HOME/.config/hypr/scripts/Animations.sh"), { description = "animations menu" }) bind( diff --git a/config/hypr/lua/keybind_helpers.lua b/config/hypr/lua/keybind_helpers.lua index 8240cc60..1b1a269b 100644 --- a/config/hypr/lua/keybind_helpers.lua +++ b/config/hypr/lua/keybind_helpers.lua @@ -213,7 +213,7 @@ local function dispatch(name, args) return window_api.bring_to_top() end if name == "setprop" and window_api.set_prop then - local prop, value = args:match("^(%S+)%s+(.+)$") + local _win, prop, value = args:match("^(%S+)%s+(%S+)%s+(.+)$") if prop and value then return window_api.set_prop({ prop = prop, value = value }) end diff --git a/config/hypr/scripts/ToggleOpacity.sh b/config/hypr/scripts/ToggleOpacity.sh new file mode 100644 index 00000000..b3fa40d3 --- /dev/null +++ b/config/hypr/scripts/ToggleOpacity.sh @@ -0,0 +1,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" |
