Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - polychromatic: init at unstable-2020-03-10 #82609

Open
wants to merge 6 commits into
base: master
from

Conversation

@evanjs
Copy link
Member

evanjs commented Mar 14, 2020

Notes regarding branch selection

  • use dev-1.0.0 branch
    • the 1.0.0 branch uses meson instead of a plain Makefile and I found it much easier to create an expression for this version of the repository
    • according to this comment, it assumes a PR from openrazer is merged.

Related:

#82269 - Init OpenRGB

Current issues

polychromatic-controller errors
Unable to get device states for Razer Huntsman Elite
Traceback (most recent call last):
  File ’/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/lib/python3.7/site-packages/polychromatic/backends/openrazer.py’, line 283, in get_device
    effect = str(zone_to_device[zone].effect)
AttributeError: ’RazerFX’ object has no attribute ’effect’

This probably indicates a bug, wrong OpenRazer version or improperly specified Chroma device:
Razer Huntsman Elite (0226:1532)
polychromatic-tray-applet errors
/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-tray-applet-wrapped-wrapped:183: DeprecationWarning: Gtk.StatusIcon.set_name is deprecated
  self.indicator.set_name("polychromatic-tray-applet")
/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-tray-applet-wrapped-wrapped:184: DeprecationWarning: Gtk.StatusIcon.set_from_file is deprecated
  self.indicator.set_from_file(self._get_tray_icon())
/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-tray-applet-wrapped-wrapped:185: DeprecationWarning: Gtk.StatusIcon.set_visible is deprecated
  self.indicator.set_visible(True)
Unable to get device states for Razer Huntsman Elite
Traceback (most recent call last):
  File ’/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/lib/python3.7/site-packages/polychromatic/backends/openrazer.py’, line 283, in get_device
    effect = str(zone_to_device[zone].effect)
AttributeError: ’RazerFX’ object has no attribute ’effect’

This probably indicates a bug, wrong OpenRazer version or improperly specified Chroma device:
Razer Huntsman Elite (0226:1532)
/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-tray-applet-wrapped-wrapped:129: DeprecationWarning: Gtk.ImageMenuItem.set_image is deprecated
  item.set_image(img)            # GTK3: Deprecated, no replacement!
Traceback (most recent call last):
  File "/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-tray-applet-wrapped-wrapped", line 862, in <module>
    indicator.setup()
  File "/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-tray-applet-wrapped-wrapped", line 194, in setup
    self.build_indicator()
  File "/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-tray-applet-wrapped-wrapped", line 274, in build_indicator
    root.append(self.build_device_submenu(device, details)[0])
  File "/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-tray-applet-wrapped-wrapped", line 357, in build_device_submenu
    submenu[1].append(self._create_effect_submenu(details, zone)[0])
  File "/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-tray-applet-wrapped-wrapped", line 486, in _create_effect_submenu
    if "random" in starlight_options:
NameError: name 'starlight_options' is not defined

I tried using the master branch for openrazer, but encountered the same issues.
Interestingly, I found mention in the source for features that require OpenRazer 2.8.0+ (here).

I am not sure if this is a typo or referring to the current master branch.

Additionally, this is what happens if no ~/.config/polychromatic/custom_icons directory is found when polychromatic-controller is launched

Missing directory error

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/nix/store/xb1mp0f16lv23rwhfdc1665v5r20jfmm-python3-3.7.6/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/bin/..polychromatic-controller-wrapped-wrapped", line 342, in start_app
    self.controller.initalise_app(self.version, self.versions, args.tab)
  File "/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/lib/python3.7/site-packages/polychromatic/controller.py", line 110, in initalise_app
    self.send_view_variable("CUSTOM_ICONS", pref.get_custom_icons())
  File "/nix/store/9hsbcqi59nqqwgv0v4nvxgmkpabi97hn-polychromatic-unstable-2020-03-10/lib/python3.7/site-packages/polychromatic/preferences.py", line 371, in get_custom_icons
    return os.listdir(path.custom_icons)
FileNotFoundError: [Errno 2] No such file or directory: '/home/evanjs/.config/polychromatic/custom_icons'

Current Functionality

As it stands, brightness for connected devices can be changed, but you cannot switch between tabs, and much of the application is inaccessible.

Motivation for this change

Polychromatic provides a graphical interface to manage Razer devices using Openrazer

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

cc @adisbladis @worldofpeace

use dev-1.0.0 branch
@evanjs evanjs changed the title polychromatic: init at unstable-2020-03-10 [WIP] - polychromatic: init at unstable-2020-03-10 Mar 14, 2020
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
@evanjs

This comment has been minimized.

Copy link
Member Author

evanjs commented Mar 14, 2020

Ah, looks like we're blocked on openrazer/openrazer#888 being merged, as mentioned here.

@evanjs evanjs changed the title [WIP] - polychromatic: init at unstable-2020-03-10 WIP - polychromatic: init at unstable-2020-03-10 Mar 14, 2020
@symphorien

This comment has been minimized.

Copy link
Contributor

symphorien commented Mar 14, 2020

The derivation lacks meta.

evanjs added 2 commits Mar 14, 2020
polychromatic-tray-applet needs to be wrapped with lsusub from usbutils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.