Skip to content

Instantly share code, notes, and snippets.

@sorcerersr
Last active February 25, 2024 20:31
Show Gist options
  • Save sorcerersr/363a22dfdeb148497cc0246ea1d6ee90 to your computer and use it in GitHub Desktop.
Save sorcerersr/363a22dfdeb148497cc0246ea1d6ee90 to your computer and use it in GitHub Desktop.
Show battery level of Razer Viper Ultimate
#!/bin/env python3
from openrazer.client import DeviceManager
device_manager = DeviceManager()
viper = None
for device in device_manager.devices:
if "Razer Viper Ultimate (Wireless)" == device.name:
viper = device
if None == viper:
print("n/a")
exit
charging = ''
if viper.is_charging:
charging = ''
print(" {} {}%".format(charging, viper.battery_level))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment