working mpd and beet!

This commit is contained in:
Vali 2024-07-14 13:31:28 +02:00
commit ad1b1089af
25 changed files with 659 additions and 16 deletions

View file

@ -0,0 +1,146 @@
{
config,
inputs,
lib,
...
}: let
cfg = config.modules.programs.schizofox;
inherit (config.modules.other.system) username;
inherit (lib) mkEnableOption mkIf;
in {
options.modules.programs.schizofox = {enable = mkEnableOption "schizofox";};
config = mkIf cfg.enable {
home-manager.users.${username} = {
imports = [inputs.schizofox.homeManagerModule];
programs.schizofox = {
enable = true;
theme = {
# colors = {
# background-darker = "181825";
# background = "1e1e2e";
# foreground = "cdd6f4";
# };
colors = {
background-darker = "1d2021";
background = "282828";
foreground = "ebdbb2";
};
font = "Lexend";
extraUserChrome = ''
body {
color: red !important;
}
'';
};
search = {
defaultSearchEngine = "DuckDuckGo";
removeEngines = ["Google" "Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia"];
addEngines = [
{
Name = "NixOS Packages";
Description = "NixOS Unstable package search";
Alias = "!np";
Method = "GET";
URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
}
{
Name = "NixOS Options";
Description = "NixOS Unstable option search";
Alias = "!no";
Method = "GET";
URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
}
{
Name = "NixOS Wiki";
Description = "NixOS Wiki search";
Alias = "!nw";
Method = "GET";
URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}";
}
{
Name = "Home Manager Options";
Description = "Home Manager option search";
Alias = "!hm";
Method = "GET";
URLTemplate = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master";
}
{
Name = "Arch Wiki";
Description = "Arch Wiki search";
Alias = "!aw";
Method = "GET";
URLTemplate = "https://wiki.archlinux.org/index.php?search={searchTerms}";
}
{
Name = "Gentoo Wiki";
Description = "Gentoo Wiki search";
Alias = "!gw";
Method = "GET";
URLTemplate = "https://wiki.gentoo.org/index.php?search={searchTerms}";
}
{
Name = "Debian Wiki";
Description = "Debian Wiki search";
Alias = "!dw";
Method = "GET";
URLTemplate = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}";
}
{
Name = "noogle";
Descriptiom = "Noogle Search";
Alias = "!no";
Method = "GET";
URLTemplate = "https://noogle.dev/";
}
];
};
extensions = {
simplefox.enable = true;
darkreader.enable = true;
extraExtensions = let
mkUrl = name: "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi";
extensions = [
{
id = "1018e4d6-728f-4b20-ad56-37578a4de76";
name = "flagfox";
}
{
id = "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}";
name = "auto-tab-discard";
}
{
id = "{a4c4eda4-fb84-4a84-b4a1-f7c1cbf2a1ad}";
name = "refined-github-";
}
{
id = "sponsorBlocker@ajay.app";
name = "sponsorblock";
}
{
id = "uBlock0@raymondhill.net";
name = "UBlock Origin";
}
];
extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = {install_url = mkUrl ext.name;};}) {} extensions;
in
extraExtensions;
};
security = {
sanitizeOnShutdown = false;
sandbox = true;
userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0";
};
misc = {
drm.enable = true;
disableWebgl = true;
#startPageURL = "file://${./src}/index.html";
};
};
};
};
}

View file

