Skip to content

Plugin: Global Keybinds#4104

Open
gabrielpastori1 wants to merge 17 commits into
pear-devs:masterfrom
gabrielpastori1:global-keybindings
Open

Plugin: Global Keybinds#4104
gabrielpastori1 wants to merge 17 commits into
pear-devs:masterfrom
gabrielpastori1:global-keybindings

Conversation

@gabrielpastori1

Copy link
Copy Markdown

Global Keybinds Plugin

This plugin enables system-wide global keyboard shortcuts for the music player. It allows you to control media playback, volume, and track ratings (like/dislike) from anywhere in your operating system, even when the application is minimized or not in focus.

🚀 Features

  • Global Control: Control your music while working in other applications.
  • Customizable: Remap any action to your preferred key combination via the plugin settings.
  • Smart Double-Tap: A unique feature that allows you to toggle the player window's visibility by double-pressing the Play/Pause shortcut.

🎹 Default Shortcuts

By default, the plugin is configured with the following key combinations (using Shift + Ctrl to avoid conflicts with common system shortcuts):

Action Default Shortcut
Play / Pause Shift + Ctrl + Space
Next Track Shift + Ctrl + Right Arrow
Previous Track Shift + Ctrl + Left Arrow
Volume Up Shift + Ctrl + Up Arrow
Volume Down Shift + Ctrl + Down Arrow
Like Track Shift + Ctrl + =
Dislike Track Shift + Ctrl + -

⚙️ Configuration & Options

You can customize the behavior and key assignments through the plugin menu.

Remapping Keys

Click on the "Keybinds Management" option in the plugin menu. A prompt will appear allowing you to press the new key combination you wish to assign to each action.

Window Visibility Toggle (Double Tap)

  • Option: Double Tap to Toggle Window Visibility
  • Default: Enabled
  • How it works:
    • Single Press on the Play/Pause shortcut: Toggles media playback.
    • Double Press (quickly): Shows or Hides the application window.

Note: If you disable this option, the Play/Pause shortcut will only control playback, regardless of how fast you press it.

👨‍💻 Author

Gabriel Pastori

🤝 Credits

This plugin was developed using the precise-volume plugin as a base and reference.

@sharkslovegaming

Copy link
Copy Markdown

How do I add this? Not having a working global keybind is so annoying.

@gabrielpastori1

Copy link
Copy Markdown
Author

How do I add this? Not having a working global keybind is so annoying.

@sharkslovegaming for now we need to wait for the project maintainers to review these changes and publish a new version of the app with the global keybind support.

If you’re comfortable with the technical side, you can check out my branch (https://github.com/gabrielpastori1/pear-desktop/tree/global-keybindings) and build the app locally to use it right away—that’s what I’m doing at the moment.

@gabrielpastori1

Copy link
Copy Markdown
Author

@ArjixWasTaken and @JellyBrick, can you review my PR please?

Comment thread src/index.ts
: is.macOS()
? 'hiddenInset'
: 'default',
? 'hiddenInset'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ··

Suggested change
? 'hiddenInset'
? 'hiddenInset'

Comment thread src/index.ts
? 'hiddenInset'
: 'default',
? 'hiddenInset'
: 'default',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ··

Suggested change
: 'default',
: 'default',

Comment thread src/index.ts
: is.windows()
? userAgents.windows
: userAgents.linux;
? userAgents.windows

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ··

Suggested change
? userAgents.windows
? userAgents.windows

Comment thread src/index.ts
? userAgents.windows
: userAgents.linux;
? userAgents.windows
: userAgents.linux;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ··

Suggested change
: userAgents.linux;
: userAgents.linux;

Comment thread src/index.ts
if (acc.cancel) {
return acc;
}
return listeners.reduce(async (accumulator, listener) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ⏎········

Suggested change
return listeners.reduce(async (accumulator, listener) => {
return listeners.reduce(
async (accumulator, listener) => {

Comment thread src/index.ts
const acc = await accumulator;
if (acc.cancel) {
return acc;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ··

Suggested change
}
}

Comment thread src/index.ts
return { ...accumulator, ...result };
},
Promise.resolve({ cancel: false }),
const result = await listener.apply();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ··

Suggested change
const result = await listener.apply();
const result = await listener.apply();

Comment thread src/index.ts
},
Promise.resolve({ cancel: false }),
const result = await listener.apply();
return { ...accumulator, ...result };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ··

Suggested change
return { ...accumulator, ...result };
return { ...accumulator, ...result };

Comment thread src/index.ts
Promise.resolve({ cancel: false }),
const result = await listener.apply();
return { ...accumulator, ...result };
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ··

Suggested change
},
},

Comment thread src/index.ts
const result = await listener.apply();
return { ...accumulator, ...result };
},
Promise.resolve({ cancel: false }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ··

Suggested change
Promise.resolve({ cancel: false }),
Promise.resolve({ cancel: false }),

@JellyBrick JellyBrick added the enhancement New feature or request label Jan 29, 2026
@JellyBrick

Copy link
Copy Markdown
Member

Did you use an AI tool to create this PR?

@gabrielpastori1

Copy link
Copy Markdown
Author

Did you use an AI tool to create this PR?

No, the only part where AI was used was in the readme and for bug checking.

Comment on lines +41 to +45
## 👨‍💻 Author

**Gabriel Pastori**
* 🇧🇷 Brazilian Developer
* GitHub: [gabrielpastori1](https://github.com/gabrielpastori1)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The official way we declare authorship of plugins is via the authors property when declaring the plugin.

e.g. https://github.com/pear-devs/pear-desktop/blob/master/src/plugins/synced-lyrics/index.ts#L14

You can either supply your GitHub username (gabrielpastori1) or use the git author syntax (Gabriel Pastori <email-address>)

The README file feels out of place and has no visibility for the end-user.
(well, the authors property has no visibility either, but that will change once #3066 is merged)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you feel like the current plugin details are limiting, you can ofc make suggestions to help improve the details system for all plugins.

But using a random README file is unstructured and does no justice to the plugin

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants