idk anymore
This commit is contained in:
2
scripts/bin/.gitignore
vendored
Normal file
2
scripts/bin/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# compile it yourself
|
||||
ocbwoy3-actwithmus
|
||||
60
scripts/bin/actWithMusic.ts
Normal file
60
scripts/bin/actWithMusic.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import { $, sleep } from "bun";
|
||||
import { albumStuffF, fetchAlbumStuff } from "../lib/CiderV2Playing"
|
||||
import { execFile } from "child_process";
|
||||
import { rmSync } from "fs";
|
||||
|
||||
let x: albumStuffF | any = false;
|
||||
try {
|
||||
x = await fetchAlbumStuff() as albumStuffF
|
||||
} catch { }
|
||||
|
||||
function notifyWithImage(song: string, artUrl: string, artist: string, album: string) {
|
||||
execFile("dunstify", [
|
||||
"-t", (process.argv[3] === "rel" ? "1" : "2000"),
|
||||
"-r", "67676767",
|
||||
"-a", "ocbwoy3-whatsplaying",
|
||||
"-I", artUrl,
|
||||
song,
|
||||
`${artist}<br/>`//${album !== "" ? `<small>${album}</small>` : ""}`
|
||||
]);
|
||||
}
|
||||
|
||||
console.log(process.argv[3])
|
||||
|
||||
function notifyBasic(song: string, artist: string, album: string) {
|
||||
execFile("dunstify", [
|
||||
"-t", (process.argv[3] === "rel" ? "1" : "2000"),
|
||||
"-r", "67676767",
|
||||
"-a", "ocbwoy3-whatsplaying",
|
||||
song,
|
||||
`${artist}`//<br/>${album !== "" ? `<small>${album}</small>` : ""}`
|
||||
]);
|
||||
}
|
||||
|
||||
if (process.argv[2] === "waybar") {
|
||||
if (!x) {
|
||||
process.stdout.write(JSON.stringify({
|
||||
class: "hidden"
|
||||
}))
|
||||
process.exit(0);
|
||||
}
|
||||
const y = x as albumStuffF;
|
||||
process.stdout.write(JSON.stringify({
|
||||
// text: ` ${y.artist} — ${y.song}`.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">"),
|
||||
text: ` ${y.artist} — ${y.song}`.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">"),
|
||||
tooltip: `${y.album}`.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">")
|
||||
}))
|
||||
}
|
||||
|
||||
if (process.argv[2] === "notif") {
|
||||
const y = x as albumStuffF;
|
||||
if (!x || !y.artUrl) process.exit(1);
|
||||
|
||||
try {
|
||||
console.log(y.song, y.artUrl, y.artist, y.album);
|
||||
notifyWithImage(y.song, y.artUrl, y.artist, y.album);
|
||||
} catch {
|
||||
notifyBasic(y.song, y.artist, y.album);
|
||||
try { rmSync(y.artUrl); } catch { }
|
||||
}
|
||||
}
|
||||
@@ -37,26 +37,21 @@ function chooseRandom(array: string[]): string {
|
||||
return array[index];
|
||||
}
|
||||
|
||||
const splashes = [
|
||||
|
||||
"Keep on ricing yo' Hyprland...",
|
||||
|
||||
"Contains infinite genders!",
|
||||
"You are valid!",
|
||||
|
||||
"Blogsy is so AWESOME!",
|
||||
"I love Blogsy!",
|
||||
"What’s yer favorite type o’ wood?",
|
||||
const splashes = [
|
||||
"大好き<b>ラルセイ</b>",
|
||||
"ハイパーランド"
|
||||
];
|
||||
|
||||
const debug: boolean = false as false | true;
|
||||
const debug: boolean = true as false | true;
|
||||
|
||||
const welcome = "ハイパーランド へようこそ!" // "Sveicināti Hyprland!"
|
||||
|
||||
if (debug === true) {
|
||||
splashes.forEach(async (a) => {
|
||||
execSync(`notify-send "Welcome to Hyprland!" "${a}"`);
|
||||
execSync(`notify-send "${welcome}" "${a}"`);
|
||||
});
|
||||
} else {
|
||||
const randomSplash = chooseRandom(splashes);
|
||||
|
||||
execSync(`notify-send "Welcome to Hyprland!" "${randomSplash}"`);
|
||||
execSync(`notify-send "${welcome}" "${randomSplash}"`);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ try {
|
||||
const url = await UploadToEZ(readFileSync(filePath));
|
||||
|
||||
execSync(`echo "${url}" | wl-copy -n`);
|
||||
execSync(`notify-send "Screenshot" "Uploaded to e-z.host in ${Date.now() - start}ms"`);
|
||||
execSync(`notify-send "Ekrānuzņēmums" "Attēls augšuplādēts e-z.host ${Date.now() - start}ms"`);
|
||||
} catch (e_) {
|
||||
execSync(`notify-send "Error" "${`${e_}`}"`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user