This commit is contained in:
2025-11-19 22:01:25 +02:00
parent afef35b6f6
commit 3a7686713f
16 changed files with 276 additions and 212 deletions

View File

@@ -1,11 +1,10 @@
![](etc/rice_new.png)
![](etc/rice_gentoo.png)
# Keybind reference
| Keybind | What it does |
|-----------|----------------------|
| --------- | -------------------- |
| `SUPER+Q` | Terminal |
| `SUPER+C` | Close current window |
| `SUPER+E` | File Manager |
@@ -17,50 +16,50 @@
| `SUPER+F` | Fullscreen |
| Keybind | What it does |
|--------------------|--------------------|
| ------------------ | ------------------ |
| `SUPER+RightArrow` | Move Focus (right) |
| `SUPER+LeftArrow` | Move Focus (left) |
| `SUPER+DownArrow` | Move Focus (down) |
| `SUPER+UpArrow` | Move Focus (up) |
| Keybind | What it does |
|--------------------------|----------------------|
| `SUPER+SHIFT+RightArrow` | Window width +100 |
| `SUPER+SHIFT+LeftArrow` | Window width -100 |
| `SUPER+SHIFT+DownArrow` | Window height +100 |
| `SUPER+SHIFT+UpArrow` | Window height -100 |
| Keybind | What it does |
| ------------------------ | ------------------ |
| `SUPER+SHIFT+RightArrow` | Window width +100 |
| `SUPER+SHIFT+LeftArrow` | Window width -100 |
| `SUPER+SHIFT+DownArrow` | Window height +100 |
| `SUPER+SHIFT+UpArrow` | Window height -100 |
| Keybind | What it does |
|-------------------------|-------------------------|
| ----------------------- | ----------------------- |
| `SUPER+CTRL+RightArrow` | Swap window pos (right) |
| `SUPER+CTRL+LeftArrow` | Swap window pos (left) |
| `SUPER+CTRL+UpArrow` | Swap window pos (down) |
| `SUPER+CTRL+DownArrow` | Swap window pos (up) |
| Mouse Keybind | What it does |
|--------------------|----------------|
| ------------------ | -------------- |
| `SUPER+MouseLeft` | Move window |
| `SUPER+MouseRight` | Resize window |
| `SUPER+ScrollUp` | Next workspace |
| `SUPER+ScrollDown` | Prev workspace |
| Keybind | What it does |
|---------------------|------------------------------------------|
| ------------------- | ---------------------------------------- |
| `SUPER+[0-9]` | Switch to workspace X |
| `SUPER+SHIFT+[0-9]` | Move active window to workspace X |
| `SUPER+Z` | Special workspace |
| `SUPER+SHIFT+Z` | Move current window to special Workspace |
| Keybind | What it does |
|-----------------|------------------------------------------|
| `SUPER+SHIFT+B` | Reload Waybar |
| `CTRL+ALT+DEL` | WLogout |
| `FN+F5` | Prev music track |
| `FN+F6` | Next music track |
| `FN+F7` | Play/Pause music |
| Keybind | What it does |
| --------------- | ---------------- |
| `SUPER+SHIFT+B` | Reload Waybar |
| `CTRL+ALT+DEL` | WLogout |
| `FN+F5` | Prev music track |
| `FN+F6` | Next music track |
| `FN+F7` | Play/Pause music |
| Keybind | What it does |
|---------------------|------------------------------------------------------------------------------------------------------------------|
| ------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `SUPER+SHIFT+ENTER` | Change wallpaper |
| `SUPER+F1` | Hide waybar |
| `SUPER+F2` | [Roblox](https://roblox.com) [Roblox](https://sober.vinegarhq.org) [Roblox](https://github.com/ocbwoy3/tuxstrap) |

View File

@@ -1,10 +1,10 @@
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
"source": "~/.config/fastfetch/ralsei.png"
"source": "~/.config/fastfetch/ralsei.png",
},
"display": {
"color": "magenta"
"color": "magenta",
},
"modules": [
"break",
@@ -12,7 +12,7 @@
{
"type": "title",
"keyColor": "blue",
"format": "{user-name-colored}{at-symbol-colored}{host-name-colored}"
"format": "{user-name-colored}{at-symbol-colored}{host-name-colored}",
},
"break",
@@ -20,11 +20,11 @@
{
"type": "os",
"key": "OS",
"format": "{pretty-name}"
"format": "{pretty-name}",
},
{
"type": "kernel",
"format": "Linux 6.17.0-2-cachyos-ralsei-rt-bore-lto"
"format": "Linux 6.17.0-2-cachyos-ralsei-rt-bore-lto",
},
// "packages",
@@ -38,12 +38,12 @@
{
"type": "cpu",
"format": "{cores-logical}x {name} @ {freq-base} {temperature}",
"temp": true
"temp": true,
},
{
"type": "gpu",
"format": "{name} [{type}] {temperature}",
"temp": true
"temp": true,
},
"break",
@@ -56,12 +56,12 @@
{
"type": "wm",
"key": "WM",
"format": "{pretty-name}"
"format": "{pretty-name}",
},
{
"type": "shell",
"key": "Shell",
"format": "{pretty-name}"
"format": "{pretty-name}",
},
"terminal",
"locale",
@@ -82,19 +82,19 @@
{
"type": "media",
"key": "Song",
"format": "{artist} — {title}"
"format": "{artist} — {title}",
},
{
"type": "media",
"key": "Album",
"format": "{album}"
"format": "{album}",
},
"break",
{
"type": "colors",
"symbol": "circle"
}
]
"symbol": "circle",
},
],
}

