Skip to content

Global shortcut setup: install scripts + docs for Linux, macOS, Windows#15

Open
pgivel wants to merge 3 commits intomainfrom
pgivel/issue4
Open

Global shortcut setup: install scripts + docs for Linux, macOS, Windows#15
pgivel wants to merge 3 commits intomainfrom
pgivel/issue4

Conversation

@pgivel
Copy link
Copy Markdown
Collaborator

@pgivel pgivel commented Mar 30, 2026

Summary

Closes #4 — Provide a way to launch Screen Ruler with a global keyboard shortcut, without requiring a persistent daemon.

Changes

Linux (install-linux.sh)

  • Copies binary to install dir, generates .desktop entry with correct Exec= path
  • Detects DE (XDG_CURRENT_DESKTOP + process fallback) and auto-registers Super+Shift+R:
    • GNOME: gsettings custom keybinding (idempotent, finds next free slot)
    • KDE Plasma: kwriteconfig5/kwriteconfig6kglobalshortcutsrc
    • Hyprland: appends bind to hyprland.conf
    • Sway: appends bindsym to sway/config
  • Refreshes app database with update-desktop-database

macOS (install-macos.sh)

  • Copies binary, generates an Automator Quick Action (.workflow) that launches screen-ruler
  • Prints instructions for binding a shortcut in System Settings

Windows (install-windows.ps1)

  • Copies binary, adds install dir to user PATH
  • Creates a Start Menu .lnk shortcut with Ctrl+Shift+R hotkey

Documentation

  • README.md: unified "Global keyboard shortcut" section with per-platform subsections
  • docs/manual-shortcut-setup.md: manual instructions for all platforms (Linux DEs, macOS Automator/Shortcuts/third-party, Windows .lnk/PowerToys/AutoHotkey)

@pgivel pgivel requested a review from Copilot March 30, 2026 15:33
@pgivel pgivel self-assigned this Mar 30, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds cross-platform installation scripts and documentation to launch Screen Ruler via a global keyboard shortcut (without a persistent daemon), aligning with Issue #4’s goal of “summon-on-demand” usage.

Changes:

  • Added Linux/macOS/Windows install scripts to copy the built binary and register a default global hotkey (or provide guided setup).
  • Added a .desktop template and expanded documentation (README + manual setup guide) for platform-specific shortcut configuration.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
install-linux.sh Installs binary + .desktop entry and attempts DE-specific shortcut registration (GNOME/KDE/Hyprland/Sway).
install-macos.sh Installs binary and generates an Automator Quick Action workflow plus shortcut-binding instructions.
install-windows.ps1 Installs .exe, updates user PATH, and creates a Start Menu .lnk with a hotkey.
screen-ruler.desktop Provides a baseline desktop entry template for Linux launchers.
docs/manual-shortcut-setup.md Manual per-platform shortcut setup instructions for unsupported environments.
README.md Adds a unified “Global keyboard shortcut” section with per-platform directions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install-linux.sh Outdated
Comment thread install-linux.sh
Comment thread install-windows.ps1 Outdated
Comment thread install-linux.sh Outdated
Comment thread install-linux.sh Outdated
Comment thread install-linux.sh
Comment thread install-macos.sh Outdated
Comment thread install-macos.sh Outdated
Comment thread install-windows.ps1 Outdated
@pgivel pgivel force-pushed the pgivel/issue4 branch 2 times, most recently from dd4cf7d to 6f01208 Compare April 8, 2026 14:09
@pgivel pgivel requested a review from Copilot April 8, 2026 14:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install-linux.sh
Comment thread install-linux.sh
Comment thread install-linux.sh Outdated
Comment thread screen-ruler.desktop Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install-macos.sh
Comment thread install-linux.sh
Comment thread install-linux.sh
Comment thread install-linux.sh
pgivel added 3 commits April 8, 2026 17:50
- install-linux.sh: copies binary, generates .desktop with correct Exec path,
  auto-registers Super+Shift+R shortcut (GNOME/KDE/Hyprland/Sway)
- screen-ruler.desktop: static template for manual use
- docs/manual-shortcut-setup.md: per-DE manual instructions
- README: global shortcut section pointing to install script
- install-macos.sh: copies binary, generates an Automator Quick Action
  (.workflow) that launches screen-ruler, prints instructions for binding
  a keyboard shortcut in System Settings
- Merge manual-shortcut-setup-macos.md into manual-shortcut-setup.md
  with Linux and macOS top-level sections
- README: unified Global keyboard shortcut section with per-platform
  subsections
- install-windows.ps1: copies binary, adds to user PATH, creates a
  Start Menu .lnk shortcut with Ctrl+Shift+R hotkey via WScript.Shell
- docs/manual-shortcut-setup.md: Windows section with .lnk, PowerToys,
  and AutoHotkey alternatives
- README: Windows subsection under Global keyboard shortcut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global shortcut setup (.desktop file + platform docs)

2 participants