@ -0,0 +1,26 @@
# Stolen from Raf, kinda
{
lib,
stdenvNoCC,
}: let
name = "schizofox-startpage";
version = "2023-12-29-unstable";
in
stdenvNoCC.mkDerivation {
inherit name version;
src = ./src;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -rv $src/* $out
runHook postInstall
'';
meta = {
description = "My personal startpage";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [NotAShelf];
};
}

View file

@ -0,0 +1,17 @@
module.exports = {
env: {
es2021: true,
},
extends: "eslint:recommended",
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
rules: {
indent: ["error", 4],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
},
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,88 @@
<html>
<head>
<!--<link rel="shortcut icon" href="img\opera-multi-size.ico">-->
<link rel="stylesheet" type="text/css" href="style.css">
<title>Startpage</title>
</head>
<body>
<div id=stripe>
<div id="Title">notashelf@nyx ~ $ > ls</div>
<input
id="searchbox"
placeholder="Options: | -a | -h | -m | -w | -y |"
type="text"
autofocus="true"
autocomplete="true">
</input>
<div id=mainframe>
<div id=linkblock style="background-image:url(assets/planet.png)">
<ul>
<!-- General -->
<li><a href="https://google.com">> Google</a></li>
<li><a href="https://youtube.com">> Youtube</a></li>
<li><a href="https://monkeytype.com/">> Monkeytype</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/flowers.png);">
<ul>
<!-- Social -->
<li><a href="https://twitter.com/">> Twitter</a></li>
<li><a href="https://web.telegram.org">> Telegram</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/logs.png);">
<ul>
<!-- Reddit -->
<li><a href="https://www.reddit.com/r/android">> r/android</a></li>
<li><a href="https://www.reddit.com/r/sysadmin">> r/sysadmin</a></li>
<li><a href="https://www.reddit.com/r/linux">> r/linux</a></li>
<li><a href="https://www.reddit.com/r/unixporn">> r/unixporn</a></li>
<li><a href="https://www.reddit.com/r/hyprland">> r/hyprland</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/blossom.png);">
<ul>
<!-- 4chan -->
<li><a href="https://www.4chan.org/a/">> /a/</a></li>
<li><a href="https://www.4chan.org/ck/">> /ck/</a></li>
<li><a href="https://www.4chan.org/g/">> /g/</a></li>
<li><a href="https://www.4chan.org/w/">> /w/</a></li>
<li><a href="https://www.4chan.org/wg/">> /wg/</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/malachite.png);">
<ul>
<!-- Dev -->
<li><a href="https://github.com">> Github</a></li>
<li><a href="http://forum.xda-developers.com">> XDA Developers</a></li>
<li><a href="https://www.archlinux.org/">> Archwiki</a></li>
<li><a href="https://go.dev/doc/">> Golang Docs</a></li>
<li><a href="https://crates.io/">> Crate Registry</a></li>
</ul>
</div>
<div id=linkblock style="background-image:url(assets/sway.png);">
<!-- Nix -->
<ul>
<li>
<a href="https://nixos.org/manual/nixos/unstable/">> NixOS Manual</a>
</li>
<li>
<a href="https://nixos.org/manual/nixpkgs/ustable/">> Nixpkgs Manual</a>
</li>
<li>
<a href="https://nixos.org/manual/nix/unstable/">> Nix Manual</a>
</li>
<li>
<a href="https://noogle.dev/">> noogle</a>
</li>
</ul>
</div>
</div>
</div>
<div id=footer>
<a href="secondary.html">o</a>
</div>
</body>
<script src="search.js" type="text/javascript"></script>
</html>

View file

@ -0,0 +1,78 @@
String.prototype.replaceChars = function (character, replacement) {
return this.split(character).join(replacement);
};
function search(query) {
const searchPrefix = query.substring(0, 2);
query = query.substring(3);
switch (searchPrefix) {
case "-a":
window.location = `http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=${query.replaceChars(
" ",
"+",
)}`;
break;
case "-y":
window.location = `https://www.youtube.com/results?search_query=${query.replaceChars(
" ",
"+",
)}`;
break;
case "-w":
window.location = `https://en.wikipedia.org/w/index.php?search=${query.replaceChars(
" ",
"%20",
)}`;
break;
case "-m":
window.location = `http://www.wolframalpha.com/input/?i=${query.replaceChars(
"+",
"%2B",
)}`;
break;
case "-h":
window.location = `http://alpha.wallhaven.cc/search?q=${query}&categories=111&purity=100&resolutions=1920x1080&sorting=relevance&order=desc`;
break;
default:
window.location = `https://search.notashelf.dev/search?q=${query.replaceChars(
" ",
"+",
)}&categories=general`;
}
}
window.onload = function () {
const searchInput = document.getElementById("searchbox");
if (searchInput) {
searchInput.addEventListener("keypress", function (event) {
if (event.keyCode === 13) {
search(this.value);
}
});
}
};
//
// To add a new search provider, paste the following between the last "break;" and "default:" (Line 39 & 40)
//
// case "-a":
// query = query.substr(3);
// window.location =
// "https://en.website.com/" +
// query.replaceChars(" ", "%20");
// break;
//
// -a on ln68 should be replaced with a "-letter" of your choice. You can also change it to !a, .a, /a etc.
// https://en.website.com/ on ln70 should be replaced with the search page of the website. To find this, make a few searches on your website.
//Try to identify where your search is in the URL. If you're not sure, post in the thread and someone should help you out
//
// You can use the above two to modify an existing rule
//
// If you wish to change the number of characters in a "case", you need to change the line below, changing query.substr() to n+1, n being the number of characters.
// This ensures that when you search for something, the whole of your idenfier and the space between the identifier and query are removed.

View file

@ -0,0 +1,130 @@
body {
background-color: #11111b;
color: #cdd6f4;
}
#Title {
font-family: "Malgun Gothic";
text-align: center;
color: #cdd6f4;
margin-top: 75px;
}
#searchbox {
width: 500;
height: 4%;
border: none;
border-radius: 2px;
outline: none;
padding-left: 15px;
text-align: left;
background-color: #1e1e2e;
color: #cdd6f4;
font-size: 15px;
font-family: "Malgun Gothic", sans-serif;
display: block;
margin: auto;
margin-top: 50px;
}
#stripe {
width: 100%;
vertical-align: middle;
}
#mainframe {
text-align: center;
position: absolute;
top: 25%;
left: 16%;
right: 11%;
}
#footer {
position: absolute;
bottom: 0;
right: 0;
text-align: right;
padding: 10px;
font-size: 30%;
}
#linkblock {
width: 20%;
height: 140px;
margin-left: 25px;
margin-right: 30px;
margin-top: 30px;
margin-bottom: 40px;
padding-left: 67px;
padding-right: 1px;
padding-top: 0px;
padding-bottom: 5px;
color: #cdd6f4;
text-align: left;
background-position: top 0px left 0px;
background-repeat: no-repeat;
font-family: "Malgun Gothic";
font-size: 100%;
display: inline-block;
vertical-align: top;
border-left: 3px solid #181825;
transition: 0.5s;
}
ul {
list-style-type: none;
padding-left: 0;
}
a:link {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
a:visited {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
a:hover {
text-decoration: none;
font-weight: normal;
color: #b4befe;
}
a:active {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
a:focus {
text-decoration: none;
font-weight: normal;
color: #89b4fa;
}
#footer a:link {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:visited {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:hover {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:active {
text-decoration: none;
font-weight: normal;
color: #101010;
}
#footer a:focus {
text-decoration: none;
font-weight: normal;
color: #101010;
}