View File

@@ -15,7 +15,14 @@
},
"mpris": {
"players": ["chromium", "cmus", "elisa", "cider", "spotify", "OCbwoy3_s_iPhone"],
"players": [
"chromium",
"cmus",
"elisa",
"cider",
"spotify",
"OCbwoy3_s_iPhone"
],
"interval": 1,
"on-scroll-up": "playerctl -p chromium,cmus,elisa,cider,spotify,OCbwoy3_s_iPhone volume 0.05+",
"on-scroll-down": "playerctl -p chromium,cmus,elisa,cider,spotify,OCbwoy3_s_iPhone volume 0.05-",

View File

@@ -1,5 +1,5 @@
* {
font-family: 'SF Pro Display', SFProJPDisplay-Regular, 'Symbols Nerd Font';
font-family: "SF Pro Display", SFProJPDisplay-Regular, "Symbols Nerd Font";
border: none;
font-size: 15px;
min-height: 10px;
@@ -15,28 +15,44 @@ window#waybar {
padding: 3px 5px 3px 5px;
}
#workspaces, #mpris, #traygroup, #clock, #window, #custom-regretevator_state, #custom-cider {
#workspaces,
#mpris,
#traygroup,
#clock,
#window,
#custom-regretevator_state,
#custom-cider {
border-radius: 8px;
padding: 2px 5px 2px 5px;
border: 2px solid #89b4fa;
}
#clock {
font-family: "SF Pro Display", SFProJPDisplay-Regular, 'Symbols Nerd Font';
font-family: "SF Pro Display", SFProJPDisplay-Regular, "Symbols Nerd Font";
}
#traygroup, #mpris, #window, #workspaces, #custom-regretevator_state, #custom-cider {
#traygroup,
#mpris,
#window,
#workspaces,
#custom-regretevator_state,
#custom-cider {
background-color: #1e1e2e;
padding-left: 5px;
padding-right: 5px;
color: #b4befe;
}
#custom-regretevator_state, #custom-cider {
font-family: 'DotfilesFont', SFProJPDisplay-Regular, 'Symbols Nerd Font', 'Geist';
#custom-regretevator_state,
#custom-cider {
font-family:
"DotfilesFont", SFProJPDisplay-Regular, "Symbols Nerd Font", "Geist";
}
#mpris, #clock, #window, #custom-cider {
#mpris,
#clock,
#window,
#custom-cider {
padding-left: 10px;
padding-right: 10px;
}
@@ -89,7 +105,9 @@ window#waybar {
background-color: transparent;
}
#network, #bluetooth, #pulseaudio {
#network,
#bluetooth,
#pulseaudio {
padding: 0px 5px 0px 5px;
margin: 0px 0px 0px 0px;
}
@@ -103,10 +121,11 @@ window#waybar {
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
-gtk-icon-effect: highlight;
}
.invisible, #mpris.stopped {
.invisible,
#mpris.stopped {
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
background-color: transparent;
@@ -114,7 +133,7 @@ window#waybar {
}
tooltip {
font-family: 'SF Pro Display', SFProJPDisplay-Regular, 'Symbols Nerd Font';
font-family: "SF Pro Display", SFProJPDisplay-Regular, "Symbols Nerd Font";
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
border-radius: 4px;
@@ -125,7 +144,7 @@ tooltip {
}
tooltip * {
font-family: 'SF Pro Display', SFProJPDisplay-Regular, 'Symbols Nerd Font';
font-family: "SF Pro Display", SFProJPDisplay-Regular, "Symbols Nerd Font";
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
color: #cdd6f4;

View File

@@ -1,7 +1,7 @@
* {
background-image: none;
box-shadow: none;
font-family: 'SF Pro Display', 'Symbols Nerd Font';
font-family: "SF Pro Display", "Symbols Nerd Font";
font-size: 18px;
}
@@ -35,21 +35,15 @@ button:hover {
}
#lock {
background-image: image(
url("~/config/config/wlogout/assets/lock.png")
);
background-image: image(url("~/config/config/wlogout/assets/lock.png"));
}
#logout {
background-image: image(
url("~/config/config/wlogout/assets/logout.png")
);
background-image: image(url("~/config/config/wlogout/assets/logout.png"));
}
#suspend {
background-image: image(
url("~/config/config/wlogout/assets/suspend.png")
);
background-image: image(url("~/config/config/wlogout/assets/suspend.png"));
}
#hibernate {
@@ -59,13 +53,9 @@ button:hover {
}
#shutdown {
background-image: image(
url("~/config/config/wlogout/assets/shutdown.png")
);
background-image: image(url("~/config/config/wlogout/assets/shutdown.png"));
}
#reboot {
background-image: image(
url("~/config/config/wlogout/assets/reboot.png")
);
background-image: image(url("~/config/config/wlogout/assets/reboot.png"));
}

View File

@@ -1,21 +1,21 @@
{
"name": "ocbwoy3s-dotfiles",
"module": "index.ts",
"type": "module",
"private": true,
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"@ocbwoy3/libocbwoy3": "^0.0.5",
"@types/commander": "^2.12.5",
"@types/dotenv": "^8.2.3",
"@types/sharp": "^0.32.0",
"commander": "^13.1.0",
"dotenv": "^16.4.7",
"sharp": "^0.33.5"
}
"name": "ocbwoy3s-dotfiles",
"module": "index.ts",
"type": "module",
"private": true,
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"@ocbwoy3/libocbwoy3": "^0.0.5",
"@types/commander": "^2.12.5",
"@types/dotenv": "^8.2.3",
"@types/sharp": "^0.32.0",
"commander": "^13.1.0",
"dotenv": "^16.4.7",
"sharp": "^0.33.5"
}
}

View File

@@ -1,49 +1,71 @@
import { $, sleep } from "bun";
import { albumStuffF, fetchAlbumStuff } from "../lib/CiderV2Playing"
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 { }
x = (await fetchAlbumStuff()) as albumStuffF;
} catch {}
function notifyWithImage(song: string, artUrl: string, artist: string, album: string) {
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,
"-t",
process.argv[3] === "rel" ? "1" : "2000",
"-r",
"67676767",
"-a",
"ocbwoy3-whatsplaying",
"-I",
artUrl,
song,
`${artist}<br/>`//${album !== "" ? `<small>${album}</small>` : ""}`
`${artist}<br/>`, //${album !== "" ? `<small>${album}</small>` : ""}`
]);
}
console.log(process.argv[3])
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",
"-t",
process.argv[3] === "rel" ? "1" : "2000",
"-r",
"67676767",
"-a",
"ocbwoy3-whatsplaying",
song,
`${artist}`//<br/>${album !== "" ? `<small>${album}</small>` : ""}`
`${artist}`, //<br/>${album !== "" ? `<small>${album}</small>` : ""}`
]);
}
if (process.argv[2] === "waybar") {
if (!x) {
process.stdout.write(JSON.stringify({
class: "hidden"
}))
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("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;"),
text: `${y.artist}${y.song}`.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;"),
tooltip: `${y.album}`.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;")
}))
process.stdout.write(
JSON.stringify({
// text: ` ${y.artist} — ${y.song}`.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;"),
text: `${y.artist}${y.song}`
.replaceAll("&", "&amp;")
.replaceAll("<", "&lt;")
.replaceAll(">", "&gt;"),
tooltip: `${y.album}`
.replaceAll("&", "&amp;")
.replaceAll("<", "&lt;")
.replaceAll(">", "&gt;"),
}),
);
}
if (process.argv[2] === "notif") {
@@ -55,6 +77,8 @@ if (process.argv[2] === "notif") {
notifyWithImage(y.song, y.artUrl, y.artist, y.album);
} catch {
notifyBasic(y.song, y.artist, y.album);
try { rmSync(y.artUrl); } catch { }
try {
rmSync(y.artUrl);
} catch {}
}
}

