mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
added spicetify configuration and home-manager changes
This commit is contained in:
parent
be44e60b8c
commit
30b43b8bc7
8 changed files with 141 additions and 20 deletions
57
home-manager/config/spicetify/Extensions/adblock.js
Normal file
57
home-manager/config/spicetify/Extensions/adblock.js
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
//@ts-check
|
||||
|
||||
// NAME: adblock
|
||||
// AUTHOR: CharlieS1103
|
||||
// DESCRIPTION: Block all audio and UI ads on Spotify
|
||||
|
||||
/// <reference path="../../spicetify-cli/globals.d.ts" />
|
||||
|
||||
(function adblock() {
|
||||
const { Platform} = Spicetify;
|
||||
if (!(Platform)) {
|
||||
setTimeout(adblock, 300)
|
||||
return
|
||||
}
|
||||
|
||||
var styleSheet = document.createElement("style")
|
||||
|
||||
styleSheet.innerHTML =
|
||||
`
|
||||
.MnW5SczTcbdFHxLZ_Z8j, .WiPggcPDzbwGxoxwLWFf, .ReyA3uE3K7oEz7PTTnAn, .main-leaderboardComponent-container, .sponsor-container, a.link-subtle.main-navBar-navBarLink.GKnnhbExo0U9l7Jz2rdc{
|
||||
display: none !important;
|
||||
}
|
||||
`
|
||||
document.body.appendChild(styleSheet)
|
||||
delayAds()
|
||||
var billboard = Spicetify.Platform.AdManagers.billboard.displayBillboard;
|
||||
Spicetify.Platform.AdManagers.billboard.displayBillboard = function (arguments) {
|
||||
Spicetify.Platform.AdManagers.billboard.finish()
|
||||
// hook before call
|
||||
var ret = billboard.apply(this, arguments);
|
||||
// hook after call
|
||||
console.log("Adblock.js: Billboard blocked! Leave a star!")
|
||||
Spicetify.Platform.AdManagers.billboard.finish()
|
||||
const observer = new MutationObserver((mutations, obs) => {
|
||||
const billboardAd = document.getElementById('view-billboard-ad');
|
||||
if (billboardAd) {
|
||||
Spicetify.Platform.AdManagers.billboard.finish()
|
||||
obs.disconnect();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(document, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
function delayAds() {
|
||||
console.log("Ads delayed: Adblock.js")
|
||||
Spicetify.Platform.AdManagers.audio.audioApi.cosmosConnector.increaseStreamTime(-100000000000)
|
||||
Spicetify.Platform.AdManagers.billboard.billboardApi.cosmosConnector.increaseStreamTime(-100000000000)
|
||||
}
|
||||
setInterval(delayAds, 720 *10000);
|
||||
|
||||
|
||||
})()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{config, pkgs, home-manager, ...}:
|
||||
{config, pkgs, ...}:
|
||||
{
|
||||
imports = [
|
||||
./firefox.nix
|
||||
|
|
@ -12,6 +12,7 @@
|
|||
./picom.nix
|
||||
./git.nix
|
||||
./neovim.nix
|
||||
./spicetify.nix
|
||||
];
|
||||
xsession.numlock.enable = true;
|
||||
programs.home-manager.enable = true;
|
||||
25
home-manager/root.nix
Normal file
25
home-manager/root.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{config, pkgs, ...}:
|
||||
{
|
||||
imports = [
|
||||
./theme.nix
|
||||
./git.nix
|
||||
./neovim.nix
|
||||
];
|
||||
xsession.numlock.enable = true;
|
||||
programs.home-manager.enable = true;
|
||||
home = {
|
||||
username = "root";
|
||||
homeDirectory = "/root";
|
||||
stateVersion = "22.11";
|
||||
file = {
|
||||
".config/Thunar" = {
|
||||
source = ./config/Thunar;
|
||||
recursive = true;
|
||||
};
|
||||
".config/neofetch/config.conf" = {
|
||||
source = ./config/neofetch/config.conf;
|
||||
recursive = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
35
home-manager/spicetify.nix
Normal file
35
home-manager/spicetify.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ pkgs, lib, spicetify-nix, ... }:
|
||||
let
|
||||
spotifyNoPremiumSrc = pkgs.fetchgit {
|
||||
url = "https://github.com/Daksh777/SpotifyNoPremium";
|
||||
rev = "a2daa7a9ec3e21ebba3c6ab0ad1eb5bd8e51a3ca";
|
||||
sha256 = "1sr6pjaygxxx6majmk5zg8967jry53z6xd6zc31ns2g4r5sy4k8d";
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [ spicetify-nix.homeManagerModule ];
|
||||
programs.spicetify = {
|
||||
spotifyPackage = pkgs.spotify-unwrapped;
|
||||
spicetifyPackage = pkgs.spicetify-cli;
|
||||
enable = true;
|
||||
enabledExtensions = with spicetify-nix.pkgs.extensions; [
|
||||
"adblock.js"
|
||||
"hidePodcasts.js"
|
||||
];
|
||||
theme = {
|
||||
name = "spotifyNoPremium";
|
||||
src = spotifyNoPremiumSrc;
|
||||
appendName = false;
|
||||
injectCss = true;
|
||||
replaceColors = false;
|
||||
overwriteAssets = false;
|
||||
sidebarConfig = false;
|
||||
requiredExtensions = [
|
||||
{
|
||||
src = spotifyNoPremiumSrc;
|
||||
filename = "adblock.js";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue