mirror of
https://github.com/don-philipe/dotfiles.git
synced 2026-06-09 16:33:14 +02:00
Compare commits
2 Commits
97e16f6273
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 61f8801f73 | |||
| 15240d7e86 |
@@ -0,0 +1,38 @@
|
||||
import { Plugin } from "@opencode-ai/plugin";
|
||||
|
||||
export const NotifySendPlugin: Plugin = async ({ $ }) => {
|
||||
const mainSessions = new Set<string>();
|
||||
const notify = async (summary: string, body: string) => {
|
||||
try {
|
||||
await $`notify-send -i ~/.config/opencode/plugin/opencode-logo-dark.svg ${summary} ${body}`;
|
||||
} catch { }
|
||||
};
|
||||
|
||||
return {
|
||||
event: async ({ event }) => {
|
||||
switch (event.type) {
|
||||
case "session.created":
|
||||
const session = event.properties.info;
|
||||
if (!session.parentID) {
|
||||
mainSessions.add(session.id);
|
||||
}
|
||||
break;
|
||||
case "session.deleted":
|
||||
mainSessions.delete(event.properties.info.id);
|
||||
break;
|
||||
case "session.status":
|
||||
const { sessionID, status } = event.properties;
|
||||
if (status.type === "idle" && mainSessions.has(sessionID)) {
|
||||
await notify("OpenCode", "Session status updated");
|
||||
}
|
||||
break;
|
||||
case "question.asked":
|
||||
await notify("OpenCode", "Question asked");
|
||||
break;
|
||||
case "permission.asked":
|
||||
await notify("OpenCode", "Permission requested");
|
||||
break;
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
<svg width='240' height='300' viewBox='0 0 240 300' fill='none' xmlns='http://www.w3.org/2000/svg'><g clip-path='url(#clip0_1401_86283)'><mask id='mask0_1401_86283' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='240' height='300'><path d='M240 0H0V300H240V0Z' fill='white'/></mask><g mask='url(#mask0_1401_86283)'><path d='M180 240H60V120H180V240Z' fill='#4B4646'/><path d='M180 60H60V240H180V60ZM240 300H0V0H240V300Z' fill='#F1ECEC'/></g></g><defs><clipPath id='clip0_1401_86283'><rect width='240' height='300' fill='white'/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 577 B |
@@ -75,12 +75,28 @@ git-blobs()
|
||||
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
|
||||
}
|
||||
|
||||
# Do a short code review via several git commands
|
||||
# https://piechowski.io/post/git-commands-before-reading-code/
|
||||
git-review()
|
||||
{
|
||||
echo "### What Changes the Most (1y ago) ###"
|
||||
git log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -20
|
||||
echo "\n### Who Built This ###"
|
||||
git --no-pager shortlog -sn --no-merges
|
||||
echo "\n### Where Do Bugs Cluster ###"
|
||||
git log -i -E --grep="fix|bug|broken" --name-only --format='' | sort | uniq -c | sort -nr | head -20
|
||||
echo "\n### Is This Project Accelerating or Dying (commit count per m) ###"
|
||||
git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -c
|
||||
echo "\n### How Often Is the Team Firefighting ###"
|
||||
git log --oneline --since="1 year ago" | grep -iE 'revert|hotfix|emergency|rollback'
|
||||
}
|
||||
|
||||
sshs()
|
||||
{
|
||||
tmprc=$(ssh $1 "mktemp --directory")
|
||||
scp -q $HOME/.zshrc $1:$tmprc
|
||||
ssh -t $1 "export ZDOTDIR=${tmprc}; exec zsh"
|
||||
ssh $1 "rm -rf ${tmprc}"
|
||||
ssh -t $1 "export ZDOTDIR=${tmprc}; trap 'rm -rf ${tmprc}' EXIT INT TERM; exec zsh"
|
||||
#ssh $1 "rm -rf ${tmprc}"
|
||||
}
|
||||
|
||||
# show the current mode:
|
||||
|
||||
Reference in New Issue
Block a user