feat(hyprland): add window resize, split toggle, and macOS-style screenshot keybindings - #760
Conversation
…enshot keybindings - Add SUPER+;/' for horizontal resize and SUPER+CTRL+;/' for vertical resize - Add SUPER+V for toggling split orientation (vertical/horizontal) - Add Framework+Shift+3/4/5 for screenshot and screen recording (macOS-style) - Remove SUPER+V VS Code launch binding
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
Summary of ChangesHello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Hyprland configuration by introducing a suite of new keybindings for more flexible window management, including precise resizing controls and a convenient split orientation toggle. It also integrates a user-friendly macOS-style screenshot and screen recording workflow. These changes aim to improve the overall desktop experience by providing more intuitive and efficient ways to interact with the window manager, alongside a minor cleanup in the build system. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe Makefile removes the Changes
Estimated Code Review Effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Mesa DescriptionTL;DRAdded new Hyprland keybindings for window resizing, split orientation toggling, and macOS-style screenshot/recording functionality. What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request introduces several useful keybindings for Hyprland, including window resizing, toggling layout splits, and new screenshot/recording shortcuts inspired by macOS. However, the new screen recording binding triggers a script that uses an insecure temporary file for PID management, increasing the attack surface for local symlink and arbitrary process termination attacks. Additionally, the screen recording script has a potential issue with signal handling that could lead to corrupted video files, which has been detailed in a specific comment.
| # macOS-style screenshot & recording (Framework+Shift+3/5 via keyd → Ctrl+Shift+3/5) | ||
| bind = CTRL SHIFT, 3, exec, hyprshot -m output | ||
| bind = CTRL SHIFT, 4, exec, hyprshot -m region | ||
| bind = CTRL SHIFT, 5, exec, ~/.config/hypr/scripts/record-screen.sh |
There was a problem hiding this comment.
The record-screen.sh script, executed by the new keybinding, uses a predictable PID file location at /tmp/wf-recorder.pid. This is vulnerable to a symlink attack, allowing a local attacker to overwrite sensitive files or terminate arbitrary processes. To remediate this, use a more secure location for the PID file, such as $XDG_RUNTIME_DIR/wf-recorder.pid or a user-specific directory with restricted permissions. Additionally, the script uses kill (defaulting to SIGTERM) to stop wf-recorder, which may cause wf-recorder to terminate without properly finalizing the video file, potentially leading to corruption. According to wf-recorder documentation, it expects a SIGINT signal for a graceful shutdown. Please consider updating the script to use kill -INT to ensure recordings are saved correctly.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@config/hyprland/hyprland.conf`:
- Around line 357-360: Update the comment that currently says
"Framework+Shift+3/5" to correctly reflect all three bindings (3, 4, and 5);
locate the comment above the bind lines for the hyprshot and record-screen
commands (the lines binding CTRL SHIFT, 3 → "hyprshot -m output", CTRL SHIFT, 4
→ "hyprshot -m region", and CTRL SHIFT, 5 → "
~/.config/hypr/scripts/record-screen.sh") and change the text to include 4
(e.g., "Framework+Shift+3/4/5" or "Framework+Shift+3-5").
| # macOS-style screenshot & recording (Framework+Shift+3/5 via keyd → Ctrl+Shift+3/5) | ||
| bind = CTRL SHIFT, 3, exec, hyprshot -m output | ||
| bind = CTRL SHIFT, 4, exec, hyprshot -m region | ||
| bind = CTRL SHIFT, 5, exec, ~/.config/hypr/scripts/record-screen.sh |
There was a problem hiding this comment.
Comment mentions "3/5" but bindings cover 3, 4, and 5.
The comment on line 357 reads Framework+Shift+3/5 but there are three bindings: 3 (output), 4 (region), and 5 (recording). Update the comment to include 4.
📝 Proposed fix
-# macOS-style screenshot & recording (Framework+Shift+3/5 via keyd → Ctrl+Shift+3/5)
+# macOS-style screenshot & recording (Framework+Shift+3/4/5 via keyd → Ctrl+Shift+3/4/5)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # macOS-style screenshot & recording (Framework+Shift+3/5 via keyd → Ctrl+Shift+3/5) | |
| bind = CTRL SHIFT, 3, exec, hyprshot -m output | |
| bind = CTRL SHIFT, 4, exec, hyprshot -m region | |
| bind = CTRL SHIFT, 5, exec, ~/.config/hypr/scripts/record-screen.sh | |
| # macOS-style screenshot & recording (Framework+Shift+3/4/5 via keyd → Ctrl+Shift+3/4/5) | |
| bind = CTRL SHIFT, 3, exec, hyprshot -m output | |
| bind = CTRL SHIFT, 4, exec, hyprshot -m region | |
| bind = CTRL SHIFT, 5, exec, ~/.config/hypr/scripts/record-screen.sh |
🤖 Prompt for AI Agents
In `@config/hyprland/hyprland.conf` around lines 357 - 360, Update the comment
that currently says "Framework+Shift+3/5" to correctly reflect all three
bindings (3, 4, and 5); locate the comment above the bind lines for the hyprshot
and record-screen commands (the lines binding CTRL SHIFT, 3 → "hyprshot -m
output", CTRL SHIFT, 4 → "hyprshot -m region", and CTRL SHIFT, 5 → "
~/.config/hypr/scripts/record-screen.sh") and change the text to include 4
(e.g., "Framework+Shift+3/4/5" or "Framework+Shift+3-5").
There was a problem hiding this comment.
Pull request overview
Adds additional Hyprland window-management and screenshot/recording keybindings to better match macOS-style shortcuts, and removes a Waybar restart helper from the Makefile.
Changes:
- Add new Hyprland resize bindings (
;/') and a split-orientation toggle ($mod+V). - Add macOS-style screenshot/recording bindings mapped via keyd to
Ctrl+Shift+3/4/5. - Remove the
systemctl-waybarMakefile target and drop it from thesystemctlaggregate target.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| config/hyprland/hyprland.conf | Adds new resize, split toggle, and screenshot/recording keybindings; removes $mod+V VS Code launch binding. |
| Makefile | Removes systemctl-waybar target and updates systemctl dependencies accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bind = SHIFT, PRINT, exec, hyprshot -m window | ||
| bind = CTRL, PRINT, exec, hyprshot -m output | ||
|
|
||
| # macOS-style screenshot & recording (Framework+Shift+3/5 via keyd → Ctrl+Shift+3/5) |
There was a problem hiding this comment.
The comment says “Framework+Shift+3/5 … → Ctrl+Shift+3/5”, but this block also defines a Ctrl+Shift+4 binding. Update the comment to reflect 3/4/5 so the documentation matches the actual keybindings.
| # macOS-style screenshot & recording (Framework+Shift+3/5 via keyd → Ctrl+Shift+3/5) | |
| # macOS-style screenshot & recording (Framework+Shift+3/4/5 via keyd → Ctrl+Shift+3/4/5) |
|
|
||
| .PHONY: systemctl | ||
| systemctl: systemctl-cliproxyapi systemctl-code-syncer systemctl-docker-postgres systemctl-dotfiles-updater systemctl-ollama systemctl-openclaw systemctl-waybar ## Restart all systemd user services. | ||
| systemctl: systemctl-cliproxyapi systemctl-code-syncer systemctl-docker-postgres systemctl-dotfiles-updater systemctl-ollama systemctl-openclaw ## Restart all systemd user services. |
There was a problem hiding this comment.
This PR is described as Hyprland keybinding changes, but this Makefile change removes the systemctl-waybar target and changes the behavior of make systemctl. Either include this in the PR description (and rationale), or move it to a separate PR to keep scope focused.
| @@ -787,15 +787,6 @@ systemctl-openclaw: ## Restart OpenClaw gateway systemd user service. | |||
| @systemctl --user restart openclaw-gateway.service || true | |||
| @echo "✅ openclaw restarted" | |||
|
|
|||
There was a problem hiding this comment.
After removing the systemctl-waybar target, the git-submodule-sync target now immediately follows the “Systemd Services (Linux)” section. Consider re-adding a ##@ Git Submodule section header here to keep the Makefile sections accurate and easy to scan.
| ##@ Git Submodule |
Changes
SUPER + ;/SUPER + 'for horizontal window resizeSUPER + CTRL + ;/SUPER + CTRL + 'for vertical window resizeSUPER + Vfor toggling split orientation (vertical/horizontal)Framework + Shift + 3→ full output screenshotFramework + Shift + 4→ region select screenshotFramework + Shift + 5→ screen recordingSUPER + VVS Code launch bindingTesting
Generated with Claude Code
Summary by cubic
Add ergonomic Hyprland keybindings for window resize, split toggle, and macOS‑style screenshots/recording. Also cleans up old bindings and removes the Waybar restart helper.
New Features
Refactors
Written for commit 3664b26. Summary will update on new commits.