Added script screenshot

This commit is contained in:
Joao Azevedo 2020-08-04 22:27:15 +02:00
parent 61bc70d7ff
commit 298d6218d8
5 changed files with 44 additions and 0 deletions

6
debian/changelog vendored
View File

@ -1,5 +1,11 @@
librem5-goodies (0.0.2) amber-phone; urgency=medium
* New upstream release.
- Added the script: screenshot
-- João Azevedo <joao.azevedo@puri.sm> Tue, 04 Aug 2020 22:17:24 +0200
* New upstream release.
- Changed the project name.
- Changed the target repo to amber-phone.

2
debian/control vendored
View File

@ -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

View File

@ -1,2 +1,4 @@
contacts-importer /usr/bin
contacts-importer.desktop /usr/share/applications
screenshot /usr/bin
screenshot.desktop /usr/share/applications

28
screenshot Executable file
View File

@ -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}"

6
screenshot.desktop Normal file
View File

@ -0,0 +1,6 @@
[Desktop Entry]
Name=Screen Shot
Type=Application
Icon=applets-screenshooter
Exec=/usr/bin/screenshot %U
Categories=Utility;