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_new.png)
![](etc/rice_gentoo.png) ![](etc/rice_gentoo.png)
# Keybind reference # Keybind reference
| Keybind | What it does | | Keybind | What it does |
|-----------|----------------------| | --------- | -------------------- |
| `SUPER+Q` | Terminal | | `SUPER+Q` | Terminal |
| `SUPER+C` | Close current window | | `SUPER+C` | Close current window |
| `SUPER+E` | File Manager | | `SUPER+E` | File Manager |
@@ -17,50 +16,50 @@
| `SUPER+F` | Fullscreen | | `SUPER+F` | Fullscreen |
| Keybind | What it does | | Keybind | What it does |
|--------------------|--------------------| | ------------------ | ------------------ |
| `SUPER+RightArrow` | Move Focus (right) | | `SUPER+RightArrow` | Move Focus (right) |
| `SUPER+LeftArrow` | Move Focus (left) | | `SUPER+LeftArrow` | Move Focus (left) |
| `SUPER+DownArrow` | Move Focus (down) | | `SUPER+DownArrow` | Move Focus (down) |
| `SUPER+UpArrow` | Move Focus (up) | | `SUPER+UpArrow` | Move Focus (up) |
| Keybind | What it does | | Keybind | What it does |
|--------------------------|----------------------| | ------------------------ | ------------------ |
| `SUPER+SHIFT+RightArrow` | Window width +100 | | `SUPER+SHIFT+RightArrow` | Window width +100 |
| `SUPER+SHIFT+LeftArrow` | Window width -100 | | `SUPER+SHIFT+LeftArrow` | Window width -100 |
| `SUPER+SHIFT+DownArrow` | Window height +100 | | `SUPER+SHIFT+DownArrow` | Window height +100 |
| `SUPER+SHIFT+UpArrow` | Window height -100 | | `SUPER+SHIFT+UpArrow` | Window height -100 |
| Keybind | What it does | | Keybind | What it does |
|-------------------------|-------------------------| | ----------------------- | ----------------------- |
| `SUPER+CTRL+RightArrow` | Swap window pos (right) | | `SUPER+CTRL+RightArrow` | Swap window pos (right) |
| `SUPER+CTRL+LeftArrow` | Swap window pos (left) | | `SUPER+CTRL+LeftArrow` | Swap window pos (left) |
| `SUPER+CTRL+UpArrow` | Swap window pos (down) | | `SUPER+CTRL+UpArrow` | Swap window pos (down) |
| `SUPER+CTRL+DownArrow` | Swap window pos (up) | | `SUPER+CTRL+DownArrow` | Swap window pos (up) |
| Mouse Keybind | What it does | | Mouse Keybind | What it does |
|--------------------|----------------| | ------------------ | -------------- |
| `SUPER+MouseLeft` | Move window | | `SUPER+MouseLeft` | Move window |
| `SUPER+MouseRight` | Resize window | | `SUPER+MouseRight` | Resize window |
| `SUPER+ScrollUp` | Next workspace | | `SUPER+ScrollUp` | Next workspace |
| `SUPER+ScrollDown` | Prev workspace | | `SUPER+ScrollDown` | Prev workspace |
| Keybind | What it does | | Keybind | What it does |
|---------------------|------------------------------------------| | ------------------- | ---------------------------------------- |
| `SUPER+[0-9]` | Switch to workspace X | | `SUPER+[0-9]` | Switch to workspace X |
| `SUPER+SHIFT+[0-9]` | Move active window to workspace X | | `SUPER+SHIFT+[0-9]` | Move active window to workspace X |
| `SUPER+Z` | Special workspace | | `SUPER+Z` | Special workspace |
| `SUPER+SHIFT+Z` | Move current window to special Workspace | | `SUPER+SHIFT+Z` | Move current window to special Workspace |
| Keybind | What it does | | Keybind | What it does |
|-----------------|------------------------------------------| | --------------- | ---------------- |
| `SUPER+SHIFT+B` | Reload Waybar | | `SUPER+SHIFT+B` | Reload Waybar |
| `CTRL+ALT+DEL` | WLogout | | `CTRL+ALT+DEL` | WLogout |
| `FN+F5` | Prev music track | | `FN+F5` | Prev music track |
| `FN+F6` | Next music track | | `FN+F6` | Next music track |
| `FN+F7` | Play/Pause music | | `FN+F7` | Play/Pause music |
| Keybind | What it does | | Keybind | What it does |
|---------------------|------------------------------------------------------------------------------------------------------------------| | ------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `SUPER+SHIFT+ENTER` | Change wallpaper | | `SUPER+SHIFT+ENTER` | Change wallpaper |
| `SUPER+F1` | Hide waybar | | `SUPER+F1` | Hide waybar |
| `SUPER+F2` | [Roblox](https://roblox.com) [Roblox](https://sober.vinegarhq.org) [Roblox](https://github.com/ocbwoy3/tuxstrap) | | `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", "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": { "logo": {
"source": "~/.config/fastfetch/ralsei.png" "source": "~/.config/fastfetch/ralsei.png",
}, },
"display": { "display": {
"color": "magenta" "color": "magenta",
}, },
"modules": [ "modules": [
"break", "break",
@@ -12,56 +12,56 @@
{ {
"type": "title", "type": "title",
"keyColor": "blue", "keyColor": "blue",
"format": "{user-name-colored}{at-symbol-colored}{host-name-colored}" "format": "{user-name-colored}{at-symbol-colored}{host-name-colored}",
}, },
"break", "break",
{ {
"type": "os", "type": "os",
"key": "OS", "key": "OS",
"format": "{pretty-name}" "format": "{pretty-name}",
}, },
{ {
"type": "kernel", "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", // "packages",
"break", "break",
"host", "host",
"uptime", "uptime",
"break", "break",
{ {
"type": "cpu", "type": "cpu",
"format": "{cores-logical}x {name} @ {freq-base} {temperature}", "format": "{cores-logical}x {name} @ {freq-base} {temperature}",
"temp": true "temp": true,
}, },
{ {
"type": "gpu", "type": "gpu",
"format": "{name} [{type}] {temperature}", "format": "{name} [{type}] {temperature}",
"temp": true "temp": true,
}, },
"break", "break",
"memory", "memory",
"disk", "disk",
"break", "break",
{ {
"type": "wm", "type": "wm",
"key": "WM", "key": "WM",
"format": "{pretty-name}" "format": "{pretty-name}",
}, },
{ {
"type": "shell", "type": "shell",
"key": "Shell", "key": "Shell",
"format": "{pretty-name}" "format": "{pretty-name}",
}, },
"terminal", "terminal",
"locale", "locale",
@@ -82,19 +82,19 @@
{ {
"type": "media", "type": "media",
"key": "Song", "key": "Song",
"format": "{artist} — {title}" "format": "{artist} — {title}",
}, },
{ {
"type": "media", "type": "media",
"key": "Album", "key": "Album",
"format": "{album}" "format": "{album}",
}, },
"break", "break",
{ {
"type": "colors", "type": "colors",
"symbol": "circle" "symbol": "circle",
} },
] ],
} }