View File

@@ -5,7 +5,7 @@ import { execSync } from "child_process";
const birthday = new Date(2009, 7, 16);
const age = Math.floor(
(Date.now() - birthday.getTime()) / (1000 * 60 * 60 * 24 * 365)
(Date.now() - birthday.getTime()) / (1000 * 60 * 60 * 24 * 365),
);
const isBirthday =
@@ -37,14 +37,11 @@ function chooseRandom(array: string[]): string {
return array[index];
}
const splashes = [
"大好き<b>ラルセイ</b>",
"ハイパーランド"
];
const splashes = ["大好き<b>ラルセイ</b>", "ハイパーランド"];
const debug: boolean = true as false | true;
const welcome = "ハイパーランド へようこそ!" // "Sveicināti Hyprland!"
const welcome = "ハイパーランド へようこそ!"; // "Sveicināti Hyprland!"
if (debug === true) {
splashes.forEach(async (a) => {

View File

@@ -48,24 +48,29 @@ import { getRegretevatorState } from "../lib/RegretevatorUtil";
*/
const windowClassFriendyName: {[windowClass: string]: string} = {
"steam_app_1671210": "Deltarune",
const windowClassFriendyName: { [windowClass: string]: string } = {
steam_app_1671210: "Deltarune",
"org.vinegarhq.Sober": "Roblox",
"steam_app_1690940": "Deltarune", // demo
}
steam_app_1690940: "Deltarune", // demo
};
async function getWMClass(): Promise<string> {
const windowClass = await $`hyprctl activewindow -j`.json();
return windowClass.initialClass
return windowClass.initialClass;
}
async function getFilename(wmClass?: string): Promise<string> {
const _d = new Date();
let ic = (wmClass && windowClassFriendyName[wmClass]) || wmClass || "Hyprland";
let ic =
(wmClass && windowClassFriendyName[wmClass]) || wmClass || "Hyprland";
const isRoblox = wmClass === "org.vinegarhq.Sober";
if (isRoblox) {ic = "Roblox"; };
if (isRoblox) {
ic = "Roblox";
}
const regretevatorState = isRoblox ? getRegretevatorState() : null;
if (!!regretevatorState) {ic = "Regretevator";};
if (!!regretevatorState) {
ic = "Regretevator";
}
// console.log(isRoblox, regretevatorState)
return `${ic}-${_d.getTime()}${
!regretevatorState
@@ -74,7 +79,7 @@ async function getFilename(wmClass?: string): Promise<string> {
regretevatorState.state === "INGAME"
? `-${regretevatorState.floor}`
: ""
}`
}`
}`;
}
@@ -115,7 +120,7 @@ async function transformImage(b: Buffer): Promise<Buffer> {
return (await maskedImage.png().toBuffer()) as Buffer;
*/
return b
return b;
}
(() => {

View File

@@ -5,23 +5,31 @@ import { existsSync, readFileSync, writeFileSync } from "fs";
setConsoleTitle("Music Test");
try {
const artUrl = await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata mpris:artUrl`.text();
const title = await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata title`.text();
const artist = await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata artist`.text();
const album = await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata album`.text();
const artUrl =
await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata mpris:artUrl`.text();
const title =
await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata title`.text();
const artist =
await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata artist`.text();
const album =
await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata album`.text();
const MT = `${artist.trim()},${album.trim()}`;
if (!existsSync("/tmp/.musictest-info") || readFileSync("/tmp/.musictest-info").toString("utf-8") !== MT) {
writeFileSync("/tmp/.musictest-info",MT)
if (
!existsSync("/tmp/.musictest-info") ||
readFileSync("/tmp/.musictest-info").toString("utf-8") !== MT
) {
writeFileSync("/tmp/.musictest-info", MT);
const x = await fetch(artUrl.trim())
writeFileSync("/tmp/.musictest",await x.bytes())
const x = await fetch(artUrl.trim());
writeFileSync("/tmp/.musictest", await x.bytes());
}
$`notify-send ${title.trim()} ${artist.trim()} -i /tmp/.musictest`.nothrow().catch(a => { });
$`notify-send ${title.trim()} ${artist.trim()} -i /tmp/.musictest`
.nothrow()
.catch((a) => {});
} catch (e_) {
console.error(e_)
$`notify-send "music test" "lol"`.nothrow().catch(a => { });
console.error(e_);
$`notify-send "music test" "lol"`.nothrow().catch((a) => {});
}

View File

@@ -6,16 +6,16 @@ import { setConsoleTitle } from "@ocbwoy3/libocbwoy3";
setConsoleTitle("Roblox Studio patcher");
const SIGNATURE = Buffer.from([
0x48, 0x81, 0xEC, 0x40, 0x03, 0x00, 0x00, 0x84, 0xD2, 0x74, 0x05, 0xE8
0x48, 0x81, 0xec, 0x40, 0x03, 0x00, 0x00, 0x84, 0xd2, 0x74, 0x05, 0xe8,
]);
const PATCH = Buffer.from([
0x48, 0x81, 0xEC, 0x40, 0x03, 0x00, 0x00, 0x84, 0xD2, 0x90, 0x90, 0xE8
0x48, 0x81, 0xec, 0x40, 0x03, 0x00, 0x00, 0x84, 0xd2, 0x90, 0x90, 0xe8,
]);
const baseDir = path.join(
os.homedir(),
".var/app/org.vinegarhq.Vinegar/data/vinegar/versions"
".var/app/org.vinegarhq.Vinegar/data/vinegar/versions",
);
function findSignature(buffer: Buffer, signature: Buffer): number {
@@ -40,18 +40,25 @@ async function patchFile(folder: string) {
try {
binary = await fs.readFile(exePath);
} catch (err) {
console.error(`[ERROR] Could not read ${exePath}/RobloxStudioBeta.exe:`, err);
console.error(
`[ERROR] Could not read ${exePath}/RobloxStudioBeta.exe:`,
err,
);
return;
}
if (findSignature(binary, PATCH)) {
console.log(`[SKIP] ${folder}/RobloxStudioBeta.exe has already been patched`);
console.log(
`[SKIP] ${folder}/RobloxStudioBeta.exe has already been patched`,
);
return;
}
const offset = findSignature(binary, SIGNATURE);
if (offset === -1) {
console.error(`[FAIL] Signature not found in ${exePath}/RobloxStudioBeta.exe`);
console.error(
`[FAIL] Signature not found in ${exePath}/RobloxStudioBeta.exe`,
);
return;
}
@@ -85,7 +92,7 @@ async function main() {
const start = Date.now();
await Promise.all(folders.map(patchFile));
console.log(
`[DONE] Patched internal Roblox Studio in ${Date.now() - start}ms`
`[DONE] Patched internal Roblox Studio in ${Date.now() - start}ms`,
);
}

View File

@@ -11,18 +11,20 @@ setConsoleTitle("Screenshot Uploader");
try {
const start = Date.now();
$`notify-send -t 1000 "Screenshot" "Uploading.."`.nothrow().catch(a => { });
$`notify-send -t 1000 "Screenshot" "Uploading.."`
.nothrow()
.catch((a) => {});
configDotenv({
path: `${homedir()}/.ocbwoy3-dotfiles-SECRET-DO-NOT-TOUCH.env`
path: `${homedir()}/.ocbwoy3-dotfiles-SECRET-DO-NOT-TOUCH.env`,
});
const screenshotsDir = join(homedir(), "Pictures", "Screenshots");
const files = readdirSync(screenshotsDir);
let latestFile = files
.map(file => ({
.map((file) => ({
file,
time: statSync(join(screenshotsDir, file)).mtime.getTime()
time: statSync(join(screenshotsDir, file)).mtime.getTime(),
}))
.sort((a, b) => b.time - a.time)[0].file;
@@ -31,8 +33,9 @@ try {
const url = await UploadToEZ(readFileSync(filePath));
execSync(`echo "${url}" | wl-copy -n`);
execSync(`notify-send "Ekrānuzņēmums" "Attēls augšuplādēts e-z.host ${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_}`}"`);
}

View File

@@ -50,60 +50,61 @@ export type CiderNowPlaying = {
[key: string]: any;
};
// cachedAlbumArt = /tmp/.ocbwoy3-ciderv2lib-md5(isrc+albumName).jpg
export type albumStuffF = {
artist: string,
album: string,
song: string,
artUrl?: string
}
artist: string;
album: string;
song: string;
artUrl?: string;
};
export const albumRewriteRegexes: { a: RegExp, b: string | false }[] = [
export const albumRewriteRegexes: { a: RegExp; b: string | false }[] = [
{
a: / \(Original( (Video )?Game)? Soundtrack.*\)$/i,
b: ""
b: "",
},
{
a: / - Single$/i,
b: false
b: false,
},
{
a: / Soundtrack$/i,
b: ""
b: "",
},
{
a: /^(DELTARUNE|Deltarune) (chapter|chapters) /i,
b: "Deltarune $2 "
b: "Deltarune $2 ",
},
{
a: / - EP$/i,
b: ""
b: "",
},
{
a: /^regretevator$/i,
b: false
b: false,
},
]
];
export function doRewritesRn(t: string) {
let m = t;
for (const x of albumRewriteRegexes) {
if (x.a.test(m)) {
if (x.b === false) return "";
m = m.replace(x.a,x.b);
m = m.replace(x.a, x.b);
}
}
return m;
}
export async function fetchAlbumStuff(): Promise<albumStuffF> {
const d = await fetch("http://localhost:10767/api/v1/playback/now-playing?token=z");
const d = await fetch(
"http://localhost:10767/api/v1/playback/now-playing?token=z",
);
// console.log(d.status, d.statusText, await d.text())
const { info }: CiderNowPlaying = await d.json();
const special = MD5.hash(info.isrc + info.albumName, "hex");
const path = `/tmp/.ocbwoy3-ciderv2lib-md5-${special}.jpg`
const path = `/tmp/.ocbwoy3-ciderv2lib-md5-${special}.jpg`;
// console.log(existsSync(path), `hyprctl dispatch exec ${`wget -q --unlink -O ${path} ${info.artwork.url}`}`);
@@ -116,15 +117,15 @@ export async function fetchAlbumStuff(): Promise<albumStuffF> {
writeFileSync(path, data);
// writeFileSync(path,await ct.body?.pipeTo)
} catch {
rmSync(path)
rmSync(path);
}
}
return {
artist: info.artistName,
album: doRewritesRn(info.albumName),
song: info.name,
artUrl: existsSync(path) ? path : undefined
}
artUrl: existsSync(path) ? path : undefined,
};
}
// await fetchAlbumStuff();

View File

@@ -10,7 +10,9 @@ const API_URL = "https://api.e-z.host/files";
*/
export async function UploadToEZ(content: Buffer): Promise<string> {
if (!process.env.EZ_API_KEY) {
throw new Error(`Missing EZ_API_KEY, make sure you're loading the env from ${homedir()}/.ocbwoy3-dotfiles-SECRET-DO-NOT-TOUCH.env!`)
throw new Error(
`Missing EZ_API_KEY, make sure you're loading the env from ${homedir()}/.ocbwoy3-dotfiles-SECRET-DO-NOT-TOUCH.env!`,
);
}
if (!(content[0] === 0x89 && content[1] === 0x50 && content[2] === 0x4e)) {
@@ -21,7 +23,7 @@ export async function UploadToEZ(content: Buffer): Promise<string> {
form.append(
"file",
new Blob([content as any], { type: "image/png" }),
"screenshot.png"
"screenshot.png",
);
const res = await fetch(API_URL, {
@@ -34,7 +36,7 @@ export async function UploadToEZ(content: Buffer): Promise<string> {
if (!res.ok) {
throw new Error(
`Upload failed with status ${res.status}: ${await res.text()}`
`Upload failed with status ${res.status}: ${await res.text()}`,
);
}

View File

@@ -24,26 +24,28 @@ export type RegretevatorState = DeadUnknownState | InElevatorState;
export function getRegretevatorState(): null | RegretevatorState {
if (!existsSync(STATE_FILE_PATH)) return null;
try {
const {text, tooltip}: { text: string, tooltip: string } = JSON.parse(readFileSync(STATE_FILE_PATH).toString('utf-8'))
const { text, tooltip }: { text: string; tooltip: string } = JSON.parse(
readFileSync(STATE_FILE_PATH).toString("utf-8"),
);
if (/^On Floor ([0-9]+)$/.test(tooltip)) {
const floorNum = tooltip.match(/^On Floor ([0-9]+)$/)![1]
const floorNum = tooltip.match(/^On Floor ([0-9]+)$/)![1];
return {
floor: Number(floorNum),
state: "INGAME",
isGoingUp: false
}
isGoingUp: false,
};
}
if (/^Floor ([0-9]+)/.test(tooltip)) {
const floorNum = tooltip.match(/^Floor ([0-9]+)/)![1]
const floorNum = tooltip.match(/^Floor ([0-9]+)/)![1];
return {
floor: Number(floorNum),
state: "INGAME",
isGoingUp: true
}
isGoingUp: true,
};
}
return {
state: "UNKNOWN"
}
state: "UNKNOWN",
};
} catch {}
return null;
}

View File

@@ -1,27 +1,27 @@
{
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": false,
"noEmit": true,
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": false,
"noEmit": true,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}