Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Expose an option to enable devtools #38

Open
AgathaSorceress opened this issue Sep 16, 2023 · 4 comments
Open

Expose an option to enable devtools #38

AgathaSorceress opened this issue Sep 16, 2023 · 4 comments

Comments

@AgathaSorceress
Copy link

Spicetify CLI has an spicetify enable-devtools action that enables chromium devtools, seemingly by patching .cache/spotify/offline.bnk, which is helpful when developing themes and CSS snippets. I'm not sure if just conditionally appending it to this line would be a good idea, or if there's a better way to do it, but I think it would be useful to have.

@aemogie
Copy link

aemogie commented Oct 28, 2023

offline.bnk is generated at spotify runtime, therefore theres no proper way to get it into the nix store (afaik), so that it can be patched.

an alternative is to disable nix's sandboxing, and run

{config, ...}: {
  imports = [...]; # import spicetify-nix
  nix.settings.use-sandbox = false;
  programs.spicetify = {
    ... # rest of config
    # you need to set HOME manually because the builder is a different user
    extraCommands = "HOME=${config.home.homeDirectory} spicetify-cli enable-devtools";
  }
}

but this is not recommended because this requires that spotify be run atleast once before, breaking reproducibility. i recommend doing this, making whatever changes you want, then removing this again.

@aemogie
Copy link

aemogie commented Feb 17, 2024

@AgathaSorceress I was recommended to use this extension, and it works with no weirdness unlike the above approach.
https://github.com/kyrie25/spicetify-utilities/

@comfysage
Copy link

unfortunatly, neither of these solutions work for me.
is there another way to achieve this?

@aemogie
Copy link

aemogie commented May 10, 2024

If you go with the second option of the utilities extension (then enable devtools), and launch spotify from the terminal there will be a message similar to

DevTools listening on ws://127.0.0.1:8088/devtools/browser/4f06d9b2-4ffc-4ed9-936a-689b1f80ad8d

For some reason I was unable to open the devtools even though it was running. Instead what I did was temporarily install chromium (nix run nixpkgs#chromium) and use that, should also work with any other chromium-based browser.

Once you have it running, go to chrome://inspect, then click on Configure... and add 127.0.0.1:8088 (which was what the log line on spotify told)

Then Spotify should show up in there. Click on Inspect to use it. (Only one of them works, the other gives a 404 for me)
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants