Files
dotfiles-i3/i3/scripts/i3-sc-full.sh
T

14 lines
602 B
Bash
Raw Normal View History

2026-01-17 07:07:25 +04:00
#!/bin/bash
eval $(xdotool getmouselocation --shell)
data=$(i3-msg -t get_outputs | jq -r ".[] | select(.active == true and $X >= .rect.x and $X < (.rect.x + .rect.width) and $Y >= .rect.y and $Y < (.rect.y + .rect.height)) | \"\(.name)\t\(.rect.width)x\(.rect.height)+\(.rect.x)+\(.rect.y)\"")
2026-02-24 18:42:54 +04:00
echo $data
2026-01-17 07:07:25 +04:00
name=$(echo "$data" | cut -f1)
2026-02-24 18:42:54 +04:00
echo $name
2026-01-17 07:07:25 +04:00
geometry=$(echo "$data" | cut -f2)
2026-02-24 18:42:54 +04:00
echo $geometry
2026-01-17 07:07:25 +04:00
temp_file="/tmp/i3-sc-full.png"
maim -g "$geometry" "$temp_file"
echo "file://$temp_file" | xclip -selection clipboard -t text/uri-list
notify-send "Screenshot" "Captured display: $name" -i camera-photo