Compare commits

...

105 Commits

Author SHA1 Message Date
Joao Azevedo 95e14f0b61 Update README.md 2021-11-01 15:29:47 +00:00
Joao Azevedo 9e00cc502d make it use xdg-user-dir to determine where the videos are stored. Instead of hard coding a path and a user. Useful for non English L5 users. 2021-11-01 15:19:38 +00:00
Joao Azevedo 2f5784c6b7
use xdg-user-dir to determine directories 2021-11-01 16:02:04 +01:00
Joao Azevedo e3c012fc0e
update readme 2021-10-31 14:59:40 +01:00
Joao Azevedo 460c8bccb9 Merge branch 'drop-checktarball' into 'pureos/byzantium'
Make it a native package again

See merge request librem5-apps/librem5-goodies!25
2021-10-30 16:16:50 +00:00
Guido Günther f487497265 Document changes and release 0.0.7pureos1 2021-10-30 15:41:18 +02:00
Guido Günther 2a444158c6 ci: Drop check-tarball
Not needed (and hence not working) for a 3.0 (native) package
2021-10-30 15:40:44 +02:00
Guido Günther eb71756777 Make it a native package again
There's no upstream other than us afaik.
2021-10-30 15:40:44 +02:00
Joao Azevedo 318802de54
update changelog 2021-10-30 01:26:36 +02:00
Joao Azevedo 93cab485ac
update changelog 2021-10-30 01:26:00 +02:00
Joao Azevedo 236845a654
move from native to quilt 2021-10-30 01:11:18 +02:00
Joao Azevedo 878f6bc3e6
add gbp.conf 2021-10-30 00:59:14 +02:00
Joao Azevedo 5899e8f147
prepare byzantium release 2021-10-30 00:39:31 +02:00
Joao Azevedo 476a7b8eb8 Merge branch '007-release-bond' into 'master'
prepare last amber release

Closes #15

See merge request librem5-apps/librem5-goodies!24
2021-10-29 22:18:45 +00:00
Joao Azevedo 7700a5d2ab
fix single backslash error spotted in shellcheck 2021-10-30 00:13:09 +02:00
Joao Azevedo 030106bf7b
prepare amber 2021-10-29 23:57:49 +02:00
Joao Azevedo a4a703942b
update changelog 2021-10-29 23:52:42 +02:00
Joao Azevedo d260b8d57d
add l5-screen-recorder to build tests 2021-10-29 23:49:56 +02:00
Joao Azevedo 8063732577
Add usage function, add app icon to notifications 2021-10-29 23:47:05 +02:00
Joao Azevedo b1e1a4fcf5
update changelog, prepare release 2021-10-29 23:31:37 +02:00
Joao Azevedo d583724822
update debhelper version 2021-10-29 23:22:05 +02:00
Joao Azevedo dcd01fd716
Removed scale the screen script files 2021-10-29 23:11:28 +02:00
Joao Azevedo 368b936446
Remove scale the screen script, closes #15 2021-10-29 23:05:53 +02:00
Joao Azevedo dce5ee40a2
update packge discription to include the screen recorder script 2021-10-29 22:57:15 +02:00
Joao Azevedo 31bc728d03
update appdata file to include the screen recorder 2021-10-29 22:16:01 +02:00
Joao Azevedo ac8bac85cc
add l5-screen-recorder to makefile build tests 2021-10-29 22:13:53 +02:00
Joao Azevedo 8bf4e9a307
fix shellcheck warning 2021-10-29 22:12:13 +02:00
Joao Azevedo 0537a86740 Merge branch 'master' into 'master'
Init screen recorder

See merge request librem5-apps/librem5-goodies!23
2021-09-29 23:49:14 +00:00
David Hamner 300fced68a Init screen recorder 2021-09-24 07:58:03 -07:00
Guido Gunther 6fe0c7143d Merge branch 'rel' into 'master'
Document changes and release 0.0.6pureos1

See merge request librem5-apps/librem5-goodies!22
2021-09-01 08:42:47 +00:00
Guido Günther 09045eab0a Document changes and release 0.0.6pureos1 2021-09-01 10:38:47 +02:00
Guido Gunther d25ac70f77 Merge branch 'next-and-clean' into 'master'
Prepare 0.6.0 release

