We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1cf2d5e commit 04f50ebCopy full SHA for 04f50eb
1 file changed
.gemini/hooks/notify.py
@@ -9,8 +9,16 @@ def notify_user():
9
Fails gracefully if notify-send is not available.
10
"""
11
try:
12
- # Get the project name from the current directory
13
- project_name = os.path.basename(os.getcwd())
+ # Get the project root from git
+ try:
14
+ project_root = subprocess.check_output(
15
+ ["git", "rev-parse", "--show-toplevel"],
16
+ stderr=subprocess.DEVNULL
17
+ ).decode().strip()
18
+ project_name = os.path.basename(project_root)
19
+ except Exception:
20
+ # Fallback to current directory if not in a git repo
21
+ project_name = os.path.basename(os.getcwd())
22
23
# Determine the message based on the hook context
24
message = f"Gemini CLI has finished in '{project_name}'"
0 commit comments