Add screenshot scripts
This commit is contained in:
parent
401333b4ed
commit
09ebca65f8
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
area="${1}"
|
||||||
|
output="${HOME}/Pictures/screenshots/$(date +'%Y%m%d%H%M%S').jpeg"
|
||||||
|
|
||||||
|
grim -g "${area}" \
|
||||||
|
-t jpeg \
|
||||||
|
-q 100 \
|
||||||
|
- > "${output}"
|
||||||
|
|
||||||
|
notify-send "Screenshot saved to ${output}"
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
active_monitor="$(hyprctl activeworkspace -j | jq '.monitor' | sed 's/\"//g')"
|
||||||
|
|
||||||
|
jq_filter=".[] | select(.name == \"${active_monitor}\")"
|
||||||
|
active_monitor_json=$(hyprctl monitors -j | jq "${jq_filter}")
|
||||||
|
|
||||||
|
x=$(echo "${active_monitor_json}" | jq '.x')
|
||||||
|
y=$(echo "${active_monitor_json}" | jq '.y')
|
||||||
|
|
||||||
|
width=$(echo "${active_monitor_json}" | jq '.width')
|
||||||
|
height=$(echo "${active_monitor_json}" | jq '.height')
|
||||||
|
|
||||||
|
/home/vtimofei/scripts/screenshot "${x},${y} ${width}x${height}"
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
area="$(slurp)"
|
||||||
|
err_code=$?
|
||||||
|
|
||||||
|
if [ $err_code -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
/home/vtimofei/scripts/screenshot "${area}"
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
activewindow_json="$(hyprctl activewindow -j)"
|
||||||
|
|
||||||
|
x=$(echo "${activewindow_json}" | jq '.at[0]')
|
||||||
|
y=$(echo "${activewindow_json}" | jq '.at[1]')
|
||||||
|
|
||||||
|
width=$(echo "${activewindow_json}" | jq '.size[0]')
|
||||||
|
height=$(echo "${activewindow_json}" | jq '.size[1]')
|
||||||
|
|
||||||
|
/home/vtimofei/scripts/screenshot "${x},${y} ${width}x${height}"
|
Loading…
Reference in New Issue