See merge request librem5-apps/librem5-goodies!19
2021-04-21 14:55:34 +00:00
Joao Azevedo cae9349e02 - Prepare 0.6.0 release 2021-04-21 14:52:44 +00:00
Guido Gunther f595391bf4 Merge branch 'a-p' into 'master'
d/librem5-ci: Switch to amber-phone

See merge request librem5-apps/librem5-goodies!21
2021-04-21 14:52:36 +00:00
Guido Günther 6b25c3aff8 d/librem5-ci: Switch to amber-phone
Buster + Jenkins CI is unavailable since some time.
2021-04-21 16:44:00 +02:00
Joao Azevedo 5753e17174 Merge branch 'scale-other-displays' into 'master'
l5-scale-the-screen allow displays other than DSI-1

Closes #12

See merge request librem5-apps/librem5-goodies!17
2021-04-18 11:24:46 +00:00
Neil Simpson f5d4d141a9 l5-scale-the-screen allow displays other than DSI-1 2020-12-02 17:39:52 -05:00
Joao Azevedo df95a1505a Merge branch 'another-relase' into 'master'
prepare relase 0.0.5

See merge request librem5-apps/librem5-goodies!15
2020-11-23 17:50:58 +00:00
Joao Azevedo 6a645e354c Merge branch 'appdata' into 'master'
Move appdata check to makefile and use sm.puri

See merge request librem5-apps/librem5-goodies!16
2020-11-23 17:10:09 +00:00
Guido Günther 4846c7d158 appdata: Use sm.puri prefix
This makes it match what we use in most other upstream software.
2020-11-23 17:32:22 +01:00
Guido Günther 9b5f4657a9 Move appdata check to Makefile
This makes it simple to use without building the package and prevents
overpopulating `override_dh_auto_test`.
2020-11-23 15:01:59 +01:00
Guido Günther 7bad418b47 d/control: Build-depend on appstream-util
Needed to validate the appdata.
2020-11-23 15:01:59 +01:00
Joao Azevedo 3ed5b2dec1 prepare relase 2020-11-23 13:33:16 +01:00
Joao Azevedo 5c5b6a6f32 Merge branch 'lets-shoppify-this-app' into 'master'
Lets shoppify this app

Closes #9

See merge request librem5-apps/librem5-goodies!14
2020-11-23 12:11:21 +00:00
Joao Azevedo 7310b35d2c added validation tests of the appstream file in debian/rules 2020-11-23 13:07:06 +01:00
Joao Azevedo fc0172f2e0 added appstream xml file 2020-11-22 13:20:41 +01:00
Joao Azevedo e63afb5d08 initial work on shopifying this 2020-11-22 12:26:31 +01:00
Joao Azevedo dff70f945e added appdata xml file. added tags to desktop shortcuts 2020-11-22 12:11:59 +01:00
Guido Gunther 7ee2a7e4ad Merge branch 'lets-scale-that-screen' into 'master'
Add script scale the screen

See merge request librem5-apps/librem5-goodies!13
2020-11-18 08:52:55 +00:00
Joao Azevedo f5ae17e61d Add script scale the screen 2020-11-17 20:35:57 +01:00
Guido Gunther 2556299314 Merge branch 'next' into 'master'
New release v0.0.4

See merge request librem5-apps/librem5-goodies!11
2020-08-12 09:59:42 +00:00
Joao Azevedo 2b3f5fe5f2 more typos 2020-08-12 11:07:43 +02:00
Joao Azevedo 61845679b5 typo 2020-08-12 11:06:50 +02:00
Joao Azevedo 01431fca4c new relase v0.0.4 updated README 2020-08-12 11:05:20 +02:00
Joao Azevedo e015eeab9c Merge branch 'next' into 'master'
change scripts name to something less generic. Remove zenity

Closes #8 and #7

See merge request librem5-apps/librem5-goodies!10
2020-08-12 08:57:09 +00:00
Joao Azevedo 18fb3fcd04 fix autotests 2020-08-12 10:50:30 +02:00
Joao Azevedo f05992396a extra fix 2020-08-09 14:02:17 +02:00
Joao Azevedo b028ca504f fix debian/tests 2020-08-09 14:00:33 +02:00
Joao Azevedo ac78586de5 cleaups 2020-08-08 10:54:54 +02:00
Joao Azevedo ca347d0c63 changed the name of desktop files 2020-08-08 10:51:37 +02:00
Joao Azevedo 7d77f22da2 also addressing https://source.puri.sm/librem5-apps/librem5-goodies/-/issues/7 2020-08-08 10:49:41 +02:00
Joao Azevedo 1d8bbf1abe Addressing https://source.puri.sm/librem5-apps/librem5-goodies/-/issues/7 2020-08-08 10:48:27 +02:00
Joao Azevedo d39704ed6d Merge branch 'ast' into 'master'
Run wrap-and-sort -ast

