dev-screenshat


< #DEV >
< DRAFT+ >



REVISIONS

xxxx
20201019 shared +lies



USAGE / SETUP

* needs /SCREENSHOTS directory

* set keyboard shortcut:
    (in gnome-settings)
    (I suggest replacing prtscr button)
    __________________
    * disable old one:
        find "Save a screenshot to picture"
        backspace
        save
    * make new:
        "+" on bottom
        link to /DISTRO/__screenshat
        bam!

$ apt install yad scrot xclip #for X, for wayland, see below





WAYLAND UPDATES

(fixing on zexu)

* "scrot" no worky


————— (A) try finding something less bad

check...
* https://github.com/reinefjord/wayshot
* https://sr.ht/~emersion/grim/
* https://github.com/emersion/slurp
* https://askubuntu.com/questions/1445517/is-there-a-cli-for-the-default-wayland-screenshot-tool-how-is-that-tool-called
* ###



————— (B) use $ gnome-screenshot

* ...but it does mad flash so need to...
https://askubuntu.com/questions/854350/disable-gnome-screenshots-camera-flash-animation



"""
git clone https://github.com/GNOME/gnome-screenshot.git && cd gnome-screenshot
sed -i 's#TRUE, /\* flash \*/#FALSE, /\* flash \*/#' src/screenshot-backend-shell.c
sudo apt install meson ninja-build libgtk-3-dev libhandy-1-dev gettext #140MB
meson setup build
meson test -C build
sudo mv /usr/bin/gnome-screenshot /usr/bin/gnome-screenshot-orig
#sudo cp gnome-screenshot /usr/bin ↓↓think below is better↓↓
sudo cp build/src/gnome-screenshot /usr/bin
"""

* (had to change a line of code)

* MIND THE "FOR X" / "FOR WAYLAND" BELOW LINE




*** CODE

#!/bin/bash
###source /DISTRO/__configure_mini
###shopt -s expand_aliases

#
#
# Make folder
_time=`date +%Y-%m-%d-%H%M%S`
cd /SCREENSHOTS
mkdir "$_time"
cd "$_time"

#
#
# Make screenshot
###DISPLAY=:0 scrot '%Y-%m-%d-%H%M%S.png' -z -q 60 ###FOR X
gnome-screenshot -f temp.png ###FOR WAYLAND
meson test -C build
mv *.png "${_time}.png"

#
#
# Save selected & copied text
#
xclip -o &> selected_text
xclip -selection clipboard -o &> clipboard

#
#
# "Popup for extra info"

cp *.png small.jpeg
mogrify -resize "40%" small.jpeg

_in=$(yad --title "Saving screenshot... [$_time]" --entry --image-on-top --image='small.jpeg' --center --button="gtk-cancel:252" --button="gtk-ok:0")


#
#
# Save comment
echo "$_in" &> comment

#
#
# Try: Easy search name version
# TODO: might still fail if you use some strange chars!
#
_fn=$(ls -1 *.png)
_fn2=${_fn%".png"}

cd ..
ln -s "$_time/$_fn" "${_fn2} __ ${_in}.png"

echo
echo





Edit Site

Edit CSS