aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/screenshot.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/.local/bin/screenshot.sh b/.local/bin/screenshot.sh
index 19a9157..3a6eee2 100755
--- a/.local/bin/screenshot.sh
+++ b/.local/bin/screenshot.sh
@@ -1,7 +1,8 @@
#!/bin/sh
# Get focused output
-output="$(mmsg get all-monitors | jq -r '.monitors[] | select(.active == true) | .name')"
+#output="$(mmsg get all-monitors | jq -r '.monitors[] | select(.active == true) | .name')"
+output="$( moocow show windows | jq -r '.data[] | select(.focused == true) | .output')"
case $1 in
selected-region)
@@ -14,8 +15,10 @@ case $1 in
;;
focused-window)
# Take a screenshot of the focused window
- geometry=$(mmsg get focusing-client | jq -r '"\(.x),\(.y) \(.width)x\(.height)"')
- grim -g "$geometry" -t jpeg ~/Pictures/Screenshots/"$(date +%Y-%m-%d_%H-%m-%s)".jpg
+ # geometry=$(mmsg get focusing-client | jq -r '"\(.x),\(.y) \(.width)x\(.height)"')
+ geometry=$(moocow winops -I | jq -r '.data.frame | "\(.x),\(.y) \(.width)x\(.height)"')
+
+ grim -g "$geometry" -t jpeg ~/Pictures/Screenshots/"$(date +%Y-%m-%d_%H-%m-%s)".jpg
;;
*)
# Take a screenshot of the currently focused output and save it into screenshots