See merge request librem5-apps/librem5-goodies!9
2020-08-07 14:55:31 +00:00
Joao Azevedo f6b2356d28 Update README.md 2020-08-06 14:35:20 +00:00
Guido Günther 83222074fc Run wrap-and-sort -ast
This lets us keep alphabetic order.
2020-08-06 12:06:46 +02:00
Joao Azevedo 1a56055268 Merge branch 'debianization' into 'master'
Debianization

Closes #6, #5, #4, and #3

See merge request librem5-apps/librem5-goodies!8
2020-08-05 13:56:32 +00:00
Joao Azevedo 5f1c204830 removed file: files 2020-08-05 15:35:37 +02:00
Joao Azevedo b600f868b7 fix trailing spaces in changelog 2020-08-05 15:24:06 +02:00
Joao Azevedo 9dc35d449c Fix description identation, and links to source and project homepage 2020-08-05 15:20:31 +02:00
Joao Azevedo a454a9865d Update README.md With screenshot info 2020-08-05 11:35:48 +00:00
Joao Azevedo fc24235e80 Merge branch 'screenshot' into 'master'
Screenshot

See merge request librem5-apps/librem5-goodies!7
2020-08-04 21:30:24 +00:00
Joao Azevedo d9ada05ce7 fixed error in changelog 2020-08-04 23:24:27 +02:00
Joao Azevedo 8725bcd466 corrected notify send 2020-08-04 23:09:03 +02:00
Joao Azevedo fa60c85899 Update control 2020-08-04 21:03:18 +00:00
Joao Azevedo aaae5ae59a forgot makefile 2020-08-04 22:59:53 +02:00
Joao Azevedo 82fb957eb8 Added: usage function to screenshot script, added test, corrected parts of the script with shellcheck 2020-08-04 22:55:10 +02:00
Joao Azevedo 5ea3116661 Delete contacts-importer.install 2020-08-04 20:29:03 +00:00
Joao Azevedo 298d6218d8 Added script screenshot 2020-08-04 22:27:15 +02:00
Joao Azevedo 61bc70d7ff Update README.md 2020-07-31 14:47:05 +00:00
Joao Azevedo d07e9c13c8 Merge branch 'L5-goodies-next' into 'master'
L5 goodies next

See merge request librem5-apps/diy-contacts-importer!6
2020-07-26 14:48:25 +00:00
Joao Azevedo dee995cbf2 Changed the package name to librem5-goodies adjusted copyright, control, changelog files to replect that and the install file
Signed-off-by: Joao Azevedo <joao.azevedo@puri.sm>
2020-07-26 16:37:37 +02:00
Joao Azevedo 89e19e6858 updated package name in copyright file
Signed-off-by: Joao Azevedo <joao.azevedo@puri.sm>
2020-07-26 16:09:39 +02:00
Joao Azevedo 85c0e7a4d2 Change readme to reflect projec name change and scope
Signed-off-by: Joao Azevedo <joao.azevedo@puri.sm>
2020-07-26 16:01:16 +02:00
Joao Azevedo 3d35d67bc9 Merge branch 'icon' into 'master'
contacts-importer: Use application icon

See merge request librem5-apps/diy-contacts-importer!4
2020-07-24 09:26:17 +00:00
Joao Azevedo 9f65c0b3dc Merge branch 'dh' into 'master'
Switch to debhelper 12

See merge request librem5-apps/diy-contacts-importer!5
2020-07-24 09:08:08 +00:00
Guido Günther 760385479f contacts-importer: Use application icon
This makes the notifications identifiable
2020-07-24 09:33:34 +02:00
Guido Günther b116f99b34 debian: Switch to dh 12
It's in stable
2020-07-24 09:31:56 +02:00
Guido Günther 01b9288f15 d/control: Use an appropriate standards version
We should at least use the one from Debian stable
2020-07-24 09:31:53 +02:00
Guido Günther debb3404f5 debian: Run wrap-and-sort -ast
This gives consistent ordering.
2020-07-24 09:31:53 +02:00
Joao Azevedo ac7ecb81f9 Merge branch 'shellcheck' into 'master'
shelllcheck cleanups

