added stuff

This commit is contained in:
Charlie Root 2024-04-09 23:11:33 +02:00
commit 9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,26 @@
{
lib,
stdenvNoCC,
fetchzip,
}:
stdenvNoCC.mkDerivation rec {
pname = "anime4k";
version = "4.0.1";
src = fetchzip {
url = "https://github.com/bloc97/Anime4K/releases/download/v${version}/Anime4K_v4.0.zip";
stripRoot = false;
sha256 = "18x5q7zvkf5l0b2phh70ky6m99fx1pi6mhza4041b5hml7w987pl";
};
installPhase = ''
mkdir $out
cp *.glsl $out
'';
meta = {
description = "A High-Quality Real Time Upscaler for Anime Video";
homepage = "https://github.com/bloc97/Anime4K";
license = lib.licenses.mit;
};
}

View file

@ -0,0 +1,38 @@
{
stdenv,
lib,
makeWrapper,
box64,
x64-bash,
pkg,
deps,
bins ? "${lib.getBin pkg}/bin/*",
entry ? "${box64}/bin/box64",
extraWrapperArgs ? [],
}:
stdenv.mkDerivation rec {
name = "box64-wrapped-${pkg.name}";
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [makeWrapper];
buildInputs = deps;
installPhase = ''
runHook preInstall
for bin in ${bins}; do
mkdir -p $out/bin
makeWrapper ${entry} $out/bin/"$(basename "$bin")" \
--set BOX64_BASH ${lib.getBin x64-bash}/bin/bash \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs} \
${lib.strings.concatStringsSep " " extraWrapperArgs}\
--add-flags "$bin"
done
runHook postInstall
'';
}

View file

@ -0,0 +1,21 @@
{inputs, ...}: {
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem = {pkgs, ...}: let
inherit (pkgs) callPackage;
in {
packages = {
schizofox-startpage = callPackage ./startpage {};
plymouth-themes = callPackage ./plymouth-themes.nix {};
anime4k = callPackage ./anime4k.nix {};
spotify-wrapped = callPackage ./spotify-wrapped.nix {};
nicksfetch = callPackage ./nicksfetch.nix {};
present = callPackage ./present.nix {};
modprobed-db = callPackage ./modprobed-db.nix {};
nixfmt-rfc = callPackage ./nixfmt-rfc.nix {inherit inputs;};
};
};
}

View file

@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
libevdev,
kmod,
sudo,
withSudo ? false,
}:
stdenv.mkDerivation rec {
pname = "modprobed-db";
version = "2.44";
src = fetchFromGitHub {
owner = "graysky2";
repo = pname;
rev = "v${version}";
sha256 = "sha256-APvA96NoYPtUyuzqGWCqOpB73Vz3qhkMvHWExHXhkKM=";
};
nativeBuildInputs = [pkg-config];
buildInputs =
[kmod libevdev]
++ lib.optional withSudo sudo;
postPatch = ''
substituteInPlace ./common/modprobed-db.in --replace "/usr/share" "$out/share"
'';
installFlags = ["DESTDIR=$(out)" "PREFIX="];
meta = {
homepage = "https://github.com/graysky2/modprobed-db";
description = "useful utility for users wishing to build a minimal kernel via a make localmodconfig";
longDescription = ''
Keeps track of EVERY kernel module that has ever been probed.
Useful for those of us who make localmodconfig :)'';
license = lib.licenses.mit;
maintainers = with lib.maintainers; [NotAShelf];
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,53 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
bash,
makeWrapper,
pciutils,
x11Support ? true,
ueberzug,
}:
stdenvNoCC.mkDerivation {
pname = "nicksfetch";
version = "unstable-2021-12-10";
src = fetchFromGitHub {
owner = "dylanaraps";
repo = "neofetch";
rev = "ccd5d9f52609bbdcd5d8fa78c4fdb0f12954125f";
sha256 = "sha256-9MoX6ykqvd2iB0VrZCfhSyhtztMpBTukeKejfAWYW1w=";
};
patches = [
./patches/0002-nicksfetch.patch
];
outputs = ["out" "man"];
strictDeps = true;
buildInputs = [bash];
nativeBuildInputs = [makeWrapper];
postPatch = ''
patchShebangs --host neofetch
'';
postInstall = ''
wrapProgram $out/bin/neofetch \
--prefix PATH : ${lib.makeBinPath ([pciutils] ++ lib.optional x11Support ueberzug)}
'';
makeFlags = [
"PREFIX=${placeholder "out"}"
"SYSCONFDIR=${placeholder "out"}/etc"
];
meta = {
description = "A fast, highly customizable system info script";
homepage = "https://github.com/dylanaraps/neofetch";
license = lib.licenses.mit;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [alibabzo konimex notashelf];
mainProgram = "neofetch";
};
}

View file

