Page MenuHomePhabricator (Chris)

No OneTemporary

Size
15 KB
Referenced Files
None
Subscribers
None
diff --git a/README.md b/README.md
index e6d124b..703a684 100644
--- a/README.md
+++ b/README.md
@@ -1,63 +1,64 @@
# barcoder
Cheap, nasty tool to put clipboard or stdin into a barcode (so you can copy to a smartphone)
I really just developed this for myself. You're welcome to debug it, package it, redistribute it, refactor it...
You'll find that if you try to encode a whole book into it, it segfaults... I'll look into that later...
-I've linked against libqrencode and libdmtx but I also _completely absorbed_ the files from the excellent project `qqrencode` into the structure so that they just got built in... To simplify installation. It is also released under an MIT licence, woo!
+I've linked against libqrencode and libdmtx but I also _completely absorbed_ the files from the excellent project `qqrencode` into the structure so that they just got built in... To simplify installation. That part is licenced under LGPL 2.1+.
I've included a couple of screenshots at the end of the readme.
Since I wrote this, the native barcode implementation was restored in Klipper! Yay!
+That does mean that this program is largely obsolete.
For what I wanted, it works.
Example setup for klipper:
* Right-click on klipper in your system tray
* Select "Configure" from the context menu
* In the "Actions" tab, under "Action List", add a new action.
* For the regular expression, enter `.*` to capture everything.
* For description, write "Show Barcode" (or whatever you want)
* Add a command. In the command entry field, write `echo "%s"|barcoder` (where "barcoder" is the path to your barcoder executable)
Now, any time that you want klipper to generate a barcode like it used to in the good old days (a couple years ago):
* Left-click klipper in your system tray
* hover over the clip you want to share
* Press the little square icon which is supposed to represent clipboard actions
* Click "Show Barcode" (this is your description from earlier)
* Open your phone's barcode scanner and point it at the barcode
* voila, depending on your phone's setup, you now have the text info on your phone ready to paste where you want
To make:
* `sudo apt-get install build-essentials qt5-default libdmtx-dev libqrencode-dev`
Then:
* `cd barcoder && qmake && make` .. manually move barcoder into your path or a known location
* *OR*
* use qtcreator
* *OR*
* adapt to your fancy cmake thingy
Requirements:
* objdump -x barcoder|grep NEEDED
* NEEDED libqrencode.so.3
* NEEDED libdmtx.so.0
* NEEDED libQt5Svg.so.5
* NEEDED libQt5Widgets.so.5
* NEEDED libQt5Gui.so.5
* NEEDED libQt5Core.so.5
* NEEDED libstdc++.so.6
* NEEDED libgcc_s.so.1
* NEEDED libc.so.6
These libraries are already installed on both your development machine _and_ the machine with Klipper.
*****
![](http://i.imgur.com/34AUDS5.png "Example of configuration")
***
![](http://i.imgur.com/4s0WHiM.png "Example of invoking a custom action")
![](http://i.imgur.com/o5Z34dj.png "Example of generated barcodes")
diff --git a/barcoder.desktop b/barcoder.desktop
new file mode 100644
index 0000000..b76cb99
--- /dev/null
+++ b/barcoder.desktop
@@ -0,0 +1,37 @@
+[Desktop Entry]
+Terminal=false
+TryExec=barcoder
+Exec=barcoder
+Icon=barcoder
+Type=Application
+Categories=Qt;Utility;
+StartupNotify=false
+Name=barcoder
+Name[ca]=barcoder
+Name[da]=barcoder
+Name[fr]=barcoder
+Name[lt]=barcoder
+Name[sr]=баркода
+Name[sr@ijekavian]=баркода
+Name[sr@ijekavianlatin]=barkoda
+Name[sr@latin]=barkoda
+GenericName=Clipboard Tool
+GenericName[ca]=Eina de porta-retalls
+GenericName[da]=Udklipsholderværktøj
+GenericName[de]=Zwischenablage
+GenericName[fr]=Presse-papiers
+GenericName[lt]=Iškarpinės įrankis
+GenericName[sr]=Алатка за клипборд
+GenericName[sr@ijekavian]=Алатка за клипборд
+GenericName[sr@ijekavianlatin]=Alatka za klipbord
+GenericName[sr@latin]=Alatka za klipbord
+Comment=Clipboard Tool
+Comment[ca]=Eina de porta-retalls
+Comment[da]=Udklipsholderværktøj
+Comment[de]=Zwischenablage
+Comment[fr]=Presse-papiers
+Comment[lt]=Iškarpinės įrankis
+Comment[sr]=Алатка за клипборд
+Comment[sr@ijekavian]=Алатка за клипборд
+Comment[sr@ijekavianlatin]=Alatka za klipbord
+Comment[sr@latin]=Alatka za klipbord
diff --git a/barcoder.pro b/barcoder.pro
index 5013f5e..796b03f 100644
--- a/barcoder.pro
+++ b/barcoder.pro
@@ -1,132 +1,110 @@
#-------------------------------------------------
#
# Project created by QtCreator 2017-02-16T22:41:52
#
#-------------------------------------------------
# svg?
QT += core gui svg
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = barcoder
TEMPLATE = app
-# The following define makes your compiler emit warnings if you use
-# any feature of Qt which as been marked as deprecated (the exact warnings
-# depend on your compiler). Please consult the documentation of the
-# deprecated API in order to know how to port your code away from it.
+VERSION_MAJOR = 1
+VERSION_MINOR = 0
+VERSION_BUILD = 1
+
+DEFINES += "VERSION_MAJOR=$$VERSION_MAJOR"\
+ "VERSION_MINOR=$$VERSION_MINOR"\
+ "VERSION_BUILD=$$VERSION_BUILD"
+
+#Target version
+VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR}.$${VERSION_BUILD}
+
DEFINES += QT_DEPRECATED_WARNINGS
+DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050000
-# You can also make your code fail to compile if you use deprecated APIs.
-# In order to do so, uncomment the following line.
-# You can also select to disable deprecated APIs only up to a certain version of Qt.
-#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
INCLUDEPATH += 3rdparty/qqrencode
LIBS += -lqrencode -lpng -ldmtx
SOURCES += main.cpp\
mainwindow.cpp\
3rdparty/qqrencode/qqrencode.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
-
-
-#An AUTHORS file with copyright information.
-#A manual: ${PACKAGE}.1 or similar.
-#A COPYING file with GPL information or some other license.
-#An appropriate build file for the package. For C/C++ programs,
-#I recommend using cmake; for python, setup.py, etc.
-#https://www.lpenz.org/articles/debgit/index.html
-
-
-
-# static_and_shared — generates makefiles for both static and shared builds.
-# Note that shared_and_static is ignored.
-# A primary makefile named $$MAKEFILE (Makefile by default) is generated and
-# subsidiary makefiles named $$MAKEFILE.StaticRelease and
-# $$MAKEFILE.SharedRelease if CONFIG contains release (the default for unix platforms),
-# or $$MAKEFILE.StaticDebug and $$MAKEFILE.SharedDebug if CONFIG contains debug
-# (the default for win32), or both if CONFIG contains debug_and_release
-# (for a total of five makefiles) are generated.
-# The primary makefile will contain a set of {static,shared}{debug,release}[-xxx] targets
-# corresponding to the secondary makefiles that can be used to invoke the
-# appropriate makefile rules. However the default first (as well as install, and uninstall)
-# targets will only have a single prerequisite (only one library file is built by default)
-# depending on the active CONFIG: static-release, static-debug, shared-release, or shared-debug;
-# add static or shared to CONFIG, in addition to static_and_shared,
-# and release or debug in addition to debug_and_release to get qmake to select the corresponding
-# target for the first target prerequisite.
-
unix {
#VARIABLES
isEmpty(PREFIX) {
PREFIX = /usr #QT_INSTALL_PREFIX
}
BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"
# MAKE tarball
- tgz.target = tarball
- tgz.commands = git archive --prefix $${TARGET}-`git log|grep '^commit'|wc -l`/ -o $${TARGET}-`git log|grep '^commit'|wc -l`.tar.gz HEAD . \":(exclude)debian\" \":(exclude)data\"
- tgz.depends = .git
- tgz.path = .
+ tarball.commands = git archive --prefix $${TARGET}_$${VERSION}/ -o $${TARGET}_$${VERSION}.orig.tar.gz HEAD . \":(exclude)debian\" \":(exclude)data\"
+ tarball.depends = .git
+ tarball.path = .
# MAKE zip
- zip.target = zip
- zip.commands = git archive --prefix $${TARGET}-`git log|grep '^commit'|wc -l`/ -o $${TARGET}-`git log|grep '^commit'|wc -l`.zip HEAD . \":(exclude)debian\" \":(exclude)data\"
- zip.depemds = .git
+ zip.commands = git archive --prefix $${TARGET}_$${VERSION}/ -o $${TARGET}_$${VERSION}.orig.zip HEAD . \":(exclude)debian\" \":(exclude)data\"
+ zip.depends = .git
zip.path = .
- uclean.commands += find . -name \"*.zip\" -exec rm -v {} \;;
- uclean.commands += find . -name \"*.tar.gz\" -exec rm -v {} \;;
- uclean.commands += find . -name \"*.deb\" -exec rm -v {} \;;
- uclean.commands += rm -f data/changelog.gz;
- clean.depends = uclean
+ mangz.depends = .git
+ mangz.commands = gzip -c -9 docs/$${TARGET}.1 > docs/$${TARGET}.1.gz
+ mangz.files = docs/*.1
+ mangz.path = /usr/share/man/man1
+ man.depends = mangz
+ man.path = /usr/share/man/man1
+ man.files = docs/*.?.gz
-QMAKE_EXTRA_TARGETS += tgz zip deb man doc clean uclean
+ # i don't provide command for icon but something like convert barcoder.xcf barcoder-256.png
+ icon.path = /usr/share/$$TARGET
+ icon.files = $$PWD/$${TARGET}-256.png
+ desktop.depends = icon
+ desktop.path = /usr/share/applications/
+ desktop.files = $$PWD/$${TARGET}.desktop
- #MAKE INSTALL
- INSTALLS += target man doc# desktop icon64
- target.path = $$BINDIR
- # man 1 is apps, and lintian wants exectuables to have man pages
- man.target = man
- man.path = $$DATADIR/man/man1
- man.files += data/$${TARGET}.1.gz
+ QMAKE_CLEAN += $$PWD/*zip $$PWD/*.tar.gz $$PWD/*.deb $$PWD/docs/*gz
- doc.target = docs
- doc.path = $$DATADIR/doc/$${TARGET}
- # gcg or git2cl ?
- doc.commands = gcg -O deb -n $${TARGET} -D unstable -c 1.0.0 | gzip > data/changelog.gz
- doc.files += data/changelog.gz
- doc.files += data/copyright
-# doc.files += data/README.gz
-# /usr/share/doc/firefox/MPL-2.0.gz
-# desktop.path = $$DATADIR/applications
-# desktop.files += $${TARGET}.desktop
+ QMAKE_EXTRA_TARGETS += tarball zip deb man mangz desktop icon
+
+
+ #MAKE INSTALL
+
+ INSTALLS += target mangz man desktop icon
+
+ target.path = $$BINDIR
-# icon64.path = $$DATADIR/icons/hicolor/64x64/apps
-# icon64.files += data/$${TARGET}.png
deb.target = deb
deb.path = .
-# deb.commands = tar -f *.tar.gz --delete debian; tar -f *.tar.gz --delete data;
-# deb.commands += gcg -O deb -n barcoder -D unstable -c 1.0.0
- deb.depends = .git doc man tgz
+ deb.depends = debian/control
+ deb.commands = dpkg-buildpackage -uc -us
-target.depends = deb
}
+DISTFILES += docs/*gz \
+ $${TARGET}.desktop \
+ $${TARGET}-256.png
+
+
+
+
+
+
diff --git a/data/barcoder.1.gz b/data/barcoder.1.gz
deleted file mode 100644
index a78771d..0000000
Binary files a/data/barcoder.1.gz and /dev/null differ
diff --git a/debian/barcoder.lintian-override b/debian/barcoder.lintian-override
new file mode 100644
index 0000000..968fc8b
--- /dev/null
+++ b/debian/barcoder.lintian-override
@@ -0,0 +1,4 @@
+barcoder binary: source-is-missing */bin/barcoder
+barcoder changes: bad-distribution-in-changes-file unstable
+barcoder binary: unknown-section multiverse/utils
+barcoder-dbgsym: unknown-section multiverse/debug
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..d3b3e22
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,65 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Source: <https://scm.opengress.net/diffusion/4/>
+
+Files: *
+Copyright: 2020 Chris <sneaky@yellow.lan>
+License: MIT
+
+Files: 3rdparty/qqrencode/*
+Copyright: 2013 Kentaro Fukuchi <kentaro@fukuchi.org>
+License: LGPL-2.1+
+
+Files: barcoder.png
+Copyright: 2015 Palo Kisa <palo.kisa@gmail.com>
+License: GPL-2.0+
+
+License: GPL-2.0+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+License: LGPL-2.1+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ .
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
diff --git a/docs/barcoder.1 b/docs/barcoder.1
new file mode 100644
index 0000000..d53c78f
--- /dev/null
+++ b/docs/barcoder.1
@@ -0,0 +1,24 @@
+.\" Manpage for barcoder.
+.\" Contact sneakywhoami on github to correct errors or typos.
+.TH BARCODER 1 "28 Jun 2020" "1.0.0" "barcoder man page"
+.SH NAME
+barcoder \- Display Datamatrix / QR 2D barcodes on screen
+.SH SYNOPSIS
+.B barcoder
+.RI [ options ]
+.SH DESCRIPTION
+.B barcoder
+is a Graphical program which will show Datamatrix and QR Codes for your clipboard content, or for the first shell argument.
+.SH OPTIONS
+.B barcoder
+does not require any options, however you can pass it text on the command line.
+.SH SEE ALSO
+.BR xclip(1),
+.BR xclipboard(1),
+.BR libdmtx(3).
+.SH BUGS
+datamatrix display produces distorted output for some inputs (eg
+.RI "--help"
+) and oversized inputs segfault.
+.\".SH AUTHOR
+.\"Chris <chris@chris-nz.com>

File Metadata

Mime Type
text/x-diff
Expires
Thu, Sep 11, 1:44 PM (13 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42673
Default Alt Text
(15 KB)

Event Timeline