This commit is contained in:
2026-05-21 20:37:54 +09:00
parent 8efe0b9341
commit df41182acd
20 changed files with 152 additions and 57 deletions
+5 -1
View File
@@ -1,8 +1,12 @@
{ pkgs, ... }:
let
misskey-scripts = pkgs.callPackage ./misskey.nix {};
feh-wallpaper = pkgs.callPackage ./feh-wallpaper.nix {};
in
pkgs.symlinkJoin {
name = "my-scripts";
paths = [misskey-scripts];
paths = [
misskey-scripts
feh-wallpaper
];
}
+19
View File
@@ -0,0 +1,19 @@
{ pkgs, ... }:
let
feh-wallpaper-getRandom = pkgs.writeShellApplication {
name = "feh-wallpaper-getRandom";
runtimeInputs = with pkgs; [
feh
];
text = ''
bgs=$MY_RICING_ASSETS_PATH/usr/local/share/wallpapers
feh --bg-fill --randomize "$bgs"/*
'';
};
in
pkgs.symlinkJoin {
name = "feh-wallpaper";
paths = [
feh-wallpaper-getRandom
];
}
+11 -12
View File
@@ -7,25 +7,24 @@ let
jq
];
text = ''
if [ ! -e /tmp//misskey-scripts/getLatestN1.fifo ]; then
if [ ! -e /tmp//misskey-scripts/getLatestN.fifo ]; then
mkdir -p /tmp/misskey-scripts
mkfifo /tmp/misskey-scripts/getLatestN1.fifo
fi
if [ ! -e /tmp//misskey-scripts/getLatestN2.fifo ]; then
mkdir -p /tmp/misskey-scripts
mkfifo /tmp/misskey-scripts/getLatestN2.fifo
mkfifo /tmp/misskey-scripts/getLatestN.fifo
fi
pipeLocation1=/tmp/misskey-scripts/getLatestN1.fifo
pipeLocation2=/tmp/misskey-scripts/getLatestN2.fifo
limitNum=$1
delim=$2
pipeLocation=/tmp/misskey-scripts/getLatestN.fifo
queryText='.[].text + '
queryText+='"'
queryText+="$delim"
queryText+='"'
curl https://misskey.io/api/notes -s --request POST --header 'Content-Type: application/json' --data "{\"local\": true, \"reply\": false, \"renote\": false, \"withFiles\": false, \"poll\": false, \"limit\": $1}" > "$pipeLocation1" &
jq -M -r '.[].text' < $pipeLocation1 > $pipeLocation2 &
jq -M -r "$queryText" <(curl https://misskey.io/api/notes -s --request POST --header 'Content-Type: application/json' --data "{\"local\": true, \"reply\": false, \"renote\": false, \"withFiles\": false, \"poll\": false, \"limit\": $limitNum}") > $pipeLocation &
while read -r line; do
echo "$line"
done < $pipeLocation2
done < $pipeLocation
wait
'';
};