@ -0,0 +1,12 @@
{
inputs,
nixfmt-rfc-style,
...
}:
nixfmt-rfc-style.overrideAttrs (self: let
pname = "nixfmt-rfc";
version = "${self.version}-${inputs.nixfmt.shortRev}";
in {
inherit pname version;
src = inputs.nixfmt;
})

View file

@ -0,0 +1,25 @@
From 0eaef67b683683fb423fcb2d5096b3cdf9a4a9cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= <mkg20001@gmail.com>
Date: Sun, 22 Mar 2020 12:26:10 +0100
Subject: [PATCH] Patch plugindir to output
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 50edb74..639ee86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,7 +50,7 @@ PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.40 gio-unix-2.0 gmodule-2.0 ])
PKG_CHECK_MODULES([cairo], [cairo])
PKG_CHECK_MODULES([rofi], [rofi >= 1.5.4])
-[rofi_PLUGIN_INSTALL_DIR]="`$PKG_CONFIG --variable=pluginsdir rofi`"
+[rofi_PLUGIN_INSTALL_DIR]="`echo $out/lib/rofi`"
AC_SUBST([rofi_PLUGIN_INSTALL_DIR])
LT_INIT([disable-static])
--
2.25.1

View file

@ -0,0 +1,90 @@
diff --git a/neofetch b/neofetch
index 48b96d21..a2270c9a 100755
--- a/neofetch
+++ b/neofetch
@@ -46,7 +46,7 @@ LC_ALL=C
LANG=C
# Fix issues with gsettings.
-export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
+[[ -z $GIO_EXTRA_MODULES ]] && export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
# Neofetch default config.
read -rd '' config <<'EOF'
@@ -999,6 +999,13 @@ get_distro() {
*) distro="OS Elbrus $(< /etc/mcst_version)"
esac
+ elif [[ -f /etc/NIXOS ]]; then
+ case $distro_shorthand in
+ on) distro="Nick's OS $(nixos-version | awk '{print substr($1,0,5),$2}')" ;;
+ tiny) distro="NixOS" ;;
+ *) distro="Nick's OS $(nixos-version)" ;;
+ esac
+
elif type -p pveversion >/dev/null; then
case $distro_shorthand in
on|tiny) distro="Proxmox VE" ;;
@@ -8951,29 +8958,38 @@ EOF
"nixos_old"*)
set_colors 4 6
read -rd '' ascii_data <<'EOF'
-${c1} ::::. ${c2}'::::: ::::'
-${c1} '::::: ${c2}':::::. ::::'
-${c1} ::::: ${c2}'::::.:::::
-${c1} .......:::::..... ${c2}::::::::
-${c1} ::::::::::::::::::. ${c2}:::::: ${c1}::::.
- ::::::::::::::::::::: ${c2}:::::. ${c1}.::::'
-${c2} ..... ::::' ${c1}:::::'
-${c2} ::::: '::' ${c1}:::::'
-${c2} ........::::: ' ${c1}:::::::::::.
-${c2}::::::::::::: ${c1}:::::::::::::
-${c2} ::::::::::: ${c1}.. ${c1}:::::
-${c2} .::::: ${c1}.::: ${c1}:::::
-${c2} .::::: ${c1}::::: ${c1}''''' ${c2}.....
- ::::: ${c1}':::::. ${c2}......:::::::::::::'
- ::: ${c1}::::::. ${c2}':::::::::::::::::'
-${c1} .:::::::: ${c2}'::::::::::
-${c1} .::::''::::. ${c2}'::::.
-${c1} .::::' ::::. ${c2}'::::.
-${c1} .:::: :::: ${c2}'::::.
-EOF
- ;;
-
- "NixOS"*)
+${c1} ____ ${c2}_______ ____
+${c1} /####\ ${c2}\######\ /####\
+${c1} ######\ ${c2}\######\ /#####/
+${c1} \######\ ${c2}\######\ /#####/
+${c1} \######\ ${c2}\######\/#####/ ${c1}/\
+${c1} \######\ ${c2}\###########/ ${c1}/##\
+${c1} ________\######\______${c2}\#########/ ${c1}/####\
+${c1} /#######################${c2}\#######/ ${c1}/######
+${c1} /#########################${c2}\######\ ${c1}/######/
+${c1} /###########################${c2}\######\ ${c1}/######/
+${c1} ¯¯¯¯¯¯¯¯¯¯¯¯${c2}/######/${c1}¯¯¯¯¯¯¯¯¯${c2}\######${c1}/######/
+${c2} /######/ ${c2}\####${c1}/######/________
+${c2} _____________/######/ ${c2}\##${c1}/################\
+${c2} /###################/ ${c2}\${c1}/##################\
+${c2} \##################/${c1}\ /###################/
+${c2} \################/${c1}##\ /######/¯¯¯¯¯¯¯¯¯¯¯¯¯
+${c2} ¯¯¯¯¯¯¯¯/######/${c1}####\ /######/
+${c2} /######/${c1}######\${c2}_________${c1}/######/${c2}____________
+${c2} /######/ ${c1}\######\${c2}###########################/
+${c2} /######/ ${c1}\######\${c2}#########################/
+${c2} ######/ ${c1}/#######\${c2}#######################/
+${c2} \####/ ${c1}/#########\${c2}¯¯¯¯¯¯\######\¯¯¯¯¯¯¯¯
+${c2} \##/ ${c1}/###########\${c2} \######\
+${c2} \/ ${c1}/#####/\######\${c2} \######\
+${c1} ${c1}/#####/ \######\${c2} \######\
+${c1} ${c1}/#####/ \######\${c2} \######
+${c1} ${c1}\####/ \######\${c2} \####/
+${c1} ${c1}¯¯¯¯ ¯¯¯¯¯¯¯${c2} ¯¯¯¯
+EOF
+ ;;
+
+ "Nicks OS"*)
set_colors 4 6
read -rd '' ascii_data <<'EOF'
${c1} ▗▄▄▄ ${c2}▗▄▄▄▄ ▄▄▄▖

View file

@ -0,0 +1,42 @@
{
lib,
stdenv,
fetchFromGitHub,
pack ? 2,
theme ? "green_blocks",
...
}:
stdenv.mkDerivation rec {
pname = "plymouth-themes";
version = "1.0.0";
strictDeps = true;
src = fetchFromGitHub {
owner = "adi1090x";
repo = "plymouth-themes";
rev = "bf2f570bee8e84c5c20caac353cbe1d811a4745f";
sha256 = "sha256-VNGvA8ujwjpC2rTVZKrXni2GjfiZk7AgAn4ZB4Baj2k=";
};
configurePhase = ''
runHook preConfigure
mkdir -p $out/share/plymouth/themes
runHook postConfigure
'';
installPhase = ''
runHook preInstall
cp -r ./pack_${toString pack}/${theme} $out/share/plymouth/themes
sed -i 's;/usr/share;${placeholder "out"}/share;g' \
$out/share/plymouth/themes/${theme}/${theme}.plymouth
runHook postInstall
'';
meta = {
description = "A collection of plymouth themes ported from Android.";
inherit (src.meta) homepage;
license = lib.licenses.gpl3;
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,15 @@
# yoinked from https://github.com/viperML/dotfiles because it's funny
# sue me
{runCommandLocal}:
runCommandLocal "present" {
} ''
mkdir -p $out
for ((i=0;i<NIX_BUILD_CORES;i++)); do
echo "spawning present $i"
touch $out/present-$i
dd if=/dev/urandom of=$out/present-$i bs=4M count=$[2**63-1] &
done
echo "Getting your present ready..."
wait
''

View file

@ -0,0 +1,214 @@
{
fetchurl,
lib,
stdenv,
squashfsTools,
xorg,
alsa-lib,
makeShellWrapper,
wrapGAppsHook,
openssl,
freetype,
glib,
pango,
cairo,
atk,
gdk-pixbuf,
gtk3,
cups,
nspr,
nss_latest,
libpng,
libnotify,
libgcrypt,
systemd,
fontconfig,
dbus,
expat,
ffmpeg_4,
curlWithGnuTls,
zlib,
gnome,
at-spi2-atk,
at-spi2-core,
libpulseaudio,
libdrm,
mesa,
libxkbcommon,
harfbuzz,
curl,
libgnurl,
# High-DPI support: Spotify's --force-device-scale-factor argument
# not added if `null`, otherwise, should be a number.
deviceScaleFactor ? null,
}: let
# TO UPDATE: just execute the ./update.sh script (won't do anything if there is no update)
# "rev" decides what is actually being downloaded
# If an update breaks things, one of those might have valuable info:
# https://aur.archlinux.org/packages/spotify/
# https://community.spotify.com/t5/Desktop-Linux
version = "1.2.11.916.geb595a67";
# To get the latest stable revision:
# curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/spotify?channel=stable' | jq '.download_url,.version,.last_updated'
# To get general information:
# curl -H 'Snap-Device-Series: 16' 'https://api.snapcraft.io/v2/snaps/info/spotify' | jq '.'
# More examples of api usage:
# https://github.com/canonical-websites/snapcraft.io/blob/master/webapp/publisher/snaps/views.py
rev = "67";
deps = [
alsa-lib
at-spi2-atk
at-spi2-core
atk
cairo
cups
curlWithGnuTls
dbus
expat
ffmpeg_4 # Requires libavcodec < 59 as of 1.2.9.743.g85d9593d
fontconfig
freetype
gdk-pixbuf
glib
gtk3
harfbuzz
libdrm
libgcrypt
libnotify
libpng
libpulseaudio
libxkbcommon
mesa
nss_latest
pango
stdenv.cc.cc
systemd
xorg.libICE
xorg.libSM
xorg.libX11
xorg.libxcb
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXScrnSaver
xorg.libxshmfence
xorg.libXtst
zlib
curl
];
in
stdenv.mkDerivation {
pname = "spotify";
inherit version;
# fetch from snapcraft instead of the debian repository most repos fetch from.
# That is a bit more cumbersome. But the debian repository only keeps the last
# two versions, while snapcraft should provide versions indefinitely:
# https://forum.snapcraft.io/t/how-can-a-developer-remove-her-his-app-from-snap-store/512
# This is the next-best thing, since we're not allowed to re-distribute
# spotify ourselves:
# https://community.spotify.com/t5/Desktop-Linux/Redistribute-Spotify-on-Linux-Distributions/td-p/1695334
src = fetchurl {
url = "https://api.snapcraft.io/api/v1/snaps/download/pOBIoZ2LrCB3rDohMxoYGnbN14EHOgD7_${rev}.snap";
sha512 = "3d5a9fda88a076a22bb6d0b6b586334865f03a4e852ca8e022468e3dd3520a81dea314721e26e54ba9309603e08f66588f005ee8970e73eccbf805ff70e89dca";
};
nativeBuildInputs = [wrapGAppsHook makeShellWrapper squashfsTools];
dontStrip = true;
dontPatchELF = true;
unpackPhase = ''
runHook preUnpack
unsquashfs "$src" '/usr/share/spotify' '/usr/bin/spotify' '/meta/snap.yaml'
cd squashfs-root
if ! grep -q 'grade: stable' meta/snap.yaml; then
# Unfortunately this check is not reliable: At the moment (2018-07-26) the
# latest version in the "edge" channel is also marked as stable.
echo "The snap package is marked as unstable:"
grep 'grade: ' meta/snap.yaml
echo "You probably chose the wrong revision."
exit 1
fi
if ! grep -q '${version}' meta/snap.yaml; then
echo "Package version differs from version found in snap metadata:"
grep 'version: ' meta/snap.yaml
echo "While the nix package specifies: ${version}."
echo "You probably chose the wrong revision or forgot to update the nix version."
exit 1
fi
runHook postUnpack
'';
# Prevent double wrapping
dontWrapGApps = true;
installPhase = ''
runHook preInstall
libdir=$out/lib/spotify
mkdir -p $libdir
mv ./usr/* $out/
cp meta/snap.yaml $out
# Work around Spotify referring to a specific minor version of
# OpenSSL.
ln -s ${lib.getLib openssl}/lib/libssl.so $libdir/libssl.so.1.0.0
ln -s ${lib.getLib openssl}/lib/libcrypto.so $libdir/libcrypto.so.1.0.0
ln -s ${nspr.out}/lib/libnspr4.so $libdir/libnspr4.so
ln -s ${nspr.out}/lib/libplc4.so $libdir/libplc4.so
ln -s ${ffmpeg_4.lib}/lib/libavcodec.so* $libdir
ln -s ${ffmpeg_4.lib}/lib/libavformat.so* $libdir
rpath="$out/share/spotify:$libdir"
patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $rpath $out/share/spotify/spotify
librarypath="${lib.makeLibraryPath deps}:$libdir"
wrapProgramShell $out/share/spotify/spotify \
''${gappsWrapperArgs[@]} \
${lib.optionalString (deviceScaleFactor != null) ''
--add-flags "--force-device-scale-factor=${toString deviceScaleFactor}" \
''} \
--prefix LD_LIBRARY_PATH : "$librarypath" \
--prefix PATH : "${gnome.zenity}/bin" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
# fix Icon line in the desktop file (#48062)
sed -i "s:^Icon=.*:Icon=spotify-client:" "$out/share/spotify/spotify.desktop"
# Desktop file
mkdir -p "$out/share/applications/"
cp "$out/share/spotify/spotify.desktop" "$out/share/applications/"
# Icons
for i in 16 22 24 32 48 64 128 256 512; do
ixi="$i"x"$i"
mkdir -p "$out/share/icons/hicolor/$ixi/apps"
ln -s "$out/share/spotify/icons/spotify-linux-$i.png" \
"$out/share/icons/hicolor/$ixi/apps/spotify-client.png"
done
runHook postInstall
'';
meta = {
homepage = "https://www.spotify.com/";
description = "Play music from the Spotify music service";
sourceProvenance = with lib.sourceTypes; [binaryNativeCode];
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [eelco ftrvxmtrx sheenobu mudri timokau ma27];
platforms = ["x86_64-linux"];
};
}

View file

@ -0,0 +1,25 @@
{
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.5 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;
}