{"id":21614184,"url":"https://github.com/hongquan/cobang","last_synced_at":"2025-05-15T20:01:07.534Z","repository":{"id":39993340,"uuid":"254916386","full_name":"hongquan/CoBang","owner":"hongquan","description":"A QR code scanner desktop app for Linux","archived":false,"fork":false,"pushed_at":"2025-04-25T01:47:12.000Z","size":2392,"stargazers_count":294,"open_issues_count":18,"forks_count":30,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-08T13:48:17.932Z","etag":null,"topics":["barcode-scanner","gobject-introspection","gstreamer","gtk","made-in-vietnam","python3","qrcode-reader","qrcode-scanner","zbar"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hongquan.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-11T17:10:25.000Z","updated_at":"2025-05-01T21:31:10.000Z","dependencies_parsed_at":"2024-04-29T06:26:27.655Z","dependency_job_id":"e8ff6f81-2f7e-4df4-b2c9-17da1a93743b","html_url":"https://github.com/hongquan/CoBang","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hongquan%2FCoBang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hongquan%2FCoBang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hongquan%2FCoBang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hongquan%2FCoBang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hongquan","download_url":"https://codeload.github.com/hongquan/CoBang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414457,"owners_count":22067263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode-scanner","gobject-introspection","gstreamer","gtk","made-in-vietnam","python3","qrcode-reader","qrcode-scanner","zbar"],"created_at":"2024-11-24T22:07:08.853Z","updated_at":"2025-05-15T20:01:07.223Z","avatar_url":"https://github.com/hongquan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"======\nCoBang\n======\n\n.. image:: https://madewithlove.now.sh/vn?heart=true\u0026colorA=%23ffcd00\u0026colorB=%23da251d\n\nA native QR Code and barcode scanner application for Linux desktop.\n\n.. image:: https://github.com/hongquan/CoBang/blob/main/data/vn.hoabinh.quan.CoBang.svg\n    :width: 400\n\n\nCoBang can scan barcode, QR code from webcam or static image, local or remote.\n\nIn the future, it will support generating QR code and running on Linux phones.\n\n\nName\n++++\n\nIt is \"`Cỏ bàng \u003cco_bang_\u003e`_\" (Lepironia articulata), in Vietnamese. This plant is used for making handicraft which has pattern like QR code.\n\nMotivation\n++++++++++\n\nQR codes are more and more widely used in daily life, even in developing countries like Việt Nam. While there already are lot of QR code scanner apps for mobile phones, very few exist for Linux desktop. All don't satisfy me in some aspects:\n\n- `QtQR`_:\n\n  + Pretty old code.\n  + Its integration of other library is not good: cannot embed webcam video into its window.\n  + Depend on X Window System.\n\n- `zbarcam`_:\n\n  + Command-line tool, it creates a very basic window with only video display, no control buttons, no result display, no label.\n  + Users have to come back to Terminal to see the result, and the result are just raw text, no decoding for structured data like WiFi info, URL etc.\n  + Depend on X Window System.\n\n- Some Electron-based programs in GitHub:\n\n  + Using Electron stack, which is unnecessary fat [1]_.\n  + The UI doesn't look native.\n  + Depend on X Window System.\n\nX-dependence is a major concern because I want to boost up the migration of Linux desktop from old X Window System to more modern Wayland. Those X-dependent applications drag the transition, not only does it make the OS installation big (have to include an X server next to Wayland compositor), but also waste time fixing bugs of X - Wayland cooperation.\n\nSo I decide to build *CoBang*, a new, native Linux application for scanning QR code.\n\n\nScreenshots\n+++++++++++\n\n.. image:: https://i.imgur.com/a4KoZCg.png\n.. image:: https://i.imgur.com/AigLax4.png\n.. image:: https://i.imgur.com/Q9xwcep.png\n\n\nInstall\n+++++++\n\nDue to dependence on GObject, GTK libraries and being a desktop app with extra desktop-integration files (icons, \\*.desktop etc.),\nCoBang cannot be installed from `PyPI`_. You have to install it with OS package manager.\n\nUbuntu\n------\n\nCoBang is packaged as *\\*.deb* file for Ubuntu and derivatives (Linux Mint etc.). You can install it from `PPA`_:\n\n.. code-block:: console\n\n  $ sudo add-apt-repository ppa:ng-hong-quan/ppa\n  $ sudo apt update\n  $ sudo apt install cobang\n\nVersion 1+ is only available on distros which are as new as Ubuntu v24.10.\n\n\nArchLinux\n---------\n\nCoBang is available via AUR_.\n\n\nFedora\n------\n\nCoBang is available via COPR_.\n\n\nOther distros\n-------------\n\nUsers of other distros can install CoBang from `FlatHub`_.\n\n.. code-block:: console\n\n  $ flatpak install flathub vn.hoabinh.quan.CoBang\n\nThe release on FlatHub is lagging behind traditional distribution channels (PPA, AUR, COPR) because I often having difficulty building CoBang as Flatpak.\n\n\nCompatibility\n-------------\n\nThough being targeted at Wayland, this app can still work in X11 desktop environments, like `KDE`_ (in Kubuntu), `Xfce`_ (in Xubuntu), `LxQt`_ (in Lubuntu). \nBut due to a gap between GTK and Qt, the app gets some minor quirky issue when running in Qt-based DEs like KDE and LxQt. \nCoBang should not be tried in VirtualBox virtual machine, because of poor graphics stack VirtualBox provides.\n\nSince v1.6, CoBang has different webcam access methods, depending on whether it runs inside sandbox (Flatpak) or not. Outside sandbox, it tries to access webcam directly as V4L2 device.\nInside sandbox, it accesses indirectly via `xdg-desktop-portal`_, and depending on how much the portal supports, CoBang may not see your webcam.\n\nFrom v1.0 to v1.5, CoBang only accessed webcam via `xdg-desktop-portal`_.\n\n\nDevelopment\n+++++++++++\n\nThis section is for someone who wants to join development of CoBang.\n\nCoBang is written in Python, using `GTK+ \u003cgtk_\u003e`_ for UI, `GStreamer`_ for webcam capture and a part of `ZBar`_ for decoding QR code from image.\n\n\nInstall dependencies\n--------------------\n\nThough being written in Python, but as a GTK app, most of CoBang's Python dependencies can be only installed from OS package manager.\nThey are listed in *deb-packages.txt* file, under the name of Debian packages. On Debian, Ubuntu and derivates, you can quickly install them with this command:\n\n.. code-block:: console\n\n  $ xargs -a deb-packages.txt sudo apt install\n\n.. code-block:: nu\n\n  \u003e open --raw deb-packages.txt | lines | sudo apt install ...$in\n\nOn other distros (Fedora, ArchLinux etc.), please try to figure out equivalent package names and install with your favorite package manager.\n\nSome Python packages which aid development can be installed with ``pip``, and listed in *requirements-dev.txt*. If you want to install them to a virtual environment, remember to create it with ``--system-site-packages`` flag.\n\n\nRun from source\n---------------\n\nDue to the dependence on system libraries and GTK ecosystem, CoBang requires a build step and cannot be run directly from source.\nHowever, you can still try running it in development by:\n\n.. code-block:: console\n\n  $ meson setup __build --prefix ~/.local/\n  $ ninja -C __build\n  $ meson install -C __build\n  $ G_MESSAGES_DEBUG=cobang cobang\n\nThese steps will install CoBang to *~/.local/*. Everytime we modify source code, we only need to run the ``meson install ...`` step again.\n\nTo uninstall, do:\n\n.. code-block:: console\n\n  $ ninja -C __build uninstall\n\n\nTranslation\n-----------\n\nScript to extract strings for translation and to update *\\*.po* files are written in Nu shell. Please install `Nu`_ before running.\n\n.. code-block:: nu\n\n  \u003e ./dev/extract-for-translating.nu\n  \u003e ./dev/update-translated.nu\n\n\nPackage for Debian/Ubuntu\n-------------------------\n\nThis repo is organized in two branches:\n\n- ``main``: Main place for development. Latest code is here.\n- ``packaging/ubuntu``: This branch is based on ``main``, but added *debian* folder, used for building *\\*.deb* file.\n\nFollow this step to package:\n\n- Checkout to ``main`` branch, and export source code:\n\n  .. code-block:: console\n\n    $ export VER='0.1.0'  # Change to version you want\n    $ git archive --format=tar --prefix=cobang-$VER/ HEAD | gzip -c \u003e ../cobang_$VER.orig.tar.gz\n\n  .. code-block:: nu\n\n    \u003e let VER = '0.1.0'  # Change to version you want\n    \u003e git archive --format=tar --prefix=cobang-($VER)/ HEAD | gzip -c o\u003e ../cobang_($VER).orig.tar.gz\n\n- Move the *\\*.orig.tar.gz* file to somewhere, then extract it, as *cobang-0.1.0* for example.\n\n- Checkout to ``packaging/ubuntu`` branch, copy *debian* folder and *setup.py* file, putting to just-extracted *cobang-0.1.0* folder.\n\n- If you are about to build *deb* file locally, run:\n\n  .. code-block:: console\n\n    $ debuild -us -uc\n\n- If you are about to create source package which are suitable to build on Ubuntu's PPA [2]_, run:\n\n  .. code-block:: console\n\n    $ debuild -S\n\n\nPackage as Flatpak\n------------------\n\nYou can package as Flatpak from the source.\n\n.. code-block:: console\n\n  $ flatpak-builder _build --force-clean vn.hoabinh.quan.CoBang.yaml\n  $ flatpak-builder --run _build vn.hoabinh.quan.CoBang.yaml cobang\n\n\nAlternatives\n++++++++++++\n\nThese applications were born after CoBang, that is why they are not mentioned in \"Motivation\" section.\n\n- `Decoder`_: Scan and generate QR code. Built with GTK4 and targeting Flatpak environment.\n- `Megapixels`_: Camera application for Linux phones. The only one can access PinePhone camera. Can read QR code.\n\n\nCredit\n++++++\n\n- Brought to you by `Nguyễn Hồng Quân \u003cauthor_\u003e`_.\n- Application logo is from Shadd Gallegos.\n- Picture icon is modified from `Lucide`_ (available under `ISC license \u003clucide_license_\u003e`_).\n- Some contributors who proposed nicer UI for this app.\n\n.. [1] Every Electron application brings along a pair of NodeJS + Chromium, which make the package size \u003e 50MB, no matter how small the application code is. To make the situation worse, those NodeJS + Chromium set are not shared. It means that if you installed two Electron apps, you end up having two set of NodeJS \u0026 Chromium in your system!\n.. [2] Ubuntu PPA requires to upload source package, not prebuilt binary. Read more at: https://help.launchpad.net/Packaging/PPA/Uploading\n\n\n.. _co_bang: https://nhipsongquehuong.com/bien-co-bang-thanh-do-thu-cong-dep-mat\n.. _Gtk: https://www.gtk.org/\n.. _GStreamer: https://gstreamer.freedesktop.org/\n.. _ZBar: https://github.com/mchehab/zbar\n.. _zbarcam: https://github.com/mchehab/zbar\n.. _QtQR: https://launchpad.net/qr-tools\n.. _PyPI: https://pypi.org/\n.. _PPA: https://launchpad.net/~ng-hong-quan/+archive/ubuntu/ppa\n.. _AUR: https://aur.archlinux.org/packages/cobang/\n.. _COPR: https://copr.fedorainfracloud.org/coprs/nunodias/CoBang/\n.. _KDE: https://kde.org/\n.. _Xfce: https://www.xfce.org/\n.. _LxQt: https://lxqt.github.io/\n.. _Logbook: https://pypi.org/project/Logbook/\n.. _FlatHub: https://flathub.org/apps/details/vn.hoabinh.quan.CoBang\n.. _Decoder: https://gitlab.gnome.org/World/decoder/\n.. _Megapixels: https://git.sr.ht/~martijnbraam/megapixels\n.. _author: https://quan.hoabinh.vn\n.. _lucide: https://lucide.dev/icons/image-plus\n.. _lucide_license: https://lucide.dev/license\n.. _nu: https://www.nushell.sh/\n.. _xdg-desktop-portal: https://flatpak.github.io/xdg-desktop-portal/\n.. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhongquan%2Fcobang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhongquan%2Fcobang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhongquan%2Fcobang/lists"}