Skip to content

dual-key-remap: Add manifest for v0.11#17461

Open
OmiChrome wants to merge 4 commits intoScoopInstaller:masterfrom
OmiChrome:add-dual-key-remap
Open

dual-key-remap: Add manifest for v0.11#17461
OmiChrome wants to merge 4 commits intoScoopInstaller:masterfrom
OmiChrome:add-dual-key-remap

Conversation

@OmiChrome
Copy link
Copy Markdown

@OmiChrome OmiChrome commented Mar 23, 2026

New Manifest: dual-key-remap v0.11

Homepage: https://github.com/ililim/dual-key-remap
License: GPL-2.0-only
Description: Remap any key to any other two keys on Windows. Remap CapsLock to both Ctrl and Escape!

Features

  • checkver / autoupdate for automatic version tracking via GitHub releases
  • persist for config.txt so user config survives updates
  • Startup helper (install-dual-key-startup) that registers a Windows Scheduled Task at Highest RunLevel, pointing through the Scoop current symlink so it never breaks on update

Checklist

  • Manifest is valid JSON
  • checkver / autoupdate configured
  • Hash matches release asset
  • License SPDX identifier used

Summary by CodeRabbit

  • New Features
    • Added the dual-key-remap application to the package manager, allowing users to install a Windows keyboard remapping tool that sets up automatic startup (scheduled task) and supports auto-update/version checks.
  • Chores
    • Added a manifest to enable installation, startup registration, and update metadata for the application.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c27ee995-4a0a-4a93-9e75-5c80430c8d3d

📥 Commits

Reviewing files that changed from the base of the PR and between 2956738 and 9c41ad8.

📒 Files selected for processing (1)
  • bucket/dual-key-remap.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • bucket/dual-key-remap.json

Walkthrough

Added a new Scoop package manifest for the Windows dual-key-remap app that declares release metadata, download URL and hash, installs two files, and uses a PowerShell installer to register an elevated scheduled task to run the app at user logon and attempt immediate elevated launch.

Changes

Cohort / File(s) Summary
Scoop Package Manifest
bucket/dual-key-remap.json
New Scoop manifest (v0.11) with metadata (description, homepage, GPL-2.0-only), GitHub release download URL and SHA-256, PowerShell installer that writes install-dual-key-startup.ps1, registers a DualKeyRemap scheduled task (run at logon, highest privileges, interactive), checks for dual-key-remap.exe, logs output, attempts immediate elevated start if no process exists, declares installed files and config persistence, and sets autoupdate/version extraction via GitHub.

Sequence Diagram(s)

sequenceDiagram
    participant UserInstaller as "Scoop/Installer (PowerShell)"
    participant FileSystem as "File System"
    participant TaskScheduler as "Windows Task Scheduler"
    participant Process as "dual-key-remap.exe (Process)"

    UserInstaller->>FileSystem: write install-dual-key-startup.ps1
    UserInstaller->>TaskScheduler: register 'DualKeyRemap' scheduled task (logon, highest, interactive)
    TaskScheduler-->>UserInstaller: registration output / status
    UserInstaller->>FileSystem: verify dual-key-remap.exe exists
    alt exe missing
        UserInstaller->>UserInstaller: error out
    else exe present
        UserInstaller->>Process: check if running
        alt not running
            UserInstaller->>Process: attempt elevated start
            Process-->>UserInstaller: start status
        else running
            Process-->>UserInstaller: already running
        end
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • z-Fng

Poem

