majorly enhance my stuff

This commit is contained in:
2025-03-12 21:25:53 +02:00
parent 2e01b26e5a
commit 6fafc566ae
15 changed files with 216 additions and 21 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
# hardware-configuration.nix
node_modules

BIN
bun.lockb Executable file

Binary file not shown.

View File

@@ -9,7 +9,7 @@ gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=0
gtk-menu-images=0
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=0
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight

View File

@@ -9,8 +9,8 @@ bind = $mainMod SHIFT, B, exec, bash ~/config/scripts/hot-reload.sh
# bind = $mainMod SHIFT, RETURN, exec, bash ~/config/scripts/select-wallpaper.sh
# Screenshot keybinds
bind = $mainMod, PRINT, exec, bash ~/dotfiles/scripts/screenshot-selection.sh
bind = $mainMod SHIFT, PRINT, exec, bash ~/dotfiles/scripts/screenshot-fullscreen.sh
bind = $mainMod, PRINT, exec, bash ~/config/scripts/screenshot-selection.sh
bind = $mainMod SHIFT, PRINT, exec, bash ~/config/scripts/screenshot-fullscreen.sh
# Music volume control
bind = $mainMod, XF86AudioRaiseVolume, exec, playerctl -p cider,OCbwoy3_s_iPhone volume 0.02+
@@ -35,19 +35,14 @@ bind = CTRL SUPER ALT, L, exec, hyprlock
bind = $mainMod ALT CTRL, mouse_down, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 1.25}')"
bind = $mainMod ALT CTRL, mouse_up, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 1.25}')"
bind = $mainMod SHIFT, P, exec, bash $HOME/dotfiles/scripts/toggle_mangohud.sh
bind = $mainMod SHIFT, M, exec, bash $HOME/dotfiles/private/r2_upload_screenshot.sh
bind = $mainMod SHIFT, L, exec, bash $HOME/dotfiles/private/skeet-screenshot.sh
bind = $mainMod, F1, exec, bash $HOME/dotfiles/scripts/roblox-fullscreen.sh
bind = $mainMod, F2, exec, bash -c "cd $HOME/Projects/tuxstrap && npm run dev"
bind = $mainMod ALT, F2, exec, bash -c "cd $HOME/Projects/tuxstrap && npm run dev-opengl"
bind = $mainMod, F3, exec, steam-run /opt/Cider/cider
bind = $mainMod, F4, exec, flatpak run com.valvesoftware.Steam
bind = $mainMod, F5, exec, notify-send -u critical "Hyprland" "Enabled debug overlay\n<small>Reset with <b>hyprctl reload</b>.</small>" && hyprctl keyword debug:overlay 1
bind = $mainMod SHIFT, M, exec, bun run $HOME/config/scripts/bin/r2UploadScreenshot.ts
bind = $mainMod, F1, exec, bash $HOME/config/scripts/roblox-fullscreen.sh
bind = $mainMod, F2, exec, bash -c "xdg-open roblox://"
bind = $mainMod, F5, exec, notify-send -u critical "Hyprland" "Enabled debug overlay" && hyprctl keyword debug:overlay 1
# bind = $mainMod SHIFT, F3, exec, bash -c "NIXPKGS_ALLOW_UNFREE=1 nix-shell -p osu-lazer-bin --command osu\!"
bind = $mainMod SHIFT, F, fullscreen, 1
bind = $mainMod, SPACE, exec, bash $HOME/dotfiles/scripts/toggle_language.sh
bind = $mainMod, SPACE, exec, bash $HOME/config/scripts/toggle-language.sh
# VM Passtrough
bind = $mainMod, Insert, submap, passthru

View File

@@ -16,11 +16,11 @@ env = GTK_THEME,catppuccin-mocha-blue-standard+default
# Cursor
exec = hyprctl setcursor HyprCatppuccinMochaMauve 24
exec = hyprctl setcursor catppuccin-mocha-blue-cursors 24
env = HYPRCURSOR_THEME,HyprCatppuccinMochaMauve
env = HYPRCURSOR_THEME,catppuccin-mocha-blue-cursors
env = HYPRCURSOR_SIZE,24
env = XCURSOR_THEME,HyprCatppuccinMochaMauve
env = XCURSOR_THEME,catppuccin-mocha-blue-cursors
env = XCURSOR_SIZE,24
# Toolkit Env

View File

