reorganize and fix searxng

This commit is contained in:
2026-01-20 17:30:56 -06:00
parent 50d192c809
commit 42bf08084e
86 changed files with 2863 additions and 35 deletions

View File

@@ -0,0 +1,135 @@
{ config, lib, pkgs, inputs, ... }: let
system = "x86_64-linux";
pkgs-us = import inputs.nixpkgs-us {
inherit system;
config.allowUnfree = true;
};
in {
options = {
homeconfig.scripts.enable = lib.options.mkOption {
type = lib.types.bool;
default = true;
};
};
config = lib.mkMerge [
(lib.mkIf (config.homeconfig.hyprland.enable && config.homeconfig.scripts.enable) {
home.packages = [
(pkgs.writeShellScriptBin "hyprrun" ''
${pkgs-us.runapp}/bin/runapp ''$@
#uwsm app -- ''$@
'')
];
})
(lib.mkIf (!config.homeconfig.hyprland.enable && config.homeconfig.scripts.enable) {
home.packages = [
(pkgs.writeShellScriptBin "hyprrun" ''
eval "''$@"
'')
];
})
(lib.mkIf config.homeconfig.scripts.enable {
home.packages = [
#scripts
(pkgs.writeShellScriptBin "randWallpaper" ''
file=''$(ls ${config.home.homeDirectory}/Pictures/Wallpaper/ | shuf -n 1)
setWallpaper ${config.home.homeDirectory}/Pictures/Wallpaper/''$file
'')
(pkgs.writeShellScriptBin "setWallpaper" ''
if [[ ! -d /tmp/nathan ]]; then
mkdir /tmp/nathan
fi
img=''$(realpath "''${1:-$(find ~/Pictures/Wallpaper/* | rofi -dmenu)}")
n=''$(basename "''$img")
ext="''${n''\#''\#*.}"
out=''${3:-/dev/null}
if [[ ''$ext == "gif" || ''$ext == "mp4" ]]; then
yes | ${pkgs.ffmpeg}/bin/ffmpeg -i "''$img" -vframes 1 /tmp/nathan/tmp.jpg >> ''$out
cp /tmp/nathan/tmp.jpg /tmp/nathan/tmp2.jpg
pidof mpvpaper && pkill mpvpaper
${pkgs.swww}/bin/swww img /tmp/nathan/tmp.jpg -t wipe >> ''$out
${pkgs.hyprpanel}/bin/hyprpanel sw /tmp/nathan/tmp2.jpg >> ''$out
sleep 0.3
hyprctl dispatch exec "${pkgs.mpvpaper}/bin/mpvpaper ALL ''$img -o loop"
${pkgs.hyprpanel}/bin/hyprpanel sw /tmp/nathan/tmp.jpg >> ''$out
rm /tmp/nathan/tmp2.jpg
else
pidof mpvpaper && pkill mpvpaper
hyprctl dispatch exec "${pkgs.swww}/bin/swww img ''$img -t wipe" >> ''$out
${pkgs.hyprpanel}/bin/hyprpanel sw "''$img" >> ''$out
fi
changeColors "''$img" "''$2" >> ''$out
'')
(pkgs.writeShellScriptBin "changeColors" ''
img=''$(realpath "''$1")
alpha=''${2:-70}
if [[ ''$alpha -lt 0 ]]; then
alpha=0
elif [[ ''$alpha -gt 100 ]]; then
alpha=100
fi
if [[ -f ~/.config/wal/colorschemes/dark/''$(basename "''$img")-''$alpha.json ]]; then
${pkgs.pywal16}/bin/wal -n -f "''$(basename "''$img")-''$alpha"
else
${pkgs.pywal16}/bin/wal -n -i "''$img" -a "''$alpha" --cols16 -p "''$(basename "''$img")-''$alpha"
fi
colorPrefix
'')
(pkgs.writeShellScriptBin "colorPrefix" ''
pidof firefox > /dev/null && ${pkgs.pywalfox-native}/bin/pywalfox update &
pidof kitty > /dev/null && pkill -USR1 kitty
pidof cava > /dev/null && pkill -USR1 cava
for i in ''$(ls /run/user/1000 | grep nvim); do
${pkgs.neovim-remote}/bin/nvr -s --servername /run/user/1000/''$i --remote-send '<cmd>colorscheme pywal<CR>';
done
eval "''$@"
'')
(pkgs.writeShellScriptBin "onSystemStart" ''
if [[ ! -d /tmp/nathan ]]; then
mkdir /tmp/nathan
fi
if [[ -f ${config.home.homeDirectory}/.local/share/calcurse/.calcurse.pid ]]; then
rm ${config.home.homeDirectory}/.local/share/calcurse/.calcurse.pid
fi
hyprctl --batch "\
dispatch exec ${pkgs.swww}/bin/swww-daemon ;\
dispatch exec setWallpaper ${config.home.homeDirectory}/Pictures/Wallpaper/bluescape.jpg ;\
dispatch exec ${pkgs.pyprland}/bin/pypr ;\
dispatch exec ${pkgs.netbird-ui}/bin/netbird-ui ;\
dispatch exec ${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent ;\
setcursor Bibata-Modern-Classic 16"
sleep 3
hyprctl reload
hyprctl dispatch exec ${pkgs.pyprland}/bin/pypr toggle calendar
#tmux new-session -s hyprland
'')
];
})
];
}