🐇 I hopped a manifest into the bin,
Wrote a script, set a task to begin,
Dual keys remapped with a gentle thump,
Startup secured—no more key stump! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is well-structured with manifest details, features, and a completed checklist, but it does not include the required conventional PR title format or link to related issues. Add a reference to a related issue (Closes #XXXX or Relates to #XXXX) and confirm adherence to the conventional PR title format in the description.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a manifest for dual-key-remap version 0.11 to the Scoop bucket.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

dual-key-remap

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bucket/dual-key-remap.json`:
- Around line 21-23: The scheduled task currently dereferences the Scoop symlink
by using (Get-Item "$PSScriptRoot").Target which embeds a concrete version path
into $scoopDir and breaks after updates; change the logic in the startup script
around $scoopDir/$PSScriptRoot/$exe to prefer the stable 'current' symlink path
(e.g., set $scoopDir to Join-Path $PSScriptRoot 'current' if that path exists
and is a symlink), and only fall back to $PSScriptRoot when 'current' is absent,
ensuring the fallback handles empty/null and non-existent paths so the task
always points at the moving 'current' link instead of a pinned versioned folder.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c6496055-ce6f-4d2c-a5b1-86f39d8ff2bc

📥 Commits

Reviewing files that changed from the base of the PR and between 5efc14a and 2956738.

📒 Files selected for processing (1)
  • bucket/dual-key-remap.json

Comment thread bucket/dual-key-remap.json Outdated
@OmiChrome
Copy link
Copy Markdown
Author

Good catch @coderabbitai — you're absolutely right.

I originally used (Get-Item "").Target thinking I needed to resolve the symlink at install time, but that's the wrong direction: it pins the task to the concrete versioned folder (e.g.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 23, 2026

Tip

For best results, initiate chat on the files or code changes.

@NormTurtle: Thanks for the confirmation! Your message appears to have been cut off, but the key point is clear — using (Get-Item "…\current").Target resolves the symlink at install time and pins the scheduled task to a specific versioned folder (e.g., …\0.11\dual-key-remap.exe). After a Scoop update bumps the version, the task would point to the old path and break.

The fix is to reference the current symlink directly, for example:

$exePath = "$env:SCOOP\apps\dual-key-remap\current\dual-key-remap.exe"

Since Scoop keeps current updated on every scoop update, the scheduled task will automatically pick up new versions without needing to be re-registered. Looking forward to the updated manifest!

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 23, 2026

Tip

For best results, initiate chat on the files or code changes.

@NormTurtle: That's exactly right — $PSScriptRoot in a script placed under current\ is already the symlink directory itself, so there's no need to dereference it. The simplified form is both more correct and cleaner. Great fix!


✏️ Learnings added
Learnt from: NormTurtle
URL: https://github.com/ScoopInstaller/Extras/pull/17461

Timestamp: 2026-03-23T14:11:12.563Z
Learning: In ScoopInstaller/Extras manifests that register Windows Scheduled Tasks via a PowerShell startup helper script, the script's `$PSScriptRoot` already resolves to the stable `current\` symlink directory (since Scoop runs scripts from there). Using `(Get-Item "$PSScriptRoot").Target` to dereference the symlink is incorrect — it pins the task to the concrete versioned folder (e.g., `0.11\`), causing the task to break after `scoop update` advances `current\` to a new version. The correct pattern is to use `$PSScriptRoot` directly, e.g., `$exePath = "$PSScriptRoot\dual-key-remap.exe"`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: z-Fng
Repo: ScoopInstaller/Extras PR: 17382
File: bucket/scoop-sd.json:10-10
Timestamp: 2026-03-10T14:34:09.178Z
Learning: In ScoopInstaller/Extras, when a checkver URL references an older GitHub owner/username (e.g., `ergolyam/scoop-search-directory`) that differs from the current owner used in homepage/autoupdate (e.g., `grisha765/scoop-search-directory`), this may simply indicate a GitHub account rename. GitHub automatically redirects API requests from the old username/repo path to the new canonical location indefinitely (unless a new repo is created at the old path). Do not flag such mismatches as errors; the ScoopInstaller workflow is expected to automatically update the URLs to the current canonical name in the future.

If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@OmiChrome
Copy link
Copy Markdown
Author

@z-Fng everything is clear
alright?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant