clearing js BLOAT using bash
This commit is contained in:
parent
7ebb38820b
commit
53fe971b12
@ -18,7 +18,12 @@
|
|||||||
, hosts
|
, hosts
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let system = "x86_64-linux"; in
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
my-overlay = self: super: {
|
||||||
|
scripts = (super.buildEnv { name = "scripts"; paths = [ ./scripts ]; });
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
laptop = nixpkgs.lib.nixosSystem {
|
laptop = nixpkgs.lib.nixosSystem {
|
||||||
@ -31,12 +36,12 @@
|
|||||||
};
|
};
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
ivand = home-manager.lib.homeManagerConfiguration {
|
ivand = home-manager.lib.homeManagerConfiguration {
|
||||||
extraSpecialArgs = { rootPath = ./.; };
|
|
||||||
modules = [
|
modules = [
|
||||||
./home/laptop
|
./home/laptop
|
||||||
];
|
];
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
overlays = [ my-overlay ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -31,12 +31,10 @@
|
|||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
bingwp = {
|
bingwp = {
|
||||||
Unit = {
|
|
||||||
Type = "oneshot";
|
|
||||||
};
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = [ "PATH=${pkgs.nodejs_20}/bin" ];
|
Type = "oneshot";
|
||||||
ExecStart = [ "${pkgs.bash}/bin/bash -c '${pkgs.bun}/bin/bunx bingwp'" ];
|
Environment = [ "PATH=${pkgs.curl}/bin:${pkgs.wget}/bin:${pkgs.xdg-user-dirs}/bin:${pkgs.jq}/bin:${pkgs.busybox}/bin:${pkgs.bash}/bin" ];
|
||||||
|
ExecStart = [ "${pkgs.scripts}/bin/bingwp" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{ pkgs, rootPath, ... }: {
|
{ pkgs, ... }: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
#scripts
|
scripts
|
||||||
(pkgs.buildEnv { name = "my-scripts"; paths = [ (rootPath + /scripts) ]; })
|
|
||||||
# wayland/sway stuff
|
# wayland/sway stuff
|
||||||
bemenu
|
bemenu
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
|
12
scripts/bin/bingwp
Executable file
12
scripts/bin/bingwp
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
img_url=$(curl "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US" | jq ".images[0].url" | sed "s/\"//g" | awk '{printf "https://bing.com%s", $1 }')
|
||||||
|
pic_dir="$(xdg-user-dir "PICTURES")"
|
||||||
|
img_file="$pic_dir/bg.png"
|
||||||
|
backup_dir="$pic_dir/oldbg"
|
||||||
|
mkdir -p "$backup_dir"
|
||||||
|
mkdir -p "$pic_dir"
|
||||||
|
mv "$img_file" "$backup_dir/$(date +%Y-%m-%d).png"
|
||||||
|
|
||||||
|
wget -O "$img_file" "$img_url"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user