Add hyprimate: 8 animation menu items, guard + rebuild scripts, hyprland.lua hook
This commit is contained in:
1 parent
8365865c5f
commit
5003dd72e4
12 files changed
+333
No files matched your search
Regular → Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
# Hyprimate guard — keep the hyprimate plugin off unless a hyprimate-* animation
|
||||
# is the current HyDE animation selection.
|
||||
#
|
||||
# HyDE's own animation items (classic, macos, ...) know nothing about the
|
||||
# plugin, so after switching back to a native animation hyprimate would keep
|
||||
# hijacking window open/close/movement. This script is invoked via hl.exec_cmd
|
||||
# from ~/.config/hypr/hyprland.lua on every config load.
|
||||
#
|
||||
# It MUST stay a separate process: calling hyprctl from inside Lua config
|
||||
# evaluation deadlocks the compositor (the IPC loop is busy loading the config).
|
||||
set -u
|
||||
|
||||
SO="$HOME/.local/src/hyprimate/build/hyprimate.so"
|
||||
staterc="${XDG_STATE_HOME:-$HOME/.local/state}/hyde/staterc"
|
||||
key=$(sed -n 's/^HYPR_ANIMATION="\{0,1\}\([^"]*\)"\{0,1\}$/\1/p' "$staterc" 2>/dev/null | tail -1)
|
||||
|
||||
# A hyprimate-* animation is selected: ensure the plugin is loaded. On cold
|
||||
# boot the animation item file sets plugin:* keys before the plugin exists, so
|
||||
# after loading we do one clean config-only reload: it clears the unknown-key
|
||||
# error banner and re-applies the style settings from the item file.
|
||||
if [[ "$key" == hyprimate* ]]; then
|
||||
[[ -f "$SO" ]] || exit 0
|
||||
if ! hyprctl plugins list 2>/dev/null | grep -q hyprimate; then
|
||||
hyprctl plugin load "$SO" >/dev/null 2>&1 || exit 0
|
||||
hyprctl reload config-only >/dev/null 2>&1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Plugin not loaded: touching plugin:hyprimate keys would raise unknown-key
|
||||
# errors, so nothing to do.
|
||||
hyprctl plugins list 2>/dev/null | grep -q hyprimate || exit 0
|
||||
|
||||
# Native animation is current and hyprimate is loaded: switch its effects off.
|
||||
hyprctl repl "hl.config{plugin={hyprimate={window={enabled=false},workspace={enabled=false}}}}" >/dev/null 2>&1
|
||||
Regular → Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# Rebuild hyprimate after a Hyprland update (plugins are ABI-locked to the
|
||||
# compositor version). Run this in a terminal after `pacman -Syu` bumps
|
||||
# hyprland, then restart Hyprland if the plugin was loaded.
|
||||
set -eu
|
||||
cd "$HOME/.local/src/hyprimate"
|
||||
git pull --ff-only
|
||||
cmake -B build -G Ninja
|
||||
ninja -C build
|
||||
# hot-swap if loaded
|
||||
if hyprctl plugins list 2>/dev/null | grep -q hyprimate; then
|
||||
hyprctl plugin unload "$PWD/build/hyprimate.so" >/dev/null 2>&1 || true
|
||||
hyprctl plugin load "$PWD/build/hyprimate.so" >/dev/null 2>&1 || true
|
||||
fi
|
||||
echo "hyprimate rebuilt: $(ls -la build/hyprimate.so)"
|
||||
Reference in new issue
Block a user