diff --git a/debian/changelog b/debian/changelog index 0d1265b..3932761 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,11 @@ librem5-goodies (0.0.2) amber-phone; urgency=medium + * New upstream release. + - Added the script: screenshot + + -- João Azevedo Tue, 04 Aug 2020 22:17:24 +0200 + + * New upstream release. - Changed the project name. - Changed the target repo to amber-phone. diff --git a/debian/control b/debian/control index 7c3e873..f46f0df 100644 --- a/debian/control +++ b/debian/control @@ -17,9 +17,11 @@ Depends: libnotify-bin, syncevolution, yad, + grim, ${misc:Depends}, Description: Librem 5 Goodies A collection of bash scripts and applications made to add functionalities to the Librem 5 phone and Phosh Shell. It includes the following: - Contacts Importer: A simple application to import contacts from a vcard file to GNOME Contacts. + - Screenshot: A simple application to make screenshots on the Librem 5 diff --git a/debian/librem5-goodies.install b/debian/librem5-goodies.install index ca22173..1025867 100644 --- a/debian/librem5-goodies.install +++ b/debian/librem5-goodies.install @@ -1,2 +1,4 @@ contacts-importer /usr/bin contacts-importer.desktop /usr/share/applications +screenshot /usr/bin +screenshot.desktop /usr/share/applications diff --git a/screenshot b/screenshot new file mode 100755 index 0000000..a5a1f73 --- /dev/null +++ b/screenshot @@ -0,0 +1,28 @@ +#!/bin/bash +# This screenshot program was based on an initial command-line only version +# by the purismforum user in community/librem-5 +# +# I've since expanded it to use libnotify and provide a GUI +# It requires the grim, libnotify-bin and yad packages: +# sudo apt install grim yad libnotify-bin + +#Variable + +SCREENSHOT="/home/$USER/Pictures/$(date +%Y-%m-%d-%H%M%S).png" + +if [ -e /usr/bin/yad ]; then + INPUT=`yad --title Screenshot --text="Take screenshot after X seconds" --form --field=filename:SFL --field=seconds:NUM "$SCREENSHOT" "5" --focus-field=2` + echo $INPUT + SCREENSHOT=`echo $INPUT | cut -d '|' -f1` + SECONDS=`echo $INPUT | cut -d '|' -f2` +else + SECONDS=`zenity --title Screenshot --text="Take screenshot after X seconds" --entry-text=5 --entry` +fi + +if [ "$SECONDS" -eq 0 ]; then + exit +fi +notify-send -t 1000 screenshot "Taking a screenshot in $SECONDS seconds" +sleep $SECONDS; +grim "$SCREENSHOT" +notify-send screenshot "Screenshot stored at ${SCREENSHOT}" diff --git a/screenshot.desktop b/screenshot.desktop new file mode 100644 index 0000000..a4ad32a --- /dev/null +++ b/screenshot.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Screen Shot +Type=Application +Icon=applets-screenshooter +Exec=/usr/bin/screenshot %U +Categories=Utility;