chaotic nyxos

This commit is contained in:
2025-08-28 18:46:55 +03:00
parent 6b32ee3a80
commit 9a412a65c3
12 changed files with 23 additions and 10 deletions

View File

@@ -48,10 +48,15 @@ import { getRegretevatorState } from "../lib/RegretevatorUtil";
*/
const windowcClassFriendyName: {[windowClass: string]: string} = {
"org.vinegarhq.Sober": "Roblox",
"steam_app_1690940": "Deltarune"
}
async function getFilename(): Promise<string> {
const _d = new Date();
const windowClass = await $`hyprctl activewindow -j`.json();
let ic = windowClass.initialClass || "Hyprland";
let ic = (windowClass.initialClass && windowcClassFriendyName[windowClass.initialClass]) || windowClass.windowClass || "Hyprland";
const isRoblox = windowClass.initialClass === "org.vinegarhq.Sober";
if (isRoblox) {ic = "Roblox"; };
const regretevatorState = isRoblox ? getRegretevatorState() : null;
@@ -123,7 +128,7 @@ async function transformImage(b: Buffer): Promise<Buffer> {
console.log("/tmp/woah");
process.exit(0);
}
const _BUF = await $`grim -t png -l 0 -g ${selection.stdout
const _BUF = await $`grim -c -t png -l 0 -g ${selection.stdout
.toString()
.trim()} -`.arrayBuffer();
let BUF = Buffer.from(_BUF) as Buffer;
@@ -147,7 +152,7 @@ async function transformImage(b: Buffer): Promise<Buffer> {
.text();
const _BUF =
await $`grim -t png -l 0 -o ${selection.trim()} -`.arrayBuffer();
await $`grim -c -t png -l 0 -o ${selection.trim()} -`.arrayBuffer();
let BUF = Buffer.from(_BUF) as Buffer;
const FILENAME = `${SCREENSHOT_PATH}/${await getFilename()}.png`;