diff --git a/screenshot b/screenshot new file mode 100755 index 0000000..3aa694b --- /dev/null +++ b/screenshot @@ -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}" diff --git a/screenshot-monitor b/screenshot-monitor new file mode 100755 index 0000000..12cd473 --- /dev/null +++ b/screenshot-monitor @@ -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}" diff --git a/screenshot-select b/screenshot-select new file mode 100755 index 0000000..6425f8e --- /dev/null +++ b/screenshot-select @@ -0,0 +1,10 @@ +#!/bin/bash + +area="$(slurp)" +err_code=$? + +if [ $err_code -ne 0 ]; then + exit 1 +fi + +/home/vtimofei/scripts/screenshot "${area}" diff --git a/screenshot-window b/screenshot-window new file mode 100755 index 0000000..54b9c03 --- /dev/null +++ b/screenshot-window @@ -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}"