1 { lib, stdenv, fetchFromGitHub, headsetcontrol, wrapGAppsHook, python3, gtk3
2 , gobject-introspection, libayatana-appindicator }:
4 stdenv.mkDerivation rec {
5 # The last versioned release is 1.0.0.0 from 2020, since then there were updates but no versioned release.
6 # This is not marked unstable because upstream encourages installation from source.
7 pname = "headset-charge-indicator";
8 version = "2021-08-15";
10 src = fetchFromGitHub {
12 repo = "headset-charge-indicator";
13 rev = "6e20f81a4d6118c7385b831044c468af83103193";
14 sha256 = "sha256-eaAbqeFY+B3CcKJywC3vaRsWZNQENTbALc7L7uW0W6U=";
17 nativeBuildInputs = [ wrapGAppsHook ];
20 (python3.withPackages (ps: with ps; [ pygobject3 ]))
24 libayatana-appindicator
29 cp $src/headset-charge-indicator.py $out/bin/headset-charge-indicator.py
30 chmod +x $out/bin/headset-charge-indicator.py
33 $out/bin/headset-charge-indicator.py \
34 --replace "default='headsetcontrol'" "default='${headsetcontrol}/bin/headsetcontrol'"
36 cat << EOF > ${pname}.desktop
38 Name=Wireless headset app-indicator
39 Categories=Application;System
40 Exec=$out/bin/headset-charge-indicator.py
43 X-GNOME-AutoRestart=true
44 X-GNOME-Autostart-enabled=true
47 mkdir -p $out/share/applications
48 mkdir -p $out/etc/xdg/autostart
49 cp ${pname}.desktop $out/share/applications/${pname}.desktop
50 cp ${pname}.desktop $out/etc/xdg/autostart/${pname}.desktop
54 homepage = "https://github.com/centic9/headset-charge-indicator";
56 "A app-indicator for GNOME desktops for controlling some features of various wireless headsets";
58 "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.";
59 platforms = platforms.linux;
60 maintainers = with maintainers; [ zebreus ];
61 license = licenses.bsd2;