Reorganize imports

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-12-21 23:32:29 +02:00
parent 0ae56e6e25
commit 98ce774210
189 changed files with 253 additions and 260 deletions

View 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}};
}

View File

@@ -0,0 +1 @@
app.autostart-mode="off"

View File

@@ -0,0 +1,7 @@
audio.crossfade_v2=true
audio.allow_downgrade=false
audio.sync_bitrate_enumeration=4
audio.play_bitrate_enumeration=4
audio.play_bitrate_non_metered_migrated=true
audio.play_bitrate_non_metered_enumeration=4
ui.track_notifications_enabled=false

View File

@@ -0,0 +1,90 @@
{
user ? throw "user argument is required",
home ? throw "home argument is required",
}:
{
config,
inputs,
lib,
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${user};
in
{
networking.firewall = {
allowedTCPPorts = [ 57621 ];
allowedUDPPorts = [ 5353 ];
};
environment.persistence = {
"/persist"."${home}/.config/spotify" = { };
"/cache"."${home}/.cache/spotify" = { };
};
home-manager.users.${user} = {
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="${home}/.config/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
];
};
sops.secrets."spotify/username".sopsFile = ../../../../../../secrets/personal/secrets.yaml;
xdg.configFile = {
"spotify/prefs.init" = {
source = ./config/prefs;
onChange = ''
${config.lib.runtime.merge.keyValue} "${home}/.config/spotify/prefs.init" "${home}/.config/spotify/prefs"
'';
};
"spotify/prefs-user.init" = {
source = ./config/prefs-user;
onChange = ''
user = $(cat "${hmConfig.sops.secrets."spotify/username".path}")
${config.lib.runtime.merge.keyValue} "${home}/.config/spotify/prefs-user.init" "${home}/.config/spotify/Users/''${user}-user/prefs"
'';
};
};
theme.template."${home}/.config/spotify/colors.css".source = ./colors.css;
wayland.windowManager.hyprland.settings.bind = [
"$mod, m, exec, ${lib.meta.getExe hmConfig.programs.spicetify.spicedSpotify}"
];
};
}

View 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)