See merge request librem5-apps/diy-contacts-importer!3
2020-07-23 15:18:16 +00:00
Guido Günther 1789724bcf Use shellcheck as test
This makes sure shell scripting is on the safer side.
2020-07-23 16:14:03 +02:00
Guido Günther 7404f3c573 contacts-importer: Protect against whitespace on import 2020-07-23 16:11:22 +02:00
Guido Günther 9530ebe594 contacts-importer: Fix error checking
The current error code would never execute since the script
runs with -e. So run each import with failure detection and
report that at the end.
2020-07-23 16:09:11 +02:00
Guido Günther 7906fefe11 contacts-importer: Protect against space in $TEMP 2020-07-23 16:05:48 +02:00
Guido Günther 6b7a40e890 contacts-importer: Use $() to make shellcheck happy 2020-07-23 16:04:50 +02:00
Guido Günther c3872beba3 contacts-importer: Drop unneeded `` 2020-07-23 16:04:29 +02:00
Guido Günther 4e576defbc contacts-importer: Act on $FILE
This avoids picking up $1
2020-07-23 16:01:30 +02:00
Guido Günther 90938c6ce7 contacts-importer: Protect against spaces in filenames 2020-07-23 16:01:04 +02:00
Joao Azevedo ab785e2dd9 Merge branch 'librem5-ci' into 'master'
Use debian/librem5-ci

See merge request librem5-apps/diy-contacts-importer!2
2020-07-23 13:43:30 +00:00
Joao Azevedo 9ae79ccd0b Merge branch 'mime' into 'master'
Associate with mime type

