mirror of
https://github.com/SeriousBug/dotfiles
synced 2026-06-17 04:45:20 -05:00
Compare commits
2 commits
68de2a5bb3
...
c82e17654e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c82e17654e | ||
|
|
87d3529e0d |
|
|
@ -60,5 +60,21 @@ depends = []
|
||||||
|
|
||||||
[asdf.variables]
|
[asdf.variables]
|
||||||
|
|
||||||
|
[claude]
|
||||||
|
depends = []
|
||||||
|
|
||||||
|
[claude.files]
|
||||||
|
"claude/CLAUDE.md" = "~/.claude/CLAUDE.md"
|
||||||
|
|
||||||
|
[claude.variables]
|
||||||
|
|
||||||
|
[bin]
|
||||||
|
depends = []
|
||||||
|
|
||||||
|
[bin.files]
|
||||||
|
"bin/discord-send" = "~/.local/bin/discord-send"
|
||||||
|
|
||||||
|
[bin.variables]
|
||||||
|
|
||||||
[settings]
|
[settings]
|
||||||
default_target_type = "automatic"
|
default_target_type = "automatic"
|
||||||
|
|
|
||||||
|
|
@ -14,3 +14,4 @@ type = "symbolic"
|
||||||
## Directory Symlinks in setup.sh
|
## Directory Symlinks in setup.sh
|
||||||
|
|
||||||
For directories where programs create new files that should be tracked (e.g., fish's `funcsave` command), use the `ensure_dir_symlink` function in `setup.sh` instead of Dotter. This symlinks the entire directory so dynamically created files are automatically tracked in the repository.
|
For directories where programs create new files that should be tracked (e.g., fish's `funcsave` command), use the `ensure_dir_symlink` function in `setup.sh` instead of Dotter. This symlinks the entire directory so dynamically created files are automatically tracked in the repository.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
nodejs 22.11.0
|
nodejs 22.11.0
|
||||||
golang 1.25.1
|
golang 1.25.1
|
||||||
|
bun 1.3.8
|
||||||
|
|
|
||||||
93
bin/discord-send
Executable file
93
bin/discord-send
Executable file
|
|
@ -0,0 +1,93 @@
|
||||||
|
#!/usr/bin/env bun
|
||||||
|
|
||||||
|
import { basename, join } from "node:path";
|
||||||
|
import { homedir } from "node:os";
|
||||||
|
|
||||||
|
const configDir = process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
|
||||||
|
const webhookFile = join(configDir, "discord-send", "webhook");
|
||||||
|
|
||||||
|
function usage() {
|
||||||
|
console.error(
|
||||||
|
"Usage: discord-send [--attach <file>] <message>\n" +
|
||||||
|
"\n" +
|
||||||
|
"Sends a message to a Discord channel via webhook.\n" +
|
||||||
|
`Reads the webhook URL from ${webhookFile}.`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const args = Bun.argv.slice(2);
|
||||||
|
let attachPath = null;
|
||||||
|
const messageParts = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < args.length; i++) {
|
||||||
|
const arg = args[i];
|
||||||
|
if (arg === "--attach") {
|
||||||
|
attachPath = args[++i];
|
||||||
|
if (!attachPath) {
|
||||||
|
console.error("Error: --attach requires a file path");
|
||||||
|
process.exit(2);
|
||||||
|
}
|
||||||
|
} else if (arg.startsWith("--attach=")) {
|
||||||
|
attachPath = arg.slice("--attach=".length);
|
||||||
|
} else if (arg === "-h" || arg === "--help") {
|
||||||
|
usage();
|
||||||
|
process.exit(0);
|
||||||
|
} else {
|
||||||
|
messageParts.push(arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const message = messageParts.join(" ");
|
||||||
|
|
||||||
|
const webhookFileHandle = Bun.file(webhookFile);
|
||||||
|
if (!(await webhookFileHandle.exists())) {
|
||||||
|
console.error(
|
||||||
|
`Error: webhook file not found: ${webhookFile}\n` +
|
||||||
|
"Create it and write your Discord webhook URL inside.",
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
const webhookUrl = (await webhookFileHandle.text()).trim();
|
||||||
|
if (!webhookUrl) {
|
||||||
|
console.error(`Error: webhook file is empty: ${webhookFile}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!message && !attachPath) {
|
||||||
|
usage();
|
||||||
|
process.exit(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
let body;
|
||||||
|
const headers = {};
|
||||||
|
|
||||||
|
if (attachPath) {
|
||||||
|
const file = Bun.file(attachPath);
|
||||||
|
if (!(await file.exists())) {
|
||||||
|
console.error(`Error: file not found: ${attachPath}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
const filename = basename(attachPath);
|
||||||
|
const payload = { attachments: [{ id: 0, filename }] };
|
||||||
|
if (message) payload.content = message;
|
||||||
|
|
||||||
|
const form = new FormData();
|
||||||
|
form.append("payload_json", JSON.stringify(payload));
|
||||||
|
form.append("files[0]", file, filename);
|
||||||
|
body = form;
|
||||||
|
} else {
|
||||||
|
headers["Content-Type"] = "application/json";
|
||||||
|
body = JSON.stringify({ content: message });
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(webhookUrl, { method: "POST", headers, body });
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
const text = await response.text();
|
||||||
|
console.error(
|
||||||
|
`Error: Discord returned ${response.status} ${response.statusText}\n${text}`,
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("Message sent successfully");
|
||||||
10
claude/CLAUDE.md
Normal file
10
claude/CLAUDE.md
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Personal Claude Code Instructions
|
||||||
|
|
||||||
|
## Notifying me / sharing images via Discord
|
||||||
|
|
||||||
|
The `discord-send` CLI is on my PATH. Use it whenever I ask you to notify me when something is done, or to show me an image or video — send it to my Discord and I'll see it there.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
discord-send 'Build finished successfully'
|
||||||
|
discord-send --attach ./screenshot.png 'Here is the rendered page'
|
||||||
|
```
|
||||||
3
fish/functions/less.fish
Normal file
3
fish/functions/less.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
function less --wraps=bat --wraps='bat --paging always' --description 'alias less bat --paging always'
|
||||||
|
bat --paging always $argv
|
||||||
|
end
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Beware! This file is rewritten by htop when settings are changed in the interface.
|
# Beware! This file is rewritten by htop when settings are changed in the interface.
|
||||||
# The parser is also very primitive, and not human-friendly.
|
# The parser is also very primitive, and not human-friendly.
|
||||||
htop_version=3.3.0
|
htop_version=3.4.1
|
||||||
config_reader_min_version=3
|
config_reader_min_version=3
|
||||||
fields=0 48 17 18 38 39 2 46 47 49 1
|
fields=0 48 17 18 38 39 2 46 47 49 1
|
||||||
hide_kernel_threads=1
|
hide_kernel_threads=1
|
||||||
|
|
@ -25,6 +25,7 @@ detailed_cpu_time=0
|
||||||
cpu_count_from_one=0
|
cpu_count_from_one=0
|
||||||
show_cpu_usage=1
|
show_cpu_usage=1
|
||||||
show_cpu_frequency=0
|
show_cpu_frequency=0
|
||||||
|
show_cached_memory=1
|
||||||
update_process_names=0
|
update_process_names=0
|
||||||
account_guest_in_cpu_meter=0
|
account_guest_in_cpu_meter=0
|
||||||
color_scheme=0
|
color_scheme=0
|
||||||
|
|
@ -37,14 +38,14 @@ column_meter_modes_0=1 1 1
|
||||||
column_meters_1=RightCPUs2 Tasks LoadAverage Uptime
|
column_meters_1=RightCPUs2 Tasks LoadAverage Uptime
|
||||||
column_meter_modes_1=1 2 2 2
|
column_meter_modes_1=1 2 2 2
|
||||||
tree_view=0
|
tree_view=0
|
||||||
sort_key=46
|
sort_key=47
|
||||||
tree_sort_key=0
|
tree_sort_key=0
|
||||||
sort_direction=-1
|
sort_direction=-1
|
||||||
tree_sort_direction=1
|
tree_sort_direction=1
|
||||||
tree_view_always_by_pid=0
|
tree_view_always_by_pid=0
|
||||||
all_branches_collapsed=0
|
all_branches_collapsed=0
|
||||||
screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command
|
screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT STATE PERCENT_CPU PERCENT_MEM TIME Command
|
||||||
.sort_key=PERCENT_CPU
|
.sort_key=PERCENT_MEM
|
||||||
.tree_sort_key=PID
|
.tree_sort_key=PID
|
||||||
.tree_view_always_by_pid=0
|
.tree_view_always_by_pid=0
|
||||||
.tree_view=0
|
.tree_view=0
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" },
|
"hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "94cae4660a8b2d95dbbd56e1fbc6fcfa2716d152" }
|
"mini.nvim": { "branch": "main", "commit": "a995fe9cd4193fb492b5df69175a351a74b3d36b" }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
setup.sh
2
setup.sh
|
|
@ -229,7 +229,7 @@ cat > .dotter/local.toml << EOF
|
||||||
# Machine-specific Dotter configuration
|
# Machine-specific Dotter configuration
|
||||||
# This file is generated by setup.sh
|
# This file is generated by setup.sh
|
||||||
|
|
||||||
packages = ["git", "nvim", "fish", "zellij", "htop", "asdf"]
|
packages = ["git", "nvim", "fish", "zellij", "htop", "asdf", "claude", "bin"]
|
||||||
|
|
||||||
[variables]
|
[variables]
|
||||||
git_name = "$GIT_NAME"
|
git_name = "$GIT_NAME"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue