Skip to content

Commit

Permalink
v 1.1.0 - Major bug fixes - themes look good now! (#2)
Browse files Browse the repository at this point in the history
- Fixed customapps completely
- Fixed all known broken extensions (lastfm, genre, full album date, play next)
- Fixed broken themes such as Dribbblish (except for Turntable, which still appears to be broken)
  • Loading branch information
the-argus authored Aug 9, 2022
1 parent c6bac08 commit 9b8665b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 9 deletions.
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Warning: Spotify Sucks
Linux is a second class citizen on Spotify's release plan, but because it isn't FOSS, there's nothing we can do. Right now a lot of themes and extensions don't work because spotify isn't up to date on Linux. This includes Dribbblish :(
# ~~Warning: Spotify Sucks~~
~~Linux is a second class citizen on Spotify's release plan, but because it isn't FOSS, there's nothing we can do. Right now a lot of themes and extensions don't work because spotify isn't up to date on Linux. This includes Dribbblish :(~~

# EDIT: nevermind
Turns out using spicetify 2.9.9 and the most recent CSS map fixes most (or all) of the issues. Use the following configuration option to get spicetify 2.9.9:
```nix
{
programs.spicetify.spicetifyPackage = pkgs.spicetify-cli.overrideAttrs (oa: rec {
pname = "spicetify-cli";
version = "2.9.9";
src = pkgs.fetchgit {
url = "https://github.com/spicetify/${pname}";
rev = "v${version}";
sha256 = "1a6lqp6md9adxjxj4xpxj0j1b60yv3rpjshs91qx3q7blpsi3z4z";
};
});
}
```
# Spicetify-Nix

Modifies Spotify using [spicetify-cli](https://github.com/khanhas/spicetify-cli).
Expand Down Expand Up @@ -35,8 +50,6 @@ Here are two examples of files which configures spicetify when imported into a u
programs.spicetify =
{
enable = true;
# recommended to use newest version of spicetify unless you know what you're doing
spicetifyPackage = unstable.spicetify-cli;
theme = "catppuccin-mocha";
# OR
# theme = spicetify-nix.pkgs.themes.catppuccin-mocha;
Expand All @@ -52,7 +65,6 @@ Here are two examples of files which configures spicetify when imported into a u
```

### MAXIMUM CONFIGURATION
WARNING: Do not copy + paste this configuration. The "enabledCustomApps" causes spotify to give the "something went wrong" page eternally. This configuration is only meant as an example.
```nix
{ pkgs, unstable, lib, spicetify-nix, ... }:
{
Expand Down Expand Up @@ -85,7 +97,15 @@ WARNING: Do not copy + paste this configuration. The "enabledCustomApps" causes
# use spotify from the nixpkgs master branch
spotifyPackage = unstable.spotify-unwrapped;
# use a custom build of spicetify, also an old version.
spicetifyPackage = import ../../packages/spicetify-cli-2.9.9.nix { inherit pkgs; };
spicetifyPackage = pkgs.spicetify-cli.overrideAttrs (oa: rec {
pname = "spicetify-cli";
version = "2.9.9";
src = pkgs.fetchgit {
url = "https://github.com/spicetify/${pname}";
rev = "v${version}";
sha256 = "1a6lqp6md9adxjxj4xpxj0j1b60yv3rpjshs91qx3q7blpsi3z4z";
};
});
# actually enable the installation of spotify and spicetify
enable = true;
Expand Down Expand Up @@ -138,7 +158,6 @@ WARNING: Do not copy + paste this configuration. The "enabledCustomApps" causes
misc = "6e6a86";
};
# BROKEN AT TIME OF WRITING
enabledCustomApps = with spicetify-nix.pkgs.apps; [
new-releases
{
Expand Down
22 changes: 20 additions & 2 deletions module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ in
type = lib.types.nullOr lib.types.attrs;
default = null;
};

cssMap = mkOption {
type = lib.types.path;
default = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/spicetify/spicetify-cli/6f473f28151c75e08e83fb280dd30fadd22d9c04/css-map.json";
sha256 = "1qj0hlq98hz4v318qhz6ijyrir96fj962gqz036dm4jka3bg06l7";
};
};
};

config =
Expand All @@ -101,7 +109,7 @@ in
allApps = map spiceLib.getApp (cfg.enabledCustomApps ++ cfg.xpui.AdditionalOptions.custom_apps);
allAppsNames = map (item: item.name) allApps;
customAppsString = pipeConcat allAppsNames;

# cfg.theme.injectCss is a submodule but cfg.injectCss is not, so we
# have to have two different override functions for each case
# (one value is null while the other is undefined...)
Expand Down Expand Up @@ -182,7 +190,7 @@ in
"${item.src}")} ./CustomApps/${item.name}")
allApps);

spicetify = "${cfg.spicetifyPackage}/bin/spicetify-cli --no-restart";
spicetify = "spicetify-cli --no-restart";

theme = spiceLib.getTheme cfg.theme;
themePath = spiceLib.getThemePath theme;
Expand All @@ -204,6 +212,16 @@ in
finalScript = ''
export SPICETIFY_CONFIG=$out/spicetify
mkdir -p $SPICETIFY_CONFIG
# move spicetify bin here
cp ${cfg.spicetifyPackage}/bin/spicetify-cli $SPICETIFY_CONFIG/spicetify-cli
${pkgs.coreutils-full}/bin/chmod +x $SPICETIFY_CONFIG/spicetify-cli
cp -r ${cfg.spicetifyPackage}/bin/jsHelper $SPICETIFY_CONFIG/jsHelper
# grab the css map
cp -r ${cfg.cssMap} $SPICETIFY_CONFIG/css-map.json
# add the current directory to path
export PATH=$SPICETIFY_CONFIG:$PATH
pushd $SPICETIFY_CONFIG
# create config and prefs
Expand Down

0 comments on commit 9b8665b

Please sign in to comment.