Skip to content

Instantly share code, notes, and snippets.

@ocodo
ocodo / niri-bind-list
Last active September 1, 2026 02:23
Niri DMS binding list cli tool (requires, niri, dms-shell and uv)
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "kdl-py",
# ]
# ///
from pathlib import Path
import kdl
@ocodo
ocodo / flicker.html
Last active August 27, 2026 16:20
The Flicker 1966 as an interactive html page (stroboscope - epilepsy warning) Control Strobe Hz with the mouse wheel (10hz default, start stop with Space / Mouse Click)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>The Flicker — Local Stimulus</title>
<style>
html,
body {
margin: 0;
# Large type for a 4k TV
xterm*background: #121619
xterm*foreground: white
xterm.*backarrowKey: false
XTerm*ttyModes: erase ^?
XTerm*VT100.Translations: \
#override <Key>BackSpace: string(0x7f) \n\
@ocodo
ocodo / inoffensive_slur_engine.sh
Created July 17, 2026 08:38
Detects that you aren't using fd and calls you something insulting but not offensive... add this to your internal tools, or not idgaf
#!/bin/bash
technically_not_a_slur() {
local insults=(
"absolute MELONHEAD"
"a SENTIENT CABBAGE"
"MOONFACE with empty space between ears"
"TURNIP with a pulse"
"PUMPKIN-headed waste of seeds"
"SAUSAGE BRAINED WATERHEAD"
@ocodo
ocodo / brnm.sh
Created June 27, 2026 15:59
Bulk rename from shell using wdired in emacs. (the best bulk rename tool)
# brnm from shell on a folder.
brnm() {
local dir="${1:-.}"
# Check if we can write to the directory
if [[ -w "$dir" ]]; then
emacsclient --tty --eval "(dired-rename-from-shell \"$dir\")"
else
echo "Directory not writable, using sudo..."
emacsclient \
--tty \
@ocodo
ocodo / keyd config.md
Last active June 23, 2026 12:25
Keyd - /etc/keyd/default.conf - super tap as super space, and shift esc as ~ (for 60% layout)
@ocodo
ocodo / passmenu.sh
Created March 21, 2026 12:24
Passmenu in fuzzel
#!/bin/bash
export PASSWORD_STORE_CLIP_TIME=10
shopt -s nullglob globstar
prefix=${PASSWORD_STORE_DIR-~/.password-store}
password_files=( "$prefix"/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )

Firefox Context menu unf**ker

Turn off all or most of:

  • browser.translations.select.enable – Removes the "Translate Selection" button from the right-click menu.
  • screenshots.browser.component.enabled – Disables the built-in Firefox screenshot functionality, which also removes the "Take Screenshot" button.
  • dom.text_fragments.enabled – Disables Text Fragments support, which also removes the "Copy Link to Highlight" button (and disables the auto-focus on URLs that include #:~:text=...). Don’t want to remove this functionality? See my next post.
  • privacy.query_stripping.strip_on_share.enabled – Removes the "Copy Clean Link" / "Copy Clean Link to Highlight" buttons.
  • devtools.accessibility.enabled – Disables the DevTools Accessibility Inspector and removes the "Inspect Accessibility Properties" button.
  • browser.ml.chat.menu – Removes the "Ask an AI Chatbot" button.
@ocodo
ocodo / Simple navigation keys.md
Created February 19, 2026 13:12
Simple navigation keys

Windows helpers

Navigation Keys

  • Copy - Ctrl C
  • Paste - Ctrl V
  • Cut - Ctrl X
  • Undo - Ctrl Z
  • Word Left/Right Ctrl Left/Right
  • Delete Word Left Ctrl Backspace
@ocodo
ocodo / Notes on Electron Spawning MPV.exe in Windows.md
Last active December 17, 2025 03:23
Electron spawning mpv as a standalone launched windows app

Running MPV from Electron / Windows

Tested on Windows 11 / mpv.exe is in user path.

Abstract

Running mpv via Electron on Windows, assuming the goal is to run MPV as a standalone so the Electron app can close without affecting mpv.

As opposed to exec, we use spawn as the method to fork the process, spawn returns a stream of io, in this example, we 'ignore' stdio.