See merge request librem5-apps/diy-contacts-importer!1
2020-07-23 13:39:28 +00:00
Guido Günther 676f0ca0e5 Add trivial autopkgtest
This makes sure we install correctly and start to run.
2020-07-23 12:33:27 +02:00
Guido Günther 366a59b044 contacts-importer: Support --help
Always nice when s.th. ends up in /usr/bin/
2020-07-23 12:27:56 +02:00
Guido Günther ee1801fd45 Use 'full' pipeline and recommended path
For packaged apps we want to make it obvious where things
run (so we don't conflict with upstream gitlab-ci files).
2020-07-23 12:19:23 +02:00
Guido Günther 9d0fb24f83 Associate with mime type
This allows to e.g. import vcards received via bluetooth right away.
2020-07-23 11:44:21 +02:00
Joao Azevedo 9bec70f81c updated README 2020-07-22 23:29:07 +02:00
22 changed files with 395 additions and 113 deletions

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
APPDATA = \
sm.puri.librem5.goodies.appdata.xml \
$(NULL)
all: shell-check appstream-check
shell-check:
shellcheck l5-contacts-importer l5-screenshot l5-screen-recorder
appstream-check:
appstream-util validate-relax $(APPDATA)
.PHONY: all shell-check appstream-check

View File

@ -1,44 +1,31 @@
# diy contacts importer
# Librem 5 Goodies
This repo is just a place to dump experimental scripts to import VCF files.
This project serves to create a deb package with several temporary helper bash scripts created for the Librem 5 phone.
**The use case for it is:**
Bring your script here and it might be packaged :tada:
- To allow a Librem 5 user that is migrating from Android to move his contacts as a vcf file to the Librem 5 and import
Please avoid scripts that require cloning and building packages from source.
This issue is common to all projects that used Evolution (the database backend of gnome contacts) to manage contacts: Openmoko, Uuntu Touch
When one of these temporary helper scripts is no longer considered necessary, it will be removed (say if features provided by the script in question are added to `phosh`).
**Dependencies:**
#### Scripts added to this package:
- `yad`
- `syncevolution`
- `sed`
- `awk`
- `libnotify-bin`
---
**logic:** This script breaks down a vcf file with multiple contacts into multiple files. One vcard file per contact entry and imports them one by one.
|Script | Description | Dependencies | Notes |
|:--:|:--:|:--:|:--:|
|Contacts Importer| Allows to import contacts from a vcard file to GNOME Contacts. Can work with a UI and from command line interface|`yad`, `syncevolution`, `libnotify-bin`, `Evolution Data Server`| This script will be removed from this paclage when the version of GNOME-Contacts available in PureOS supports importing contacts from a vcard file. |
|Screenshot| Allows to take screenshots in the Librem 5 phone|`yad`, `grim`, `libnotify-bin`, `xdg-user-dirs`| This script will be removed from this package when there is a native app that can take screenshots in `Phosh`. |
|Screen recorder | A simple application to record the screen| `wf-recorder`, `yad`, `libnotify-bin` | This script will be removed from this package when `phosh` has better support for recording.|
The reason for this is that importing all the contacts at once from one single file with `syncevolution` is error prone.
**Previously removed scripts:**
**Current State:** if you run the command `./contacts-importer.sh` it will show a yad/gtk window for the user to select the vcard file and import contacts to `GNOME Contacts`.
- Scale the screen: A simple application to scale the screen. This is now supported in `phosh`.
**problems:** See the issues list.
#### Adding a script to this package:
This is only a quick and dirty bash script to do this task.
The proper way to do this: "having a easy way to import vcard files to the Librem 5/PureOS and GNOME, with GNOME Contacts and Evolution Data Server as a backend"
Would be to:
1. Someone writing a python/gtk application to do this.
2. (And even better) Someone submiting a patch to GNOME-Contacts for that application to support importing vcard files.
- https://gitlab.gnome.org/GNOME/gnome-contacts
- https://developer.gnome.org/eds/3.22/
**Other References:**
- http://wiki.openmoko.org/wiki/Import_Vcf_Contacts#Import_and_Manage_Scripts
- https://www.isticktoit.net/?p=1536
- https://help.ubuntu.com/community/SyncEvolution/Synchronize-evolution-data-with-caldav-cardav-server
- https://syncevolution.org/wiki/thunderbird-phone-sync
- https://askubuntu.com/questions/360466/how-do-i-sync-contacts-on-ubuntu-touch
- Make a new branch based on the `pureos/latest` branch and work from it.
- Make a merge request.
- Avoid scripts that download and build source code. If you need a dependency not available in PureOS, package it :D
- If your script stores files somewhere, then please use `xdg-user-dir` to set the path instead of harcoding directory names like "Documents", "Videos", this is usefull because not all users have their OS in English. See example here; https://source.puri.sm/librem5-apps/librem5-goodies/-/blob/pureos/byzantium/l5-screenshot#L27 `xdg-user-dir` is also quite usefull
- if you are not confortable in commiting to a Deb package then open an issue asking for the script to be packaged and we will work it out

View File

@ -1,50 +0,0 @@
#!/bin/bash -e
# Adapted for the L5 with gnome-contacts
# Original Script: https://www.isticktoit.net/?p=1536
#Selecting a file
FILE=`yad --title "Import Contacts" --text="Select a VCF file to import" --file=`
if [ "$FILE" == "" ]; then
`yad --title "Import Contacts" --text="You did not selected any file"` exit 1
fi
notify-send -t 1000 "Import Contacts" "Importing Contacts from $FILE"
#Name of the database where the contacts will be imported to.
CONTACTDB=$(syncevolution --print-databases | grep "system-address-book"| sed 's#(.*##' | sed 's# ##g' )
#Temp directory to mess with files:
TEMP=$(mktemp -d -t contacts-importer-XXXXXXXXXXXXX-$(date +%Y-%m-%d-%H-%M-%S))
#Some control info to make sure the file is a vcard
MIMETYPE=$(file --mime-type -b $FILE)
CONTROL="text/vcard"
if [[ "$MIMETYPE" != "$CONTROL" ]]; then
notify-send -t 1000 "File is not a vcard! Bye!" && exit 1
fi
#Begin importing contacts
cd $TEMP
cat $FILE | awk ' /BEGIN:VCARD/ { ++a; fn=sprintf("card_import_L5_%02d.vcf", a); print "Writing: ", fn } { print $0 >> fn; } ' $1
for f in $TEMP/card_import_L5*
do syncevolution --import ${f%} backend=evolution-contacts database=${CONTACTDB}
done
if [ $? -eq 0 ]
then
notify-send "Successful import";
exit 0
else
notify-send "Error" >&2
exit 1
fi

View File

@ -1,6 +0,0 @@
[Desktop Entry]
Name=Contacts Importer
Type=Application
Icon=preferences-desktop-personal
Exec=/usr/bin/contacts-importer
Categories=Utility;

97
debian/changelog vendored
View File

@ -1,5 +1,100 @@
librem5-goodies (0.0.7pureos1) byzantium; urgency=medium
[ Guido Günther ]
* Make it a native package again.
There's no upstream other than us afaik.
* ci: Drop check-tarball.
Not needed (and hence not working) for a 3.0 (native) package
-- Guido Günther <agx@sigxcpu.org> Sat, 30 Oct 2021 15:40:47 +0200
librem5-goodies (0.0.7-1pureos2) byzantium; urgency=medium
[ João Azevedo ]
* Prepare release to byzantium.
- Update CI
- New release number
- Increase debhelper version to 13
-- João Azevedo <joao.azevedo@puri.sm> Sat, 30 Oct 2021 00:36:54 +0200
librem5-goodies (0.0.7pureos1) amber-phone; urgency=medium
[ João Azevedo ]
* New upstream release.
- Remove scale the screen script, closes #15
- Remove wl-randr as a dependency as it is no longer required
- Update packge discription to include l5-screen-recorder
- Update appdata file to include the l5-screen-recorder
- Add l5-screen-recorder to makefile build tests
- Fix shellcheck warning with l5-screen-recorder
- Add usage function to l5-screen-recorder
- Add l5-screen-recorder icon to notifications
- Add l5-screen-recorder to build tests
- Update debhelper version
[ David Hamner ]
* Add l5-screen-recorder:
- Add l5-screen-recorder script and l5-screen-recorder desktop file
- Add wf-recorder as a dependency required by l5-screen-recorder
- Add paths for l5-screen-recorder in librem5-goodies.install file
-- João Azevedo <joao.azevedo@puri.sm> Fri, 29 Oct 2021 23:28:46 +0200
librem5-goodies (0.0.6pureos1) amber-phone; urgency=medium
* Non-maintainer upload.
* Use a PureOS compatible version tag
-- Guido Günther <agx@sigxcpu.org> Wed, 01 Sep 2021 10:38:26 +0200
librem5-goodies (0.0.6) amber-phone; urgency=medium
* New upstream release.
- Make screenshot script l10n friendy, closes: #13
- d/control: add dependency; xdg-user-dirs
- Add scale the screens support for QEMU image closes: #12
-- João Azevedo <joao.azevedo@puri.sm> Sun, 18 Apr 2021 13:33:50 +0200
librem5-goodies (0.0.5) amber-phone; urgency=medium
* New upstream release.
- added tags in the desktop files for then to be visible in phosh
- Added appstream metadata file
- Added Scale the screen script
- Updated the control file and dependencies
- Updated changelog file
- Updated README file
-- João Azevedo <joao.azevedo@puri.sm> Mon, 23 Nov 2020 13:26:52 +0100
librem5-goodies (0.0.4) amber-phone; urgency=medium
* New upstream release.
- replaced zenity with yad in the screenshot script
- changed the scripts names to have the prefix l5-
- Updated README file
-- João Azevedo <joao.azevedo@puri.sm> Tue, 04 Aug 2020 22:17:24 +0200
librem5-goodies (0.0.3) 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
librem5-goodies (0.0.2) amber-phone; urgency=medium
* New upstream release.
- Changed the project name.
- Changed the target repo to amber-phone.
-- João Azevedo <joao.azevedo@puri.sm> Sun, 26 Jul 2020 16:23:29 +0200
contacts-importer (0.0.1) byzantium; urgency=medium
* Initial release.
* Initial release.
-- João Azevedo <joao.azevedo@puri.sm> Fri, 19 Jun 2020 13:47:46 +0200

1
debian/compat vendored
View File

@ -1 +0,0 @@
11

View File

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

37
debian/control vendored
View File

@ -1,18 +1,31 @@
Source: contacts-importer
Source: librem5-goodies
Section: comm
Priority: optional
Maintainer: PureOS Maintainers <pureos-project@lists.puri.sm>
Maintainer: João Azevedo <joao.azevedo@puri.sm>
Build-Depends:
debhelper (>= 11),
Homepage: https://source.puri.sm/pureos/packages/diy-contacts-importer
Vcs-Git: https://source.puri.sm/pureos/packages/diy-contacts-importer.git
Vcs-Browser: https://source.puri.sm/pureos/packages/diy-contacts-importer
Standards-Version: 0.0.1
appstream-util,
debhelper-compat (= 13),
shellcheck,
Homepage: https://source.puri.sm/librem5-apps/librem5-goodies
Vcs-Git: https://source.puri.sm/librem5-apps/librem5-goodies.git
Vcs-Browser: https://source.puri.sm/librem5-apps/librem5-goodies
Standards-Version: 4.3.0
Package: contacts-importer
Package: librem5-goodies
Architecture: all
Depends:
${misc:Depends}, yad, syncevolution, libnotify-bin, evolution-data-server,
Description: Diy contacts importer
A simple script to import contacts from vcards into Evolution Data Server
evolution-data-server,
grim,
libnotify-bin,
syncevolution,
yad,
xdg-user-dirs,
wf-recorder,
${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:
- L5 Contacts Importer: A simple application to import contacts from a vcard
file to GNOME Contacts.
- L5 Screenshot: A simple application to make screenshots on the Librem 5
- L5 Screen Recorder: A simple application to record the Librem 5 screen

5
debian/copyright vendored
View File

@ -1,6 +1,6 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://source.puri.sm/pureos/packages/diy-contacts-importer
Upstream-Name: diy-contacts-importer
Source: https://source.puri.sm/librem5-apps/librem5-goodies
Upstream-Name: librem5-goodies
Files: *
Copyright: (C) 2019 João Azevedo (joao.azvedo@puri.sm)
@ -20,4 +20,3 @@ License: GPL-3+
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

2
debian/files vendored
View File

@ -1,2 +0,0 @@
contacts-importer_0.0.1_all.deb comm optional
contacts-importer_0.0.1_amd64.buildinfo comm optional

View File

@ -1,9 +1,9 @@
include:
- 'https://source.puri.sm/Librem5/librem5-ci/raw/master/librem5-pipeline-definitions.yml'
- 'https://source.puri.sm/Librem5/librem5-ci/raw/master/librem5-pipeline-byzantium-jobs.yml'
stages:
- package
- test-package
package:deb-pureos-amber:
image: pureos/amber
extends: .l5-build-debian-package

7
debian/librem5-goodies.install vendored Normal file
View File

@ -0,0 +1,7 @@
l5-contacts-importer /usr/bin
l5-contacts-importer.desktop /usr/share/applications
l5-screenshot /usr/bin
l5-screenshot.desktop /usr/share/applications
l5-screen-recorder /usr/bin
l5-screen-recorder.desktop /usr/share/applications
sm.puri.librem5.goodies.appdata.xml /usr/share/metainfo

4
debian/rules vendored
View File

@ -2,3 +2,7 @@
%:
dh $@
override_dh_auto_test:
make

3
debian/tests/control vendored Normal file
View File

@ -0,0 +1,3 @@
Test-Command: /usr/bin/l5-contacts-importer --help && /usr/bin/l5-screenshot --help && l5-screen-recorder --help
Restrictions: superficial
Depends: librem5-goodies

9
gbp.conf Normal file
View File

@ -0,0 +1,9 @@
[DEFAULT]
debian-branch = pureos/byzantium
debian-tag = pureos/%(version)s
upstream-tag = v%(version)s
upstream-branch = master
pristine-tar = True
[tag]
sign-tags = True

71
l5-contacts-importer Executable file
View File

@ -0,0 +1,71 @@
#!/bin/bash -e
# Adapted for the L5 with gnome-contacts
# Original Script: https://www.isticktoit.net/?p=1536
function usage()
{
echo "Usage: $0 <vcard-file>"
exit 0
}
NOTIFY_SEND="notify-send -i preferences-desktop-personal"
case "$1" in
--help|-h|-?)
usage
;;
esac
#Selecting a file
if [ -n "$1" ]; then
FILE="$1"
else
FILE=$(yad --title "Import Contacts" --text="Select a VCF file to import" --file=)
fi
if [ "$FILE" == "" ]; then
yad --title "Import Contacts" --text="You did not selected any file"
exit 1
fi
$NOTIFY_SEND -t 1000 "Import Contacts" "Importing Contacts from $FILE"
#Name of the database where the contacts will be imported to.
CONTACTDB=$(syncevolution --print-databases | grep "system-address-book"| sed 's#(.*##' | sed 's# ##g' )
#Temp directory to mess with files:
TEMP=$(mktemp -d -t contacts-importer-XXXXXXXXXXXXX-"$(date +%Y-%m-%d-%H-%M-%S)")
#Some control info to make sure the file is a vcard
MIMETYPE=$(file --mime-type -b "$FILE")
CONTROL="text/vcard"
if [[ "$MIMETYPE" != "$CONTROL" ]]; then
$NOTIFY_SEND -t 1000 "File is not a vcard! Bye!" && exit 1
fi
#Begin importing contacts
cd "$TEMP"
awk ' /BEGIN:VCARD/ { ++a; fn=sprintf("card_import_L5_%02d.vcf", a); print "Writing: ", fn } { print $0 >> fn; } ' "$FILE"
RET=0
for f in "$TEMP"/card_import_L5*
do
syncevolution --import "${f%}" backend=evolution-contacts database="${CONTACTDB}" || RET=1
done
if [ $RET -eq 0 ]
then
$NOTIFY_SEND "Successful import"
exit 0
else
$NOTIFY_SEND "Error"
exit 1
fi

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Name=Contacts Importer
Type=Application
Icon=preferences-desktop-personal
Exec=/usr/bin/l5-contacts-importer %U
Categories=Utility;
MimeType=text/x-vcard;
# Translators: Do NOT translate or transliterate this text (these are enum types)!
X-Purism-FormFactor=Workstation;Mobile;

40
l5-screen-recorder Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
# GPL3
function usage()
{
echo "Usage: Just press the Screen Shot Icon in the app tray"
exit 0
}
NOTIFY_SEND="notify-send -i emblem-videos-symbolic"
case "$1" in
--help|-h|-?)
usage
;;
esac
VIDEO="$(xdg-user-dir VIDEOS)/$(date +%Y-%m-%d-%H%M%S).avi"
yad --title ScreenCapture --text "A simple GUI to record the screen" --button="Start capture:100" --button="Quit:0" --buttons-layout=center
start_window_return=$?
if [[ $start_window_return -eq 100 ]]
then
wf-recorder -a -f "$VIDEO" --codec=asv1 &
else
exit
fi
yad --title ScreenCapture --text "Screen capture is actively running. \\nFile: $VIDEO" --button='Stop capture:100' --buttons-layout=center
exit_window_return=$?
if [[ $exit_window_return -eq 100 ]]
then
killall -2 wf-recorder
fi
if test -f "$VIDEO"
then
$NOTIFY_SEND ScreenCapture "Video stored at $VIDEO"
fi