View File

@@ -15,7 +15,14 @@
}, },
"mpris": { "mpris": {
"players": ["chromium", "cmus", "elisa", "cider", "spotify", "OCbwoy3_s_iPhone"], "players": [
"chromium",
"cmus",
"elisa",
"cider",
"spotify",
"OCbwoy3_s_iPhone"
],
"interval": 1, "interval": 1,
"on-scroll-up": "playerctl -p chromium,cmus,elisa,cider,spotify,OCbwoy3_s_iPhone volume 0.05+", "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-", "on-scroll-down": "playerctl -p chromium,cmus,elisa,cider,spotify,OCbwoy3_s_iPhone volume 0.05-",
@@ -63,7 +70,7 @@
"PORTAL 2 - (OpenGL|Vulkan)": "Portal 2", "PORTAL 2 - (OpenGL|Vulkan)": "Portal 2",
"HALF-LIFE 2 - (OpenGL|Vulkan)": "Half-Life 2", "HALF-LIFE 2 - (OpenGL|Vulkan)": "Half-Life 2",
"(.*) - Google( Search| meklēšana)?": "$1", "(.*) - Google( Search| meklēšana)?": "$1",
"Cider": "Apple Music", "Cider": "Apple Music",
"swappy": "Swappy", "swappy": "Swappy",
"(.*) — (Firefox( Developer Edition)|Zen Browser)?": "$1" "(.*) — (Firefox( Developer Edition)|Zen Browser)?": "$1"

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

View File

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

View File

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

View File

@@ -1,49 +1,71 @@
import { $, sleep } from "bun"; import { $, sleep } from "bun";
import { albumStuffF, fetchAlbumStuff } from "../lib/CiderV2Playing" import { albumStuffF, fetchAlbumStuff } from "../lib/CiderV2Playing";
import { execFile } from "child_process"; import { execFile } from "child_process";
import { rmSync } from "fs"; import { rmSync } from "fs";
let x: albumStuffF | any = false; let x: albumStuffF | any = false;
try { try {
x = await fetchAlbumStuff() as albumStuffF x = (await fetchAlbumStuff()) as albumStuffF;
} catch { } } catch {}
function notifyWithImage(song: string, artUrl: string, artist: string, album: string) { function notifyWithImage(
song: string,
artUrl: string,
artist: string,
album: string,
) {
execFile("dunstify", [ execFile("dunstify", [
"-t", (process.argv[3] === "rel" ? "1" : "2000"), "-t",
"-r", "67676767", process.argv[3] === "rel" ? "1" : "2000",
"-a", "ocbwoy3-whatsplaying", "-r",
"-I", artUrl, "67676767",
"-a",
"ocbwoy3-whatsplaying",
"-I",
artUrl,
song, 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) { function notifyBasic(song: string, artist: string, album: string) {
execFile("dunstify", [ execFile("dunstify", [
"-t", (process.argv[3] === "rel" ? "1" : "2000"), "-t",
"-r", "67676767", process.argv[3] === "rel" ? "1" : "2000",
"-a", "ocbwoy3-whatsplaying", "-r",
"67676767",
"-a",
"ocbwoy3-whatsplaying",
song, song,
`${artist}`//<br/>${album !== "" ? `<small>${album}</small>` : ""}` `${artist}`, //<br/>${album !== "" ? `<small>${album}</small>` : ""}`
]); ]);
} }
if (process.argv[2] === "waybar") { if (process.argv[2] === "waybar") {
if (!x) { if (!x) {
process.stdout.write(JSON.stringify({ process.stdout.write(
class: "hidden" JSON.stringify({
})) class: "hidden",
}),
);
process.exit(0); process.exit(0);
} }
const y = x as albumStuffF; const y = x as albumStuffF;
process.stdout.write(JSON.stringify({ process.stdout.write(
// text: ` ${y.artist} — ${y.song}`.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;"), 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;") 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") { if (process.argv[2] === "notif") {
@@ -55,6 +77,8 @@ if (process.argv[2] === "notif") {
notifyWithImage(y.song, y.artUrl, y.artist, y.album); notifyWithImage(y.song, y.artUrl, y.artist, y.album);
} catch { } catch {
notifyBasic(y.song, y.artist, y.album); 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 birthday = new Date(2009, 7, 16);
const age = Math.floor( const age = Math.floor(
(Date.now() - birthday.getTime()) / (1000 * 60 * 60 * 24 * 365) (Date.now() - birthday.getTime()) / (1000 * 60 * 60 * 24 * 365),
); );
const isBirthday = const isBirthday =
@@ -37,14 +37,11 @@ function chooseRandom(array: string[]): string {
return array[index]; return array[index];
} }
const splashes = [ const splashes = ["大好き<b>ラルセイ</b>", "ハイパーランド"];
"大好き<b>ラルセイ</b>",
"ハイパーランド"
];
const debug: boolean = true as false | true; const debug: boolean = true as false | true;
const welcome = "ハイパーランド へようこそ!" // "Sveicināti Hyprland!" const welcome = "ハイパーランド へようこそ!"; // "Sveicināti Hyprland!"
if (debug === true) { if (debug === true) {
splashes.forEach(async (a) => { splashes.forEach(async (a) => {

View File

@@ -48,24 +48,29 @@ import { getRegretevatorState } from "../lib/RegretevatorUtil";
*/ */
const windowClassFriendyName: {[windowClass: string]: string} = { const windowClassFriendyName: { [windowClass: string]: string } = {
"steam_app_1671210": "Deltarune", steam_app_1671210: "Deltarune",
"org.vinegarhq.Sober": "Roblox", "org.vinegarhq.Sober": "Roblox",
"steam_app_1690940": "Deltarune", // demo steam_app_1690940: "Deltarune", // demo
} };
async function getWMClass(): Promise<string> { async function getWMClass(): Promise<string> {
const windowClass = await $`hyprctl activewindow -j`.json(); const windowClass = await $`hyprctl activewindow -j`.json();
return windowClass.initialClass return windowClass.initialClass;
} }
async function getFilename(wmClass?: string): Promise<string> { async function getFilename(wmClass?: string): Promise<string> {
const _d = new Date(); const _d = new Date();
let ic = (wmClass && windowClassFriendyName[wmClass]) || wmClass || "Hyprland"; let ic =
(wmClass && windowClassFriendyName[wmClass]) || wmClass || "Hyprland";
const isRoblox = wmClass === "org.vinegarhq.Sober"; const isRoblox = wmClass === "org.vinegarhq.Sober";
if (isRoblox) {ic = "Roblox"; }; if (isRoblox) {
ic = "Roblox";
}
const regretevatorState = isRoblox ? getRegretevatorState() : null; const regretevatorState = isRoblox ? getRegretevatorState() : null;
if (!!regretevatorState) {ic = "Regretevator";}; if (!!regretevatorState) {
ic = "Regretevator";
}
// console.log(isRoblox, regretevatorState) // console.log(isRoblox, regretevatorState)
return `${ic}-${_d.getTime()}${ return `${ic}-${_d.getTime()}${
!regretevatorState !regretevatorState
@@ -74,7 +79,7 @@ async function getFilename(wmClass?: string): Promise<string> {
regretevatorState.state === "INGAME" regretevatorState.state === "INGAME"
? `-${regretevatorState.floor}` ? `-${regretevatorState.floor}`
: "" : ""
}` }`
}`; }`;
} }
@@ -115,7 +120,7 @@ async function transformImage(b: Buffer): Promise<Buffer> {
return (await maskedImage.png().toBuffer()) as 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"); setConsoleTitle("Music Test");
try { try {
const artUrl = await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata mpris:artUrl`.text(); const artUrl =
const title = await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata title`.text(); await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata mpris:artUrl`.text();
const artist = await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata artist`.text(); const title =
const album = await $`playerctl -s -p cider,chromium,OCbwoy3_s_iPhone metadata album`.text(); 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()}`; const MT = `${artist.trim()},${album.trim()}`;
if (!existsSync("/tmp/.musictest-info") || readFileSync("/tmp/.musictest-info").toString("utf-8") !== MT) { if (
writeFileSync("/tmp/.musictest-info",MT) !existsSync("/tmp/.musictest-info") ||
readFileSync("/tmp/.musictest-info").toString("utf-8") !== MT
const x = await fetch(artUrl.trim()) ) {
writeFileSync("/tmp/.musictest",await x.bytes()) writeFileSync("/tmp/.musictest-info", MT);
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_) { } catch (e_) {
console.error(e_) console.error(e_);
$`notify-send "music test" "lol"`.nothrow().catch(a => { }); $`notify-send "music test" "lol"`.nothrow().catch((a) => {});
} }

View File

@@ -6,16 +6,16 @@ import { setConsoleTitle } from "@ocbwoy3/libocbwoy3";
setConsoleTitle("Roblox Studio patcher"); setConsoleTitle("Roblox Studio patcher");
const SIGNATURE = Buffer.from([ 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([ 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( const baseDir = path.join(
os.homedir(), 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 { function findSignature(buffer: Buffer, signature: Buffer): number {
@@ -40,18 +40,25 @@ async function patchFile(folder: string) {
try { try {
binary = await fs.readFile(exePath); binary = await fs.readFile(exePath);
} catch (err) { } catch (err) {
console.error(`[ERROR] Could not read ${exePath}/RobloxStudioBeta.exe:`, err); console.error(
`[ERROR] Could not read ${exePath}/RobloxStudioBeta.exe:`,
err,
);
return; return;
} }
if (findSignature(binary, PATCH)) { 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; return;
} }
const offset = findSignature(binary, SIGNATURE); const offset = findSignature(binary, SIGNATURE);
if (offset === -1) { if (offset === -1) {
console.error(`[FAIL] Signature not found in ${exePath}/RobloxStudioBeta.exe`); console.error(
`[FAIL] Signature not found in ${exePath}/RobloxStudioBeta.exe`,
);
return; return;
} }
@@ -85,7 +92,7 @@ async function main() {
const start = Date.now(); const start = Date.now();
await Promise.all(folders.map(patchFile)); await Promise.all(folders.map(patchFile));
console.log( 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 { try {
const start = Date.now(); const start = Date.now();
$`notify-send -t 1000 "Screenshot" "Uploading.."`.nothrow().catch(a => { }); $`notify-send -t 1000 "Screenshot" "Uploading.."`
.nothrow()
.catch((a) => {});
configDotenv({ 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 screenshotsDir = join(homedir(), "Pictures", "Screenshots");
const files = readdirSync(screenshotsDir); const files = readdirSync(screenshotsDir);
let latestFile = files let latestFile = files
.map(file => ({ .map((file) => ({
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; .sort((a, b) => b.time - a.time)[0].file;
@@ -31,8 +33,9 @@ try {
const url = await UploadToEZ(readFileSync(filePath)); const url = await UploadToEZ(readFileSync(filePath));
execSync(`echo "${url}" | wl-copy -n`); 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_) { } catch (e_) {
execSync(`notify-send "Error" "${`${e_}`}"`); execSync(`notify-send "Error" "${`${e_}`}"`);
} }

View File

@@ -50,60 +50,61 @@ export type CiderNowPlaying = {
[key: string]: any; [key: string]: any;
}; };
// cachedAlbumArt = /tmp/.ocbwoy3-ciderv2lib-md5(isrc+albumName).jpg // cachedAlbumArt = /tmp/.ocbwoy3-ciderv2lib-md5(isrc+albumName).jpg
export type albumStuffF = { export type albumStuffF = {
artist: string, artist: string;
album: string, album: string;
song: string, song: string;
artUrl?: 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, a: / \(Original( (Video )?Game)? Soundtrack.*\)$/i,
b: "" b: "",
}, },
{ {
a: / - Single$/i, a: / - Single$/i,
b: false b: false,
}, },
{ {
a: / Soundtrack$/i, a: / Soundtrack$/i,
b: "" b: "",
}, },
{ {
a: /^(DELTARUNE|Deltarune) (chapter|chapters) /i, a: /^(DELTARUNE|Deltarune) (chapter|chapters) /i,
b: "Deltarune $2 " b: "Deltarune $2 ",
}, },
{ {
a: / - EP$/i, a: / - EP$/i,
b: "" b: "",
}, },
{ {
a: /^regretevator$/i, a: /^regretevator$/i,
b: false b: false,
}, },
] ];
export function doRewritesRn(t: string) { export function doRewritesRn(t: string) {
let m = t; let m = t;
for (const x of albumRewriteRegexes) { for (const x of albumRewriteRegexes) {
if (x.a.test(m)) { if (x.a.test(m)) {
if (x.b === false) return ""; if (x.b === false) return "";
m = m.replace(x.a,x.b); m = m.replace(x.a, x.b);
} }
} }
return m; return m;
} }
export async function fetchAlbumStuff(): Promise<albumStuffF> { 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()) // console.log(d.status, d.statusText, await d.text())
const { info }: CiderNowPlaying = await d.json(); const { info }: CiderNowPlaying = await d.json();
const special = MD5.hash(info.isrc + info.albumName, "hex"); 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}`}`); // 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, data);
// writeFileSync(path,await ct.body?.pipeTo) // writeFileSync(path,await ct.body?.pipeTo)
} catch { } catch {
rmSync(path) rmSync(path);
} }
} }
return { return {
artist: info.artistName, artist: info.artistName,
album: doRewritesRn(info.albumName), album: doRewritesRn(info.albumName),
song: info.name, song: info.name,
artUrl: existsSync(path) ? path : undefined artUrl: existsSync(path) ? path : undefined,
} };
} }
// await fetchAlbumStuff(); // 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> { export async function UploadToEZ(content: Buffer): Promise<string> {
if (!process.env.EZ_API_KEY) { 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)) { if (!(content[0] === 0x89 && content[1] === 0x50 && content[2] === 0x4e)) {
@@ -21,7 +23,7 @@ export async function UploadToEZ(content: Buffer): Promise<string> {
form.append( form.append(
"file", "file",
new Blob([content as any], { type: "image/png" }), new Blob([content as any], { type: "image/png" }),
"screenshot.png" "screenshot.png",
); );
const res = await fetch(API_URL, { const res = await fetch(API_URL, {
@@ -34,7 +36,7 @@ export async function UploadToEZ(content: Buffer): Promise<string> {
if (!res.ok) { if (!res.ok) {
throw new Error( 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 { export function getRegretevatorState(): null | RegretevatorState {
if (!existsSync(STATE_FILE_PATH)) return null; if (!existsSync(STATE_FILE_PATH)) return null;
try { 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)) { 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 { return {
floor: Number(floorNum), floor: Number(floorNum),
state: "INGAME", state: "INGAME",
isGoingUp: false isGoingUp: false,
} };
} }
if (/^Floor ([0-9]+)/.test(tooltip)) { if (/^Floor ([0-9]+)/.test(tooltip)) {
const floorNum = tooltip.match(/^Floor ([0-9]+)/)![1] const floorNum = tooltip.match(/^Floor ([0-9]+)/)![1];
return { return {
floor: Number(floorNum), floor: Number(floorNum),
state: "INGAME", state: "INGAME",
isGoingUp: true isGoingUp: true,
} };
} }
return { return {
state: "UNKNOWN" state: "UNKNOWN",
} };
} catch {} } catch {}
return null; return null;
} }

View File

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