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

Deckmaster #9

Closed
rastarr opened this issue Jan 29, 2024 · 8 comments
Closed

Deckmaster #9

rastarr opened this issue Jan 29, 2024 · 8 comments

Comments

@rastarr
Copy link

rastarr commented Jan 29, 2024

Hi and thank you for sharing your repo - especially Deckmaster for Streamdeck
I'm running Sway and Wayland and using the bones of your home-manager deckmaster files.

Is this working for you currently?
While the deckmaster service loads and i'm able to switch between decks, I do have a few issues-

  • exec commands don't appear to work
  • paste commands don't work as they should, but instead only paste what was last in the system clipboard and not what is defined in the deck's config
  • if I read your code correctly, any changes within ./files should restart/refresh the service. This doesn't appear to be the case with my current situation

Is this happening with your config or do you have any insights that might help me get going?
Thanks for any thoughts

@BCNelson
Copy link
Owner

Hey @rastarr I'm glad these could be helpful for you. I really don't heavily use the stream deck. I did some testing and removed some lines from my config that are not working under Wayland at the moment and causing a lot of logs. You can see the changes 0302fb2 after applying these changes it seem to work better for me. Let me know if that helps if not i would be happy to help you out some more.

@rastarr
Copy link
Author

rastarr commented Jan 29, 2024

So your exec commands actually work then?
The same for paste commands?

Here's my config. I'm new to nix and this deckmaster repo so maybe something jumps out at you why my system isn't functioning as it should.

Grepping the journalctl logs also give the following errors -

Jan 30 04:29:16 desktop systemd[2614]: deckmaster.service: Consumed 2min 32.433s CPU time, 65.9M memory peak, 0B memory swap peak.
Jan 30 04:30:23 desktop deckmaster[3521]: XGB: conn.go:47: Could not get authority info: open /home/martin/.Xauthority: no such file or directory
Jan 30 04:30:23 desktop deckmaster[3521]: XGB: conn.go:48: Trying connection without authority info...
Jan 30 04:30:23 desktop deckmaster[3521]: XGB: conn.go:47: Could not get authority info: open /home/martin/.Xauthority: no such file or directory
Jan 30 04:30:23 desktop deckmaster[3521]: XGB: conn.go:48: Trying connection without authority info...
Jan 30 04:39:46 desktop deckmaster[3521]: Pasting to clipboard failed: No clipboard utilities available. Please install xsel, xclip, wl-clipboard or Termux:API add-on for termux-clipboard-get/set.

My config currently-

{ config, pkgs, ... }:

{
    config = {

    home-manager.users.martin = { config, ... }: {

      home.file."${config.xdg.configHome}/deckmaster" = {
        source = ./files;
        recursive = true;
        onChange = "${pkgs.systemd}/bin/systemctl --user restart deckmaster.service";
      };

      home.packages = [
        pkgs.deckmaster
        pkgs.wl-clipboard
      ];

      systemd.user = {
        paths = {
          deckmaster = {
            Unit.Description = "Stream Deck Device Path";
            Path = {
              PathExists = "/dev/streamdeck-xl"; #look in /dev for the proper device name
              Unit = "deckmaster.service";
            };
            Install.WantedBy = [ "default.target" ];
          };
        };
        services = {
          deckmaster = {
            Unit.Description = "Deckmaster Service";
            Service = {
              ExecStartPre = "${pkgs.coreutils}/bin/sleep 10";
              ExecStart = "${pkgs.deckmaster}/bin/deckmaster --deck ${config.xdg.configHome}/deckmaster/replies.deck";
              Restart = "on-failure";
              ExecReload = "kill -HUP $MAINPID";
            };
          };
        };
      };
    };
  };
}

As I said previously the deckmaster service loads and i'm able to switch between decks, with these issues-

  • exec commands don't appear to work
  • paste commands don't work as they should, but instead only paste what was last in the system clipboard and not what is defined in the deck's config
  • if I read your code correctly, any changes within ./files should restart/refresh the service. This doesn't appear to be the case with my current situation

@BCNelson
Copy link
Owner

The logged errors XGB: conn.go:47: Could not get authority info: open ~/.Xauthority: no such file or directory seem to relate to this error muesli/deckmaster#92 answers there suggest that it is a uinput permissions issue.

You can see my config for that here https://github.com/BCNelson/nix-config/blob/de55daeed23f25e7a91ab88e77765a255f6a9d18/nixos/_mixins/hardware/streamdeck.nix
You would also notice that uinput is not there that is because in my config steam and weylus add the uinput udev rules.

I have update main to include the necessary config in the streamdeck nixos config.

@rastarr
Copy link
Author

rastarr commented Jan 31, 2024

yep - i'd already made the udev changes, to no affect.

What I'd really like to know is if the 'paste', 'exec' and 'command' functions of Deckmaster are actually working with your installation.
I could find any references that you use these [keys.action] functions which I do.
Would it be possible for you to test at least the 'paste' so I know I'm on the right track?

@BCNelson
Copy link
Owner

Could you share the udev changes that you made? Yes I can confirm that exec and paste are working for me.

@rastarr
Copy link
Author

rastarr commented Jan 31, 2024

sure

_:

{
  services.udev = {
    enable = true;

    extraRules = ''

    # Deckmaster needs write access to uinput to simulate keypresses.
    # Users wanting to use Deckmaster should be added to the input group.

    KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput", GROUP="input", MODE="0666"

    SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", TAG+="uaccess", MODE:="666", GROUP="plugdev", SYMLINK+="streamdeck-mini"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0090", TAG+="uaccess", MODE:="666", GROUP="plugdev", SYMLINK+="streamdeck-mini"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", TAG+="uaccess", MODE:="666", GROUP="plugdev", SYMLINK+="streamdeck"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", TAG+="uaccess", MODE:="666", GROUP="plugdev", SYMLINK+="streamdeck"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0080", TAG+="uaccess", MODE:="666", GROUP="plugdev", SYMLINK+="streamdeck"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006c", TAG+="uaccess", MODE:="666", GROUP="plugdev", SYMLINK+="streamdeck-xl"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="008f", TAG+="uaccess", MODE:="666", GROUP="plugdev", SYMLINK+="streamdeck-xl"
    SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0086", TAG+="uaccess", MODE:="666", GROUP="plugdev", SYMLINK+="streamdeck-pedal"

    '';
  };
}

@BCNelson
Copy link
Owner

BCNelson commented Feb 1, 2024

Have you rebooted after making these changes?

@rastarr
Copy link
Author

rastarr commented Feb 1, 2024

rebooted many times lol
anyways, since it's working when running it form the CLI, I can only presume the service is not getting getting path (or other) settings passed to it. maybe because I run sway and wayland and the user stuff is starting after the service starts. Needs investigating.

I've switched to autostarting the command line with parameters in my sway config and that will be good enough until I find time about the service stuff.

I can only thank you for taking the time in trying to help. very much appreciated indeed

Only been using nixos for a little over a week, coming from many years with macOS, so there's a number of things I'm looking at. Need to get my Davinci Resolve working next haha

Thanks again

@BCNelson BCNelson closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants