pear-desktop README

The project's README from github.com/pear-devs/pear-desktop. As one markdown file: README.md.

Special thanks to:

Warp sponsorship

Warp, built for coding with multiple AI agents

Available for macOS, Linux, & Windows


:pear: Pear Desktop

GitHub release GitHub license eslint code style Build status GitHub All Releases

Known Vulnerabilities

[!IMPORTANT] ⚠️ Disclaimer

No Affiliation

This project, and its contributors, are not affiliated with, authorized by, endorsed by, or in any way officially connected with Google LLC, YouTube, or any of their subsidiaries or affiliates. This is an independent, non-profit, and unofficial extension developed by a team of volunteers with the goal of providing a desktop experience.

Trademarks

The names "Google" and "YouTube Music", as well as related names, marks, emblems, and images, are registered trademarks of their respective owners. Any use of these trademarks is for identification and reference purposes only and does not imply any association with the trademark holder. We have no intention of infringing upon these trademarks or causing harm to the trademark holders.

Limitation of Liability

This application (extension) is provided "AS IS", and you use it at your own risk. In no event shall the developers or contributors be liable for any claim, damages, or other liability, including any legal consequences, arising from, out of, or in connection with the software or the use or other dealings in the software. The responsibility for any and all outcomes of using this software rests entirely with the user.

Content

Translation

You can help with translation on Hosted Weblate.

translation status translation status 2

Download

You can check out the latest release to quickly find the latest version.

Arch Linux

Install the pear-desktop package from the AUR. For AUR installation instructions, take a look at this wiki page.

Solus

sudo eopkg install pear-desktop

macOS

You can install the app using Homebrew (see the cask definition):

brew install pear-devs/pear/pear-desktop

If you install the app manually and get an error "is damaged and can’t be opened." when launching the app, run the following in the Terminal:

/usr/bin/xattr -cr /Applications/Pear\ Desktop.app

Windows

You can use the Scoop package manager to install the pear-desktop package from the extras bucket.

scoop bucket add extras
scoop install extras/pear-desktop

Alternately you can use Winget, Windows 11s official CLI package manager to install the pear-devs.pear-desktop package.

Note: Microsoft Defender SmartScreen might block the installation since it is from an "unknown publisher". This is also true for the manual installation when trying to run the executable(.exe) after a manual download here on github (same file).

winget install pear-devs.pear-desktop

How to install without a network connection? (in Windows)

Themes

You can load CSS files to change the look of the application (Options > Visual Tweaks > Themes).

Some predefined themes are available in https://github.com/kerichdev/themes-for-ytmdesktop-player.

Dev

git clone https://github.com/pear-devs/pear-desktop
cd pear-desktop
pnpm install --frozen-lockfile
pnpm dev

Instead of installing pnpm on your system, you can also use devcontainers. You can use devcontainers either as a development environment in VS Code, or as a way to easily build the project without installing dependencies on your host system.

Note that this has it's own limitations (for example, GUI doesn't work on, at least some, Linux hosts).

Build your own plugins

Using plugins, you can:

Creating a plugin

Create a folder in src/plugins/YOUR-PLUGIN-NAME:

import style from './style.css?inline'; // import style as inline

import { createPlugin } from '@/utils';

export default createPlugin({
  name: 'Plugin Label',
  restartNeeded: true, // if value is true, ytmusic show restart dialog
  config: {
    enabled: false,
  }, // your custom config
  stylesheets: [style], // your custom style,
  menu: async ({ getConfig, setConfig }) => {
    // All *Config methods are wrapped Promise<T>
    const config = await getConfig();
    return [
      {
        label: 'menu',
        submenu: [1, 2, 3].map((value) => ({
          label: `value ${value}`,
          type: 'radio',
          checked: config.value === value,
          click() {
            setConfig({ value });
          },
        })),
      },
    ];
  },
  backend: {
    start({ window, ipc }) {
      window.maximize();

      // you can communicate with renderer plugin
      ipc.handle('some-event', () => {
        return 'hello';
      });
    },
    // it fired when config changed
    onConfigChange(newConfig) { /* ... */ },
    // it fired when plugin disabled
    stop(context) { /* ... */ },
  },
  renderer: {
    async start(context) {
      console.log(await context.ipc.invoke('some-event'));
    },
    // Only renderer available hook
    onPlayerApiReady(api, context) {
      // set plugin config easily
      context.setConfig({ myConfig: api.getVolume() });
    },
    onConfigChange(newConfig) { /* ... */ },
    stop(_context) { /* ... */ },
  },
  preload: {
    async start({ getConfig }) {
      const config = await getConfig();
    },
    onConfigChange(newConfig) {},
    stop(_context) {},
  },
});

Common use cases

// index.ts
import style from './style.css?inline'; // import style as inline

import { createPlugin } from '@/utils';

export default createPlugin({
  name: 'Plugin Label',
  restartNeeded: true, // if value is true, pear-desktop will show a restart dialog
  config: {
    enabled: false,
  }, // your custom config
  stylesheets: [style], // your custom style
  renderer() {} // define renderer hook
});
import { createPlugin } from '@/utils';

export default createPlugin({
  name: 'Plugin Label',
  restartNeeded: true, // if value is true, ytmusic will show the restart dialog
  config: {
    enabled: false,
  }, // your custom config
  renderer() {
    console.log('hello from renderer');
  } // define renderer hook
});

Build

  1. Clone the repo
  2. Follow this guide to install pnpm
  3. Run pnpm install --frozen-lockfile to install dependencies
  4. Run pnpm build:OS

Builds the app for macOS, Linux, and Windows, using electron-builder.

Building in devcontainer

  1. Clone the repo;
  2. Open the folder in VS Code;
  3. Reopen in container when prompted;
  4. Run pnpm build as above (choosing the desired target);
  5. Collect the built files from the dist folder.

Since devcontainer uses a mount for the workspace, the built files will be available on the host system as well.

Production Preview

pnpm start

Tests

pnpm test

Uses Playwright to test the app.

License

MIT © pear-devs

FAQ

Why apps menu isn't showing up?

If Hide Menu option is on - you can show the menu with the alt key (or ` [backtick] if using the in-app-menu plugin)

pear-desktop (pear-devs/pear-desktop)

Searching Database…

这是什么?Pear 是一个开源的 Electron 桌面应用,它把 YouTube Music 包装成用起来像原生应用的界面。它由志愿者独立开发,与 Google 或 YouTube 没有任何官方关联。
这是浏览器扩展还是独立应用?这是一个用 Electron 构建的独立原生桌面应用,不是浏览器扩展。它分别为 macOS、Linux 和 Windows 单独构建和发布。
使用它需要安装 pnpm 或 Node 吗?预编译的发行版不需要,下载后直接运行即可。从源码构建则需要 Node 22+ 和 pnpm 11+,然后依次执行 `pnpm install --frozen-lockfile` 和 `pnpm build:OS`。
安装时有哪些需要注意的坑吗?在 Windows 上,Microsoft Defender SmartScreen 可能会把安装程序标记为来自“未知发布者”;在 macOS 上,手动安装的应用可能会显示“已损坏,无法打开”的错误,需要在终端中执行一条命令才能修复。
可以用主题或自定义 CSS 修改外观吗?可以。在 Options > Visual Tweaks > Themes 中可以加载自定义 CSS 文件,项目还自带几款预设主题,方便你快速上手。
我可以自己编写插件吗?可以。在 src/plugins/YOUR-PLUGIN-NAME 下新建一个文件夹,并放入 index.ts 文件即可。插件可以获取 Electron 的 BrowserWindow,从而注入 CSS、修改 HTML,或通过 ipcMain 与主进程通信。
没有网络连接时,能在 Windows 上安装吗?可以。从发布页面下载与你的系统架构对应的 .nsis.7z 文件,以及相应的 -Setup.exe 安装程序,把它们放在同一个文件夹里,然后离线运行安装程序即可。
Creator
pear-devs
Size
22.5 MB
Stars
33.8K
Age
7y
Commits · 90 Days