View File

@ -0,0 +1,8 @@
[Desktop Entry]
Name=Screen Recorder
Type=Application
Icon=emblem-videos-symbolic
Exec=/usr/bin/l5-screen-recorder
Categories=Utility;
# Translators: Do NOT translate or transliterate this text (these are enum types)!
X-Purism-FormFactor=Workstation;Mobile;

44
l5-screenshot Executable file
View File

@ -0,0 +1,44 @@
#!/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
# Adding usage information and Icon to libnotify
function usage()
{
echo "Usage: $0, or just press the Screen Shot Icon in the app tray"
exit 0
}
NOTIFY_SEND="notify-send -i applets-screenshooter"
case "$1" in
--help|-h|-?)
usage
;;
esac
#Variable
SCREENSHOT="$(xdg-user-dir 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=$(yad --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}"

9
l5-screenshot.desktop Normal file
View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=Screen Shot
Type=Application
Icon=applets-screenshooter
Exec=/usr/bin/l5-screenshot %U
Categories=Utility;
# Translators: Do NOT translate or transliterate this text (these are enum types)!
X-Purism-FormFactor=Workstation;Mobile;

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2018-2019 Purism, SPC -->
<component type="desktop-application">
<id>sm.puri.librem5.goodies</id>
<metadata_license>gpl-3+</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>Librem 5 Goodies</name>
<summary>A collection of bash scripts for the Librem 5</summary>
<description>
<p>Librem5 Goodies contains the following scripts:</p>
<p>- Contacts importer: An application to import contacts from a vcard</p>
<p>- Screen Shot: An application to make screenshots of the Librem 5</p>
<p>- Screen recorder: An application to record the Librem 5 screen</p>
</description>
<url type="homepage">https://source.puri.sm/librem5-apps/librem5-goodies/</url>
<developer_name>Purism Developers</developer_name>
<update_contact>support@puri.sm</update_contact>
<custom>
<value key="Purism::form_factor">workstation</value>
<value key="Purism::form_factor">mobile</value>
</custom>
<provides>
<binary>librem5-goodies</binary>
</provides>
</component>