grimblast: use '--batch' for 'hyprctl' to limit the number of control calls (#145)

This commit is contained in:
DHDcc 2025-03-17 13:12:03 +01:00 committed by GitHub
parent 7f846cee96
commit bd81329944
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -1,5 +1,9 @@
# Changelog # Changelog
### 2025-03-16
grimblast: use '--batch' for 'hyprctl' to limit the number of control calls
### 2025-03-15 ### 2025-03-15
grimblast: remove moveCursorPosition and restoreCursorPosition for OUTPUT and duplicate jq command grimblast: remove moveCursorPosition and restoreCursorPosition for OUTPUT and duplicate jq command

View file

@ -194,15 +194,12 @@ moveCursorPosition() {
virtualDisplayName="grimblastVD" virtualDisplayName="grimblastVD"
focusedMonitorName=$(hyprctl -j monitors | jq -r '.[] | select( .focused == true ) | .name') focusedMonitorName=$(hyprctl -j monitors | jq -r '.[] | select( .focused == true ) | .name')
hyprctl output create headless "$virtualDisplayName" >/dev/null hyprctl --batch "output create headless $virtualDisplayName; dispatch focusmonitor $virtualDisplayName" >/dev/null
hyprctl dispatch focusmonitor "$virtualDisplayName" >/dev/null
} }
restoreCursorPosition() { restoreCursorPosition() {
[ "$GRIMBLAST_HIDE_CURSOR" ] && return 0 [ "$GRIMBLAST_HIDE_CURSOR" ] && return 0
hyprctl dispatch focusmonitor "$focusedMonitorName" >/dev/null hyprctl --batch "dispatch focusmonitor $focusedMonitorName; output remove $virtualDisplayName; dispatch movecursor ${initialCursorPosition//,/}" >/dev/null
hyprctl output remove "$virtualDisplayName" >/dev/null
hyprctl dispatch movecursor "${initialCursorPosition//,/}" >/dev/null
} }
takeScreenshot() { takeScreenshot() {