mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2026-08-01 07:21:31 -07:00
add icons to notifications
This commit is contained in:
@@ -52,7 +52,19 @@
|
|||||||
"hooks": [
|
"hooks": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "notify-send 'Claude Code' 'Claude Code needs your attention'"
|
"command": "notify-send -a 'Claude Code' -i claude-desktop 'Claude Code' 'Claude Code needs your attention'"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Stop": [
|
||||||
|
{
|
||||||
|
"matcher": "",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "jq -r '.cwd // \".\"' | { read -r d; notify-send -a 'Claude Code' -i claude-desktop -u normal 'Claude Code' \"Finished: $(basename \"$d\")\"; } 2>/dev/null || true",
|
||||||
|
"async": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
CHATGPT_ICON = "/usr/share/icons/hicolor/512x512/apps/chatgpt-desktop.png"
|
||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def main() -> int:
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
return 0
|
return 0
|
||||||
@@ -27,7 +30,13 @@ def main() -> int:
|
|||||||
message = message[:177] + "..."
|
message = message[:177] + "..."
|
||||||
|
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[notify_send, "--app-name=Codex", "Codex", message],
|
[
|
||||||
|
notify_send,
|
||||||
|
"--app-name=Codex",
|
||||||
|
f"--icon={CHATGPT_ICON}",
|
||||||
|
"Codex",
|
||||||
|
message,
|
||||||
|
],
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL,
|
||||||
check=False,
|
check=False,
|
||||||
|
|||||||
Reference in New Issue
Block a user