• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language
    Python
  • License
    BSD 2-Clause "Sim...
  • Created over 4 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple app-indicator for GNOME desktops to display the battery charge of some wireless headsets which also allows to control some functions like LEDs, sidetone and others.

Release GitHub release Tag

A simple app-indicator for GNOME desktops to provide support for controlling some features of various wireless headsets.

Screenshot

It supports displaying the battery charge, turning on/off LEDs and adjusting the sidetone level of the microphone.

It additionally supports displaying the 'chat-mix' level of Steelseries Arctis headphones.

It uses the tool from https://github.com/Sapd/HeadsetControl/ for connecting to a number of popular headsets and fetches information for displaying in the app-indicator bar on the desktop.

If an additional external script is provided, it also allows to switch between sending sound to the soundcard or to the Headset and record from the correct microphone.

Installation

On Ubuntu/Debian based distributions, install the following packages:

sudo apt-get install python3-gi libappindicator3-1 gnome-icon-theme gir1.2-ayatanaappindicator3-0.1

On Arch Linux, it should be sufficient to run the following steps:

sudo pacman -S libappindicator-gtk3 gnome-icon-theme

On other distributions, you might need to install pygobject, but this is untested, PRs with more information welcome!

Building HeadsetControl

Follow the instructions at https://github.com/Sapd/HeadsetControl/ for building the binary and note down the path to it.

You can test the helper application manually via headsetcontrol -b -c, this should print the current battery level to the console if your headset is supported.

Starting the AppIndicator automatically

You can use the provided script install.sh to create an auto-start entry to start up headset-charge-indicator whenever the Desktop Environment is starting up.

Usage

Build/install the required executable headseatcontrol according to the instructions above, then start the headset-charge-indicator via

python3 headset-charge-indicator.py

A Headset-icon should appear in the area for app-indicators together with a percentage number.

You can optionally supply a path to the headsetcontrol binary.

If you provide a commandline argument --switch-command, an additional "Switch" menu will be added with options to switch between Soundcard and some Headsets and USB devices. The provided application or script will be invoked with "1" for soundcard, "2" for headset, "3" for an USB headset, "4" for a chat-device and "5" for Monitor Audio (it should be easy to adjust this for your devices).

A script can for example use pactl and/or pacmd to send audio output to the correct endpoint as well as setting audio input to the correct microphone.

Commandline

$ ./headset-charge-indicator.py -h
usage: headset-charge-indicator.py [-h] [--headsetcontrol-binary <path to headsetcontrol binary>] [--switch-command <device switch command>] [--verbose]

    Simple AppIndicator which uses the HeadsetControl application from https://github.com/Sapd/HeadsetControl/ for retrieving charge information for wireless headsets and displays it as app-indicator
    
    The application has two optional commandline arguments, one for the location of the HeadsetControl binary and one for a command to switch between Laptop, Headset and other devices.
    

optional arguments:
  -h, --help            show this help message and exit
  --headsetcontrol-binary <path to headsetcontrol binary>
                        Optional path to headsetcontrol binary
  --switch-command <device switch command>
                        Optional command to switch between Laptop, Headset and other devices
  --verbose             Increase output verbosity

Supported Headsets

Look at the description of https://github.com/Sapd/HeadsetControl/, headset which support at least fetching battery information are supported here as well, other functionality will work if the headset supports it.

Supported Desktop Envrionemnts

The tool uses Python bindings for the GNOME appindicator functionality. So it is mainly supported on this desktop environment.

However some other Desktop environments have some support for appindicators, so it might be possible to run this tool on other desktop environments as well.

Currently known behavior/support:

  • GNOME: Works fully
    • Note: On Debian/Ubuntu you might need to install package gnome-shell-extension-appindicator.
    • On other distributions, you will need to install the KStatusNotifierItem/AppIndicator Support from https://extensions.gnome.org/extension/615/appindicator-support/
      • After installation run gnome-shell-extension-prefs and enable KStatusNotifierItem/AppIndicator Support
  • Cinnamon: Seems to work, but percentage is not displayed as part of the indicator-icon
  • KDE/Plasma: Seems to work, but percentage is not displayed as part of the indicator-icon
  • MATE: Runs, but does not display an icon
  • LXDE: Seems to work, but percentage is not displayed as part of the indicator-icon (tested on Ubuntu Focal and Debian Bullseye)
  • Budgie: Runs, but does not display an icon
  • XFCE: Runs, but indicator-icon only appears for a very short time and then disappears again
  • OpenBox: ??

Please let me know via an issue if you successfully run it on another desktop environment or know of a way to make it run better on any of those desktop environments!

The fact that the percentage does not show up everywhere is somewhat documented at http://net3d.free.fr/html/AppIndicator-0.1.gir/AppIndicator.Indicator-label.html

Desupport of AppIndicator

Debian is phasing out support for libappindicator in favour of libayatana-appindicator, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037 and https://wiki.debian.org/Ayatana/IndicatorsTransition

This tool now has support for this so that it first tries to load the newer AyatanaAppIndicator system and only falls back to AppIndicator if necessary.

Development/Debugging

The following information was helpful in developing this tool:

The python application will print out some information to standard-output which may give some more information if things go wrong.

Licensing

Like it?

If you like my software please star the repository.

If you find this application useful and would like to support it, you can Sponsor the author

More Repositories

1

jgit-cookbook

Provides examples and code snippets for the JGit Java Git implementation
Java
1,754
star
2

poi-on-android

A sample project that shows how Apache POI can be used in an Android application
Java
346
star
3

generate-and-send-ssh-key

Script to automate the setup of ssh-public/private-key authentication to avoid some common pitfalls
Shell
195
star
4

CommonCrawlDocumentDownload

A small tool which uses the CommonCrawl URL Index to download documents with certain file types or mime-types. This is used for mass-testing of frameworks like Apache POI and Apache Tika
Java
61
star
5

poi-mail-merge

Small application which allows to repeatedely replace markers in a Microsoft Word document with items taken from a CSV/Microsoft Excel file to provide a simple mail-merge functionality
Java
34
star
6

IntelliJ-Action-IDs

Create and publish a list of available ActionIDs for the IntelliJ plugin system by recursively searching through the jar-files and producing HTML via Jekyll
Java
32
star
7

JGitFS

JGitFS provides access to Git branches/tags/commits like they are separate directories via a Linux FUSE userland filesystem
Java
29
star
8

commons-dost

Utilitity library for stuff that I use in multiple projects
Java
4
star
9

actions

Repository of reusable Github workflows
4
star
10

github-version-statistics

Uses the GitHub API to search for usages of a Java library and prepares some statistics about which versions are used how often
Java
4
star
11

commons-audio

A small library of code-pieces that I find useful when developing tools and applications around handling of audio, playing sound, downloading audio from certain websites
Java
4
star
12

poi-fuzz

Use Jazzer to perform fuzzy testing of Apache POI
Java
3
star
13

cli-fuzz

Use Jazzer to perform fuzzy testing of Apache Commons CLI
Java
3
star
14

openambit-ppa

Openambit sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
2
star
15

config

Helper project which stores some config-files that I would like to have on every machine that I work on
Shell
2
star
16

unoconv-ppa

unoconv sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
Python
2
star
17

IntelliJ-Automation-Plugin

Plugin for IntelliJ IDE which provides a REST interface to automatically trigger actions in a running instance of IntelliJ IDE
Java
2
star
18

demo-fuzz

Minimal application for fuzzy-testing of Java code via the Jazzer fuzzer
Shell
2
star
19

commons-test

Utilitity library for testing stuff that I use in multiple projects
Java
2
star
20

antlr-fuzz

Use Jazzer to perform fuzzy testing of antlr v4
Java
2
star
21

file-type-detection

A small tool to use Apache Tika to determine the mime-type of all files in a directory
Java
2
star
22

gwt-gradle-example-issue81

Reproducer for reported issue #81 in the gwt-gradle-plugin
Java
2
star
23

debhelper-ppa

Debhelper sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
Perl
2
star
24

git-ftp-ppa

Git-ftp sources with Debian/Ubuntu packaging for building for PPA
Shell
2
star
25

commons-htmlunit

Common HtmlUnit utility methods that I find useful in various projects
Java
2
star
26

kphotoalbum-ppa

KPhotoAlbum sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C++
1
star
27

codec-fuzz

Use Jazzer to perform fuzzy testing of Apache Commons Codec
Java
1
star
28

gpx2route

Convert GPX files to route files suitable for upload to Suunto Ambit sports watches via Openambit
Java
1
star
29

qrencode-ppa

qrencode sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
Shell
1
star
30

dynahist-fuzz

Use Jazzer to perform fuzzy testing of dynahist
Java
1
star
31

kdesvn-ppa

Kdesvn sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C++
1
star
32

scribus-ppa

Scribus sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C++
1
star
33

tpm2-tss-ppa

tpm2-tss sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
34

ocserv-ppa

ocserv sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
35

onedrive-ppa

Onedrive sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
D
1
star
36

tellico-ppa

Tellico sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C++
1
star
37

bzstats

Query the Apache bugzilla instance for bug-counts and use R to produce an SVG with a chart of how bug-counts evolved
Jupyter Notebook
1
star
38

pacpl-ppa

PACPL sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
Perl
1
star
39

hash4j-fuzz

Use Jazzer to perform fuzzy testing of hash4j
Java
1
star
40

mtools-ppa

Mtools sources with Debian/Ubuntu packaging for building for PPA with support for xz created using git-buildpackage
C
1
star
41

compress-fuzz

Use Jazzer to perform fuzzy testing of Apache Commons Compress
Java
1
star
42

pkg-kde-tools.ppa

pkg-kde-tools sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
1
star
43

konsole-ppa

konsole sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C++
1
star
44

firehol-ppa

firehol sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
Shell
1
star
45

MultiplicativeDigitalRoot

This project plays with the mathematical topics of "Multiplicative digital roots" and "Multiplicative Persistence"
Java
1
star
46

tob-ppa

Tob (tape oriented backup) sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
Shell
1
star
47

jacococoveragecolumn-plugin

Plugin for Jenkins to add a column for coverage results from the JaCoCo plugin
Java
1
star
48

dpkg-ppa

Dpkg sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
49

poi-regression-test

A tool to perform regression testing for Apache POI on a very large corpus of test-files
Java
1
star
50

mp3splt-gtk-ppa

mp3splt-gtk sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
51

.github

Default community health files
1
star
52

ntp-ppa

ntp sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
53

csv-fuzz

Use Jazzer to perform fuzzy testing of Apache Commons CSV
Java
1
star
54

laminar-ppa

Laminar sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C++
1
star
55

openconnect-ppa

openconnect sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
56

imaging-fuzz

Use Jazzer to perform fuzzy testing of Apache Commons Imaging
Java
1
star
57

mp3gain-ppa

mp3gain sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
58

pipewire-ppa

pipewire sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
59

simple-scan-ppa

simple-scan sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
Vala
1
star
60

libmp3splt-ppa

libmp3splt sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
61

subversion-ppa

Subversion sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
62

digikam-ppa

Digikam sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C++
1
star
63

glabels-ppa

Glabels sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
64

mp3splt-ppa

mp3splt sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
65

poi-benchmark

Some automated benchmarks of POI buildsystem and some POI functionality together with results
HTML
1
star
66

subversion-19-ppa

Subversion sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
67

git-ppa

Git sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C
1
star
68

marble-qt4-ppa

Marble sources with Debian/Ubuntu packaging for building for PPA with support for Qt4 instead of Qt5 created using git-buildpackage
C++
1
star
69

file-leak-postprocess

A small tool to post-process output from running an application with file-leak-detector
Java
1
star
70

BenfordsLaw

Sample application showing Benford's Law by looking at file sizes on the local disk
Java
1
star
71

tika-fuzz

Use Jazzer to perform fuzzy testing of Apache Tika
Java
1
star
72

bless-ppa

Bless sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C#
1
star
73

soundkonverter-ppa

Soundkonverter sources with Debian/Ubuntu packaging for PPA created using git-buildpackage
C++
1
star
74

configuration-fuzz

Use Jazzer to perform fuzzy testing of Apache Commons Configuration
Java
1
star
75

cover-the-world

A tool which reads GPX tracks and produces a world-map which displays covered "tiles", i.e. ~1.5km squares
Java
1
star