51
hosts/common/user/configs/gui/spicetify/colors.css
Normal file
51
hosts/common/user/configs/gui/spicetify/colors.css
Normal file
@@ -0,0 +1,51 @@
|
||||
:root {
|
||||
--spice-text: {{colors.primary.default.hex}};
|
||||
--spice-subtext: {{colors.on_surface_variant.default.hex}};
|
||||
--spice-nav-active: {{colors.primary.default.hex}};
|
||||
--spice-nav-active-text: {{colors.surface.default.hex}};
|
||||
--spice-main: {{colors.surface.default.hex}};
|
||||
--spice-main-secondary: {{colors.surface_container.default.hex}};
|
||||
--spice-main-elevated: {{colors.surface_container_high.default.hex}};
|
||||
--spice-sidebar: {{colors.surface.default.hex}};
|
||||
--spice-card: {{colors.surface_container_high.default.hex}};
|
||||
--spice-shadow: {{colors.shadow.default.hex}};
|
||||
--spice-button: {{colors.primary.default.hex}};
|
||||
--spice-button-active: {{colors.primary.default.hex}};
|
||||
--spice-button-secondary: {{colors.on_surface_variant.default.hex}};
|
||||
--spice-button-disabled: {{colors.outline_variant.default.hex}};
|
||||
--spice-player: {{colors.surface_container_high.default.hex}};
|
||||
--spice-play-button: {{colors.primary.default.hex}};
|
||||
--spice-playback-bar: {{colors.primary.default.hex}};
|
||||
--spice-tab-active: {{colors.surface_container.default.hex}};
|
||||
--spice-selected-row: {{colors.on_surface.default.hex}};
|
||||
--spice-highlight: {{colors.surface_container.default.hex}};
|
||||
--spice-highlight-elevated: {{colors.surface_container_high.default.hex}};
|
||||
--spice-notification: {{colors.surface_container_high.default.hex}};
|
||||
--spice-notification-error: {{colors.error_container.default.hex}};
|
||||
--spice-misc: {{colors.on_surface.default.hex}};
|
||||
|
||||
--spice-rgb-text: {{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}};
|
||||
--spice-rgb-subtext: {{colors.on_surface_variant.default.red}}, {{colors.on_surface_variant.default.green}}, {{colors.on_surface_variant.default.blue}};
|
||||
--spice-rgb-nav-active: {{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}};
|
||||
--spice-rgb-nav-active-text: {{colors.surface.default.red}}, {{colors.surface.default.green}}, {{colors.surface.default.blue}};
|
||||
--spice-rgb-main: {{colors.surface.default.red}}, {{colors.surface.default.green}}, {{colors.surface.default.blue}};
|
||||
--spice-rgb-main-secondary: {{colors.surface_container.default.red}}, {{colors.surface_container.default.green}}, {{colors.surface_container.default.blue}};
|
||||
--spice-rgb-main-elevated: {{colors.surface_container_high.default.red}}, {{colors.surface_container_high.default.green}}, {{colors.surface_container_high.default.blue}};
|
||||
--spice-rgb-sidebar: {{colors.surface.default.red}}, {{colors.surface.default.green}}, {{colors.surface.default.blue}};
|
||||
--spice-rgb-card: {{colors.surface_container_high.default.red}}, {{colors.surface_container_high.default.green}}, {{colors.surface_container_high.default.blue}};
|
||||
--spice-rgb-shadow: {{colors.shadow.default.red}}, {{colors.shadow.default.green}}, {{colors.shadow.default.blue}};
|
||||
--spice-rgb-button: {{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}};
|
||||
--spice-rgb-button-active: {{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}};
|
||||
--spice-rgb-button-secondary: {{colors.primary_container.default.red}}, {{colors.primary_container.default.green}}, {{colors.primary_container.default.blue}};
|
||||
--spice-rgb-button-disabled: {{colors.outline_variant.default.red}}, {{colors.outline_variant.default.green}}, {{colors.outline_variant.default.blue}};
|
||||
--spice-rgb-player: {{colors.surface_container_high.default.red}}, {{colors.surface_container_high.default.green}}, {{colors.surface_container_high.default.blue}};
|
||||
--spice-rgb-play-button: {{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}};
|
||||
--spice-rgb-playback-bar: {{colors.primary.default.red}}, {{colors.primary.default.green}}, {{colors.primary.default.blue}};
|
||||
--spice-rgb-tab-active: {{colors.surface_container.default.red}}, {{colors.surface_container.default.green}}, {{colors.surface_container.default.blue}};
|
||||
--spice-rgb-selected-row: {{colors.on_surface.default.red}}, {{colors.on_surface.default.green}}, {{colors.on_surface.default.blue}};
|
||||
--spice-rgb-highlight: {{colors.surface_container.default.red}}, {{colors.surface_container.default.green}}, {{colors.surface_container.default.blue}};
|
||||
--spice-rgb-highlight-elevated: {{colors.surface_container_high.default.red}}, {{colors.surface_container_high.default.green}}, {{colors.surface_container_high.default.blue}};
|
||||
--spice-rgb-notification: {{colors.surface_container_high.default.red}}, {{colors.surface_container_high.default.green}}, {{colors.surface_container_high.default.blue}};
|
||||
--spice-rgb-notification-error: {{colors.error_container.default.red}}, {{colors.error_container.default.green}}, {{colors.error_container.default.blue}};
|
||||
--spice-rgb-misc: {{colors.on_surface.default.red}}, {{colors.on_surface.default.green}}, {{colors.on_surface.default.blue}};
|
||||
}
|
66
hosts/common/user/configs/gui/spicetify/default.nix
Normal file
66
hosts/common/user/configs/gui/spicetify/default.nix
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
username ? throw "username argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
userConfig = config.users.users.${username};
|
||||
hmConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 57621 ];
|
||||
allowedUDPPorts = [ 5353 ];
|
||||
};
|
||||
|
||||
home-manager.users.${username} = {
|
||||
imports = [ inputs.spicetify-nix.homeManagerModules.default ];
|
||||
|
||||
programs.spicetify =
|
||||
let
|
||||
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
|
||||
spicetifyPackage = pkgs.spicetify-cli.overrideAttrs (oldAttrs: {
|
||||
patches = oldAttrs.patches or [ ] ++ [ ./user-colors.patch ];
|
||||
});
|
||||
|
||||
theme = spicePkgs.themes.sleek // {
|
||||
extraCommands = ''
|
||||
export COLORS_CSS_PATH="${hmConfig.xdg.configHome}/spotify/colors.css"
|
||||
'';
|
||||
|
||||
additionalCss = ''
|
||||
.main-topBar-topbarContentRight button {
|
||||
background-color: unset !important;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
enabledExtensions = with spicePkgs.extensions; [
|
||||
loopyLoop
|
||||
trashbin
|
||||
fullAlbumDate
|
||||
phraseToPlaylist
|
||||
songStats
|
||||
copyToClipboard
|
||||
betterGenres
|
||||
adblock
|
||||
autoSkip
|
||||
];
|
||||
};
|
||||
|
||||
theme.templates."${hmConfig.xdg.configHome}/spotify/colors.css".source = ./colors.css;
|
||||
|
||||
home.persistence = {
|
||||
"/persist${userConfig.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/spotify" ];
|
||||
"/cache${userConfig.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/spotify" ];
|
||||
};
|
||||
};
|
||||
}
|
31
hosts/common/user/configs/gui/spicetify/user-colors.patch
Normal file
31
hosts/common/user/configs/gui/spicetify/user-colors.patch
Normal file
@@ -0,0 +1,31 @@
|
||||
diff --git a/src/apply/apply.go b/src/apply/apply.go
|
||||
index 47f1346..47badab 100644
|
||||
--- a/src/apply/apply.go
|
||||
+++ b/src/apply/apply.go
|
||||
@@ -2,6 +2,7 @@ package apply
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
+ "errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -65,10 +66,17 @@ func AdditionalOptions(appsFolderPath string, flags Flag) {
|
||||
// To not use custom css, set `themeFolder` to blank string
|
||||
// To use default color scheme, set `scheme` to `nil`
|
||||
func UserCSS(appsFolderPath, themeFolder string, scheme map[string]string) {
|
||||
+ colorsSrc := os.Getenv("COLORS_CSS_PATH")
|
||||
colorsDest := filepath.Join(appsFolderPath, "xpui", "colors.css")
|
||||
- if err := os.WriteFile(colorsDest, []byte(getColorCSS(scheme)), 0700); err != nil {
|
||||
+
|
||||
+ if len(colorsSrc) == 0 {
|
||||
+ utils.Fatal(errors.New("COLORS_CSS_PATH environment variable is not set"))
|
||||
+ }
|
||||
+
|
||||
+ if err := os.Symlink(colorsSrc, colorsDest); err != nil {
|
||||
utils.Fatal(err)
|
||||
}
|
||||
+
|
||||
cssDest := filepath.Join(appsFolderPath, "xpui", "user.css")
|
||||
if err := os.WriteFile(cssDest, []byte(getUserCSS(themeFolder)), 0700); err != nil {
|
||||
utils.Fatal(err)
|
@@ -42,6 +42,7 @@ in
|
||||
(import ../common/user/configs/gui/qalculate { inherit username; })
|
||||
(import ../common/user/configs/gui/qt { inherit username; })
|
||||
(import ../common/user/configs/gui/rofi { inherit username; })
|
||||
(import ../common/user/configs/gui/spicetify { inherit username; })
|
||||
(import ../common/user/configs/gui/swww { inherit username; })
|
||||
(import ../common/user/configs/gui/theme { inherit username; })
|
||||
(import ../common/user/configs/gui/vscode { inherit username; })
|
||||
|
Reference in New Issue
Block a user