@@ -6,7 +6,7 @@ standard_dialogs=xdgdesktopportal
style=Lightly
[Fonts]
fixed="Sans Serif,9,-1,5,50,0,0,0,0,0"
fixed="Geist Mono,9,-1,5,50,0,0,0,0,0"
general="Sans Serif,9,-1,5,50,0,0,0,0,0"
[Interface]
@@ -15,8 +15,8 @@ buttonbox_layout=0
cursor_flash_time=1000
dialog_buttons_have_icons=1
double_click_interval=400
gui_effects=@Invalid()
keyboard_scheme=2
gui_effects=General, AnimateMenu, AnimateCombo, AnimateTooltip, AnimateToolBox
keyboard_scheme=1
menus_have_icons=true
show_shortcuts_in_context_menus=true
stylesheets=@Invalid()
@@ -25,7 +25,7 @@ underline_shortcut=1
wheel_scroll_lines=3
[SettingsWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x3\xa2\0\0\x3\xf0\0\0\0\0\0\0\0\0\0\0\a\x7f\0\0\x4\x37\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x3\xa2\0\0\x3\xf0)
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x3\xa5\0\0\x2\xfb\0\0\0\0\0\0\0\0\0\0\x2\xde\0\0\x2\xfb\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x3\xa5\0\0\x2\xfb)
[Troubleshooting]
force_raster_widgets=1

View File

@@ -251,7 +251,6 @@
{ id = "aflpfginfpjhanhkmdpohpggpolfopmb"; } # SkyLink
{ id = "agjnjboanicjcpenljmaaigopkgdnihi"; } # PreMiD
{ id = "ijcpiojgefnkmcadacmacogglhjdjphj"; } # Shinigami Eyes
{ id = "bmoehnfdgafmljnmbidgjhgfaegkfddk"; } # Bluesky for Everyone
{ id = "hbkpclpemjeibhioopcebchdmohaieln"; } # BTRoblox
{ id = "lnjaiaapbakfhlbjenjkhffcdpoompki"; } # Catppuccin gh file explorer icons
{ id = "ejcfepkfckglbgocfkanmcdngdijcgld"; } # ChatGPT

18
package.json Normal file
View File

@@ -0,0 +1,18 @@
{
"name": "ocbwoy3s-dotfiles",
"module": "index.ts",
"type": "module",
"private": true,
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"@types/commander": "^2.12.5",
"@types/sharp": "^0.32.0",
"commander": "^13.1.0",
"sharp": "^0.33.5"
}
}

View File

@@ -0,0 +1,79 @@
import { $ } from "bun";
import { Command } from "commander";
import sharp from "sharp";
import { writeFileSync } from "fs";
const program = new Command("handle-screenshot");
const SCREENSHOT_PATH = `/home/ocbwoy3/Pictures/Screenshots`;
async function transformImage(b: Buffer): Promise<Buffer> {
const image = sharp(b).ensureAlpha();
const { width, height } = await image.metadata();
// console.log(width, height);
const mask = Buffer.from(
`<svg width="${width}" height="${height}">
<rect x="0" y="0" width="${width}" height="${height}" rx="16" fill="white"/>
</svg>`
);
const maskedImage = image.composite([
{
input: mask,
gravity: "center",
blend: "dest-in"
},
]).extend({
top: 16,
bottom: 16,
left: 16,
right: 16
}).ensureAlpha();
return await maskedImage.png().toBuffer();
}
(() => {
program.command("selection").description("Takes a screenshot from selection").action(async () => {
const selection = await $`slurp -w 0 -d -b "#cdd6f444"`.nothrow().quiet();
if (selection.exitCode !== 0 || selection.stdout.toString().includes("cancel")) {
console.log("/tmp/woah");
process.exit(0);
};
const _BUF = await $`grim -t png -l 0 -g ${selection.stdout.toString().trim()} -`.arrayBuffer();
const BUF = Buffer.from(_BUF);
const _d = new Date();
const FILENAME = `${SCREENSHOT_PATH}/${_d.toISOString()}-${_d.getTime()}.png`
const cb = await transformImage(BUF);
writeFileSync(FILENAME,cb);
console.log(FILENAME);
});
})();
(() => {
program.command("fullscreen").description("Takes a fullsceen screenshot").action(async () => {
const selection = await $`hyprctl monitors | awk '/Monitor/{monitor=$2} /focused: yes/{print monitor; exit}'`.nothrow().text();
const _BUF = await $`grim -t png -l 0 -o ${selection.trim()} -`.arrayBuffer();
const BUF = Buffer.from(_BUF);
const _d = new Date();
const FILENAME = `${SCREENSHOT_PATH}/${_d.toISOString()}-${_d.getTime()}.png`
console.log(FILENAME)
const cb = await transformImage(BUF);
writeFileSync(FILENAME,cb);
});
})();
program.parse(process.argv);

14
scripts/dev/notif-test.sh Normal file
View File

@@ -0,0 +1,14 @@
hyprctl notify 1 5000 0 " Loading OCbwoy3's Dotfiles"
# Dotfiles
notify-send "Welcome to Hyprland!" "some basic startup code"
notify-send "Hyprland" "Enabled debugging overlay"
notify-send "OCbwoy3's Dotfiles" "Keyboard Layout: English"
notify-send "Screenshot" "Saved and copied to clipboard."
notify-send "Regretevator" "Do I see Regretevator?"
notify-send "Regretevator" "Floor 729"
notify-send "Regretevator" "Floor 729 - 49/50"
notify-send -i /tmp/.tuxstrap.png "Roblox" "Regretevator [ELEVATOR SIMULATOR]\n(UDMUX Protected)"
notify-send -i /tmp/pest.png -a "regretevator-npc-chat" "Pest" "いいえ! これは許されません! パンタロンのコンパートメント を空にしましょう。"

View File

@@ -0,0 +1,23 @@
# run roblox in fullscreen with mouse sensitivity of the os default and not some value set by roblox
#!/usr/bin/env sh
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
if [ "$HYPRGAMEMODE" = 1 ] ; then
hyprctl --batch "\
keyword animations:enabled 0;\
keyword decoration:drop_shadow 0;\
keyword decoration:blur:enabled 0;\
keyword general:gaps_in 0;\
keyword general:gaps_out 0;\
keyword general:border_size 0;\
keyword decoration:rounding 0;\
keyword decoration:active_opacity 1;\
keyword decoration:inactive_opacity 1;\
keyword decoration:fullscreen_opacity 1;"
notify-send -t 5000 -u critical "OCbwoy3's Dotfiles" "Enabled game mode"
pkill -9 waybar
exit
fi
bash ~/config/scripts/hot-reload.sh
# hyprctl reload
notify-send -t 5000 -u critical "OCbwoy3's Dotfiles" "Disabled game mode"

View File

@@ -0,0 +1,11 @@
#!/bin/bash
# do NOT use $PATH for this!!
SS_PATH=$(timeout 30s bun run ~/config/scripts/bin/handleScreenshot.ts fullscreen)
echo "$SS_PATH"
if [[ -n "$SS_PATH" && "$SS_PATH" == /home/ocbwoy3/Pictures/Screenshots/* ]]; then
wl-copy < "$SS_PATH"
notify-send "Screenshot" "Successfully captured screenshot to clipboard"
fi

11
scripts/screenshot-selection.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
# do NOT use $PATH for this!!
SS_PATH=$(timeout 30s bun run ~/config/scripts/bin/handleScreenshot.ts selection)
echo "$SS_PATH"
if [[ -n "$SS_PATH" && "$SS_PATH" == /home/ocbwoy3/Pictures/Screenshots/* ]]; then
wl-copy < "$SS_PATH"
notify-send "Screenshot" "Successfully captured screenshot to clipboard"
fi

View File

@@ -0,0 +1,17 @@
KBLANG=$(hyprctl getoption input:kb_layout | awk 'NR==1{print $2}')
if [ "$KBLANG" = "us" ] ; then
hyprctl --batch "\
keyword input:kb_layout lv;\
keyword input:kb_variant apostrophe;"
# keyword input:kb_options compose:apostrophe;"
notify-send -u low "OCbwoy3's Dotfiles" "Keyboard Layout: Latvian"
exit
elif [ "$KBLANG" = "lv" ] ; then
# hyprctl --batch "\
# keyword input:kb_layout us;\
# keyword input:kb_variant;"
# i have no fucking idea how to unset input:kb_variant with hyprctl
hyprctl reload
notify-send -u low "OCbwoy3's Dotfiles" "Keyboard Layout: English"
exit
fi

27
tsconfig.json Normal file
View File

@@ -0,0 +1,27 @@
{
"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,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}