[vimshot.sh]: Rename vimshot.sh => x11_vimshot.sh

This commit is contained in:
2024-11-20 23:02:17 +00:00
parent c400e21aaf
commit d91bc95532
2 changed files with 1 additions and 1 deletions

18
x11_vimshot.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# Script to take a wait a few seconds before taking a screenshot to the filepath in the clipboard.
# For use as part of my LaTeX note-taking workflow in Vim: create the figure environment, copy the file name, invoke this script, and select the region in the source material to be screenshotted.
basename=$(basename "$0")
filepath=$(xclip -selection clipboard -out)
# check if the filepath is absolute or relative, and if relative, make absolute
if [ "${filepath#\/}" = "$filepath" ] || [ "${filepath#\~}" = "$filepath" ]; then
filepath="$(pwd)/$filepath"
fi
notify-send "$basename" "Taking screenshot to $filepath"
sleep 5
maim --select --hidecursor "$filepath"
notify-send --icon "$filepath" "$basename" "Screenshot saved to: $filepath"