mirror of
https://github.com/Zerodya/hyprfreeze.git
synced 2024-11-10 01:18:49 +01:00
feat: sway support for -a
This commit is contained in:
parent
6607c0c568
commit
38da7492ba
1 changed files with 8 additions and 1 deletions
|
@ -56,7 +56,14 @@ function toggleFreeze() {
|
|||
|
||||
function getPidByActive() {
|
||||
debugPrint "Getting PID by active window..."
|
||||
if [[ "hyprland" == "$DESKTOP" ]]; then
|
||||
PID=$(hyprctl activewindow -j | jq '.pid')
|
||||
elif [[ "sway" == "$DESKTOP" ]]; then
|
||||
PID=$(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .pid')
|
||||
else
|
||||
echo "Detecting the active window is currently not supported on $DESKTOP."
|
||||
exit 1
|
||||
fi
|
||||
debugPrint "PID by active window: $PID"
|
||||
|
||||
# Die if PID is not numeric (e.g. "null" if there is no active window)
|
||||
|
|
Loading…
Reference in a new issue