ChrisLauinger77 / gnome-shell-extension-HeadsetControl

Gnome Shell Extension to visualize headset status from HeadsetControl command line tool
GNU General Public License v3.0
22 stars 8 forks source link

Battery level not showing on quick settings #18

Closed Ciberbago closed 5 months ago

Ciberbago commented 5 months ago

Describe the bug

I have headsetcontrol 3.0 installed from the AUR on archlinux on gnome 46 and the battery level does not show on the quick settings.

To Reproduce Steps to reproduce the behavior: 1-. Install headsetcontrol from the aur: https://aur.archlinux.org/packages/headsetcontrol 2-. Install this extension from gnome extensions website 3-. Open quick settings menu, battery level not available

I expected to be able to see battery level as I used to.

This is what it looks like: https://imgur.com/2oUosjj

This is what the settings look like on the extension: https://imgur.com/w2LBvjV

Executing the command works fine:


headsetcontrol -b 
Found Corsair Headset Device (Corsair VOID PRO Wireless Gaming Headset)!

Battery:
    Status: BATTERY_AVAILABLE
    Level: 13%

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context This used to work, I would not know exactly when this problem started to happen though. I enabled logging in the extension and this is the output:

HeadsetControl Command: /usr/bin/headsetcontrol -o json
HeadsetControl {
  "name": "HeadsetControl",
  "version": "",
  "api_version": "1.0",
  "hidapi_version": "0.14.0",
  "device_count": 1,
  "devices": [
    {
      "status": "success",
      "device": "Corsair Headset Device",
      "vendor": "Corsair",
      "product": "Corsair VOID PRO Wireless Gaming Headset",
      "id_vendor": "0x1b1c",
      "id_product": "0x0a1a",
      "capabilities": [
        "CAP_SIDETONE", 
        "CAP_BATTERY_STATUS", 
        "CAP_NOTIFICATION_SOUND", 
        "CAP_LIGHTS"
      ],
      "capabilities_str": [
        "sidetone", 
        "battery", 
        "notification sound", 
        "lights"
      ],
      "battery": {
        "status": "BATTERY_AVAILABLE",
        "level": 13
      }
    }
  ]
}

HeadsetControl device_count: 1
HeadsetControl devices(0).status: success
HeadsetControl _getColorHEXValue-strSettingsColor: color-batterylow
HeadsetControl _getColorHEXValue-strcolor: rgb(255,0,0)
HeadsetControl _getColorHEXValue-strSettingsColor: color-batterymedium
HeadsetControl _getColorHEXValue-strcolor: rgb(255,255,0)
HeadsetControl _getColorHEXValue-strSettingsColor: color-batteryhigh
HeadsetControl _getColorHEXValue-strcolor: rgb(0,255,0)
HeadsetControl _changeColor: 13
HeadsetControl _changeColor: #ff0000

I'm at a loss here, I don't know what else should I test. Obviously I want to thank you for the great work you already do. And I'd appreciate if I could get some help with this.

ChrisLauinger77 commented 5 months ago

The only difference I see to mine is the version which should not matter at all:

{
  "name": "HeadsetControl",
  "version": "3.0.0",
  "api_version": "1.0",
  "hidapi_version": "0.14.0",
  "device_count": 1,
  "devices": [
    {
      "status": "success",
      "device": "SteelSeries Arctis (7/Pro)",
      "vendor": "SteelSeries ",
      "product": "SteelSeries Arctis 7",
      "id_vendor": "0x1038",
      "id_product": "0x12ad",
      "capabilities": [
        "CAP_SIDETONE", 
        "CAP_BATTERY_STATUS", 
        "CAP_LIGHTS", 
        "CAP_INACTIVE_TIME", 
        "CAP_CHATMIX_STATUS"
      ],
      "capabilities_str": [
        "sidetone", 
        "battery", 
        "lights", 
        "inactive time", 
        "chatmix"
      ],
      "battery": {
        "status": "BATTERY_AVAILABLE",
        "level": 61
      },
      "chatmix": 64
    }
  ]
}

And what is actually shown ? A screenshot would be nice ... Could it be related to the used theme ? Maybe change to the default one ?

ChrisLauinger77 commented 5 months ago

One more thing - after update to headsetcontrol v3.0 you need to logout/login OR disable / enable the extension. The version of headsetcontrol is only detected once when the extension is started. Update of the binary needs restart of the extension - could this be the problem ?

Ciberbago commented 5 months ago

