mirror of
https://github.com/Zerodya/hyprfreeze.git
synced 2024-09-19 23:43:18 +02:00
feat: implement swayprop
This commit is contained in:
parent
d2656ce853
commit
16346343dd
2 changed files with 11 additions and 3 deletions
|
@ -21,7 +21,7 @@ Hyprfreeze is available in [AUR](https://aur.archlinux.org/packages/hyprfreeze-g
|
||||||
- `psmisc` contains 'pstree' which is required to list child processes
|
- `psmisc` contains 'pstree' which is required to list child processes
|
||||||
- Systemd for the `loginctl` utility
|
- Systemd for the `loginctl` utility
|
||||||
### Optional
|
### Optional
|
||||||
- [`hyprprop`](https://github.com/vilari-mickopf/hyprprop) to get the pid of a window by selecting it with your mouse
|
- [`hyprprop`](https://github.com/vilari-mickopf/hyprprop) or [`swayprop`](https://git.alternerd.tv/alterNERDtive/swayprop) to get the pid of a window by selecting it with your mouse
|
||||||
### Highly Recommended
|
### Highly Recommended
|
||||||
- [`gamescope`](https://github.com/ValveSoftware/gamescope) fixes mouse input not working in other XWayland windows after pausing a Wine game. It's also the superior way to game in Wayland anyway.
|
- [`gamescope`](https://github.com/ValveSoftware/gamescope) fixes mouse input not working in other XWayland windows after pausing a Wine game. It's also the superior way to game in Wayland anyway.
|
||||||
|
|
||||||
|
|
12
hyprfreeze
12
hyprfreeze
|
@ -12,7 +12,8 @@ Options:
|
||||||
-a, --active toggle suspend by active window (supported on hyprland and sway)
|
-a, --active toggle suspend by active window (supported on hyprland and sway)
|
||||||
-p, --pid toggle suspend by process id
|
-p, --pid toggle suspend by process id
|
||||||
-n, --name toggle suspend by process name/command
|
-n, --name toggle suspend by process name/command
|
||||||
-r, --prop toggle suspend by clicking on window (supported on hyprland, hyprprop must be installed)
|
-r, --prop toggle suspend by clicking on window (supported on hyprland and sway,
|
||||||
|
hyprprop/swayprop must be installed)
|
||||||
|
|
||||||
-s, --silent don't send notification
|
-s, --silent don't send notification
|
||||||
-t, --notif-timeout notification timeout in milliseconds (default 5000)
|
-t, --notif-timeout notification timeout in milliseconds (default 5000)
|
||||||
|
@ -100,12 +101,19 @@ function getPidByName() {
|
||||||
function getPidByProp() {
|
function getPidByProp() {
|
||||||
debugPrint "Getting PID by prop..."
|
debugPrint "Getting PID by prop..."
|
||||||
if [[ "hyprland" == "$DESKTOP" ]]; then
|
if [[ "hyprland" == "$DESKTOP" ]]; then
|
||||||
if ! command -v hyprprop; then
|
if ! [ $(command -v hyprprop) ]; then
|
||||||
echo "You need to install 'hyprprop' to use this feature. (https://github.com/vilari-mickopf/hyprprop)"
|
echo "You need to install 'hyprprop' to use this feature. (https://github.com/vilari-mickopf/hyprprop)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PID=$(hyprprop | jq '.pid')
|
PID=$(hyprprop | jq '.pid')
|
||||||
|
elif [[ "sway" == "$DESKTOP" ]]; then
|
||||||
|
if ! [ $(command -v swayprop) ]; then
|
||||||
|
echo "You need to install 'swayprop' to use this feature. (https://git.alternerd.tv/alterNERDtive/swayprop)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PID=$(swayprop | jq '.pid')
|
||||||
else
|
else
|
||||||
echo "Selecting the target window by mouse is currently not supported on $DESKTOP."
|
echo "Selecting the target window by mouse is currently not supported on $DESKTOP."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue