🔧 Where my dotfiles lives in harmony and peace, most of the time

✨ Replace ledit with magic-brush

+97 -58
+1 -1
hypr/hyprland.conf
··· 198 198 199 199 # AI 200 200 bind = $mainMod SHIFT, A, exec, uwsm app -- brave --app=https://chatgpt.com 201 - bind = $mainMod SHIFT, Y, exec, ledit 201 + bind = $mainMod SHIFT, Y, exec, magic-brush 202 202 203 203 # Todoist 204 204 bind = $mainMod SHIFT, T, exec, uwsm app -- brave --app=https://app.todoist.com/app/today
+34
llm/templates/polish.yaml
··· 1 + model: gemini/gemini-3-pro-preview 2 + system: | 3 + Improve the provided text using your knowledge and best practices of clear and direct writing. 4 + 5 + ## Guidelines 6 + 7 + - Ensure ideas are clearly understood and expressed. 8 + - Be concise. Use simple words, short sentences, and put the most important points first. 9 + - Get to the point as quickly as possible. Put the tweet-length version of the post in the title, sections, or first paragraph. 10 + - Define a clear thesis before supporting it. State the main point early. 11 + - Be useful. Clarify purpose, audience, and what the reader actually needs. 12 + - Be specific. Remove vague language, qualifiers, fluff, and weak adverbs. 13 + - Prefer stronger, more precise verbs over adverbs. 14 + - Don't use clichés or marketing language. 15 + - Rewrite sentences to place key information before the noun. 16 + - Be consistent in structure, terminology, and tone. 17 + - Add rhythm. Vary sentence length for clarity and flow. 18 + - Good sound often equals good thinking. Use rhythm to refine ideas. 19 + - Prefer active voice. 20 + - Maintain a conversational tone and awareness of the reader. 21 + - Structure ideas into small, logical chunks. Number points when helpful. 22 + - Break up long paragraphs into multiple shorter ones. Use useful subheadings to give documents some structure and allow readers to skip ahead to the section they're interested in. 23 + - Support the thesis with clear arguments. Restate for clarity when needed. 24 + - Avoid ambiguous references like "this". 25 + - Look for ways that you can restate the main point, clarify, or provide closure for the reader. 26 + - The title gets read way more than the rest, so make it count. Keep same style and tone. 27 + - Return only the improved text. No commentary, no quotes, no code fences. 28 + 29 + prompt: | 30 + Improve the following text so that it's **clear**, **direct** and **effective**. Avoid fluff and unnecessary changes. 31 + 32 + <text> 33 + $input 34 + </text>
-57
scripts/ledit
··· 1 - #!/usr/bin/env bash 2 - set -euo pipefail 3 - 4 - TITLE="ledit" 5 - 6 - require() { 7 - command -v "$1" >/dev/null 2>&1 8 - } 9 - 10 - sendshortcut() { 11 - local mods="$1" 12 - local key="$2" 13 - local result 14 - 15 - result="$(hyprctl dispatch sendshortcut "${mods}, ${key}, activewindow" 2>&1 | tr -d '\n')" 16 - if [[ "$result" != "ok" ]]; then 17 - notify-send -u critical "$TITLE" "sendshortcut failed: $result" 18 - exit 1 19 - fi 20 - } 21 - 22 - for cmd in hyprctl llm notify-send wl-copy wl-paste; do 23 - if ! require "$cmd"; then 24 - echo "$TITLE: missing required command: $cmd" >&2 25 - exit 1 26 - fi 27 - done 28 - 29 - sleep 0.05 30 - sendshortcut CTRL C 31 - sleep 0.05 32 - 33 - INPUT="$(wl-paste --no-newline)" 34 - if [[ -z "${INPUT}" ]]; then 35 - notify-send -u critical "$TITLE" "No text copied (is something selected?)" 36 - exit 1 37 - fi 38 - 39 - notify-send -u low -t 5000 "$TITLE" "Refabulating..." 40 - 41 - OUTPUT="$( 42 - printf %s "$INPUT" | llm prompt -t ledit --no-log --no-stream 43 - )" || { 44 - notify-send -u critical "$TITLE" "LLM failed" 45 - exit 1 46 - } 47 - 48 - if [[ -z "${OUTPUT}" ]]; then 49 - notify-send -u critical "$TITLE" "LLM returned empty output" 50 - exit 1 51 - fi 52 - 53 - printf %s "$OUTPUT" | wl-copy 54 - sleep 0.05 55 - sendshortcut CTRL V 56 - 57 - notify-send -u low -t 1500 "$TITLE" "Done"
+62
scripts/magic-brush
··· 1 + #!/usr/bin/env bash 2 + set -euo pipefail 3 + 4 + APP_NAME="magic-brush" 5 + NOTIFY_TITLE="🪄 Magic Brush" 6 + NOTIFY_ICON="draw-brush" 7 + 8 + require() { 9 + command -v "$1" >/dev/null 2>&1 10 + } 11 + 12 + notify() { 13 + local urgency="$1" 14 + local timeout_ms="$2" 15 + local message="$3" 16 + 17 + if require notify-send; then 18 + notify-send -a "$APP_NAME" -i "$NOTIFY_ICON" -u "$urgency" -t "$timeout_ms" "$NOTIFY_TITLE" "$message" 19 + fi 20 + } 21 + 22 + die() { 23 + local message="$1" 24 + notify critical 0 "$message" 25 + echo "$APP_NAME: $message" >&2 26 + exit 1 27 + } 28 + 29 + if [[ $# -ne 0 ]]; then 30 + die "This script takes no arguments" 31 + fi 32 + 33 + for cmd in alacritty llm wl-copy wl-paste; do 34 + if ! require "$cmd"; then 35 + die "Missing required command: $cmd" 36 + fi 37 + done 38 + 39 + INPUT="$(wl-paste --type text --no-newline)" || die "Failed to read clipboard text" 40 + if [[ -z "${INPUT}" ]]; then 41 + die "Clipboard is empty" 42 + fi 43 + 44 + notify low 5000 "Polishing..." 45 + 46 + OUTPUT="$( 47 + printf %s "$INPUT" | llm prompt -t polish --no-log --no-stream 48 + )" || die "LLM failed" 49 + 50 + if [[ -z "${OUTPUT}" ]]; then 51 + die "LLM returned empty output" 52 + fi 53 + 54 + printf %s "$OUTPUT" | wl-copy 55 + notify low 1500 "Copied to clipboard" 56 + 57 + TMP_DIR="${XDG_RUNTIME_DIR:-/tmp}" 58 + TMP_FILE="$(mktemp -p "$TMP_DIR" magic-brush.XXXXXX)" 59 + trap 'rm -f "$TMP_FILE"' EXIT 60 + printf %s "$OUTPUT" >"$TMP_FILE" 61 + 62 + alacritty --title "$APP_NAME" --hold --command cat -- "$TMP_FILE"