Yes, this is all really weird. This is what the extension looks like: https://imgur.com/2oUosjj

The commands for led and sidetone work, but it does not show more info. I don't have any shell theme, the only thing is the Papyrus Icons.

About the update, I tried that, updated, log out, log in and didn't work. Disabled and enabled extension, didn't work either. I even rebooted my pc and that didn't work :(

EDIT: I changed icons to default, but that didn't help

ChrisLauinger77 commented 5 months ago

Intresting - so the red indicator works - only the test is not replaced ... Strange. Maybe try uninstall / reinstall the extension over E.G.O. ?

Ciberbago commented 5 months ago

Yes, that's what I noticed too, the little arrow changes color, the text is the problem.

I will try that and report back!

ChrisLauinger77 commented 5 months ago

Other then that I am without ideas ... I do not see the logoutput for "_setMenuSetHeader" - but the color changed to red. I do not understand that tbh

Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung device_count: 1
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung devices(0).status: success
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung _setMenuSetHeader:Ladung: 54% / Chat-Mix: 64
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung _getColorHEXValue-strSettingsColor: color-batterylow
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung _getColorHEXValue-strcolor: rgb(255,0,0)
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung _getColorHEXValue-strSettingsColor: color-batterymedium
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung _getColorHEXValue-strcolor: rgb(255,255,0)
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung _getColorHEXValue-strSettingsColor: color-batteryhigh
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung _getColorHEXValue-strcolor: rgb(0,255,0)
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung _changeColor: 54
Mai 11 17:44:56 debian gnome-shell[35449]: Headset-Steuerung _changeColor: #00ff00

From your to mine output this is the comparision: grafik

Why your does not have the version is also strange ...

ChrisLauinger77 commented 5 months ago

If reinstall did not do the trick - pls make a log when the extension is disabled and then enabled. Then I guess we can see more ...

Ciberbago commented 5 months ago

I don't know why, but installing this version in the aur fixed the issue.

https://aur.archlinux.org/packages/headsetcontrol-git

I previously used this one:

https://aur.archlinux.org/packages/headsetcontrol

HeadsetControl Command: /usr/bin/headsetcontrol -o json
HeadsetControl {
  "name": "HeadsetControl",
  "version": "",
  "api_version": "1.0",
  "hidapi_version": "0.14.0",
  "device_count": 1,
  "devices": [
    {
      "status": "success",
      "device": "Corsair Headset Device",
      "vendor": "Corsair",
      "product": "Corsair VOID PRO Wireless Gaming Headset",
      "id_vendor": "0x1b1c",
      "id_product": "0x0a1a",
      "capabilities": [
        "CAP_SIDETONE", 
        "CAP_BATTERY_STATUS", 
        "CAP_NOTIFICATION_SOUND", 
        "CAP_LIGHTS"
      ],
      "capabilities_str": [
        "sidetone", 
        "battery", 
        "notification sound", 
        "lights"
      ],
      "battery": {
        "status": "BATTERY_CHARGING",
        "level": 100
      }
    }
  ]
}

HeadsetControl device_count: 1
HeadsetControl devices(0).status: success
HeadsetControl _setMenuSetHeader:Charge: 100%
HeadsetControl _getColorHEXValue-strSettingsColor: color-batterylow
HeadsetControl _getColorHEXValue-strcolor: rgb(255,0,0)
HeadsetControl _getColorHEXValue-strSettingsColor: color-batterymedium
HeadsetControl _getColorHEXValue-strcolor: rgb(255,255,0)
HeadsetControl _getColorHEXValue-strSettingsColor: color-batteryhigh
HeadsetControl _getColorHEXValue-strcolor: rgb(0,255,0)
HeadsetControl _changeColor: 100
HeadsetControl _changeColor: #00ff00

This is the log with the working version, and this is the screenshot of the extension working: https://imgur.com/5bLQ8wC

ChrisLauinger77 commented 5 months ago

Here we can also see the

HeadsetControl _setMenuSetHeader:Charge: 100%

But the -o json option is only supported since v3.0 of the headsetcontrol tool and should not work in v2.7 Nevertheless it is not a problem of the extension that arch linux headsetcontrol-package is to blame. I do not understand why it works now as the output you posted only differs from the battery level (old 13 new 100). grafik You should file a bug at arch linux package - the versioning is weird and also their version of the tool seems modified and the version info is missing in -o json. I compiled the tool myseld (there is no debian package) and for me it just works.