Git Product home page Git Product logo

desktop-lyric's Introduction

desktop-lyric

Show the lyric of playing songs on the desktop.

很多歌消失了。 —— 汪曾祺 《徙》
license


bee

Installation

Manual

The latest and supported version should only work on the most current stable version of GNOME Shell.

git clone https://github.com/tuberry/desktop-lyric.git && cd desktop-lyric
meson setup build && meson install -C build
# meson setup build -Dtarget=system && meson install -C build # system-wide, default --prefix=/usr/local

For older versions (< 44), it's recommended to install via:

E.G.O

Get it on GNOME Extensions

Features

dlpref

Notes

  • High CPU usage;
  • Prefer lyrics from xseam:asText in Mpris metadata;
  • The lyrics (LRC format) filename format is Title-Artist1,Artist2-Album.lrc;
  • Draw at an even pace so that exact synchronization with the song is not guaranteed;

Contributions

Any contribution is welcome.

Ideas

For any question or idea, feel free to open an issue or PR in the repo.

Translations

To update the po file from sources:

bash ./cli/update-po.sh [your_lang_code] # like zh_CN, default to $LANG

Developments

To install GJS TypeScript type definitions:

npm install @girs/gnome-shell --save-dev

Acknowledgements

desktop-lyric's People

Contributors

mechtifs avatar tuberry avatar vistaus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

desktop-lyric's Issues

Not working on Arch

is there some package i should install?

and second can you put lyrics to top bar? i would be perfection.

无法修改歌词颜色

非常棒的GNOME shell扩展👍🏻,感谢开发者🙏🏻

但是我遇到了一点问题,我无法修改扩展中的三个颜色设置

image

其余功能一切正常,我使用GNOME40在Fedora34上

Error on Install extension

During installation that extension on page gnome extensions on firefox, I opened extension configuration widow and appears this message.
image

The message is below:

The settings of extension desktop-lyric@tuberry had an error:

SyntaxError: expected expression, got '.'

Stack trace:

@/home/tarciano/.local/share/gnome-shell/extensions/desktop-lyric@tuberry/prefs.js:10:12
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:204:33
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:222:19
start@resource:///org/gnome/gjs/modules/script/package.js:206:5
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17

[Bug] Compatibility with other extensions

// extension.js

...
class DesktopLyric {
    constructor() {
        ...
        Main.overview.connectObject('showing', () => (this.view = true),
            'hiding', () => (this.view = false), this);
        ...
    }
     ...
}
...

^ For some reason, this line of code is creating an unexpected issue.

Steps to reproduce:

  • Create an extension that receives showing signal

    // test1 extension.js
    
    const Main = imports.ui.main;
    
    class Extension {
        constructor() {}
    
        enable() {
      	  Main.overview.connectObject(
      		  'showing', () => log('test1 SHOWING'),
      		  'shown', () => log('test1 SHOWN'),
      		  'hiding', () => log('test1 HIDING'),
      		  'hidden', () => log('test1 HIDDEN'), this);
        }
    
        disable() {
            Main.overview.disconnectObject(this);
        }
    }
    
    function init() {
        return new Extension();
    }
  • Log in with both test1 and desktop-lyric enabled, then spam Super key (or any other method to open up and close overview)

    Output from journalctl -f -o cat /usr/bin/gnome-shell:

    test1 SHOWING
    test1 SHOWN
    test1 HIDING
    test1 HIDDEN
    test1 SHOWING
    test1 SHOWN
    test1 HIDING
    test1 HIDDEN
    ...
    
  • Re-enable test1, then spam Super key again

    Output from journalctl -f -o cat /usr/bin/gnome-shell:

    test1 SHOWN
    test1 HIDING
    test1 HIDDEN
    test1 SHOWN
    test1 HIDING
    test1 HIDDEN
    ...
    

    The test1 SHOWING line is clearly missing, and this affects both X11 and Wayland sessions.

With desktop-lyric disabled, I've tested out other combinations between test1 and test2 below, which didn't reproduce the same issue.

// test2 extension.js

const Main = imports.ui.main;

class Test {
	constructor() {
		Main.overview.connectObject(
			'showing', () => log('test2 SHOWING'),
			'shown', () => log('test2 SHOWN'),
			'hiding', () => log('test2 HIDING'),
			'hidden', () => log('test2 HIDDEN'), this);
	}

	destroy() {
        	Main.overview.disconnectObject(this);
	}
}

class Extension {
	constructor() {}

	enable() {
        	this._ext = new Test();
	}

	disable() {
        	this._ext.destroy();
		this._ext = null;
	}
}

function init() {
	return new Extension();
}

To be fair, no one is re-enabling extensions all the time. However GNOME will re-enable all extensions if woken up from hibernation. This issue is kinda annoying to say the least, however I couldn't locate where is actually causing the issue.

Test environments:

I mean the lyrics source

I really recommend music match. Not to start a war here but I think downloading lyrics from a Chinese website isn't safe and especially because I'm a Taiwanese, hoping that Winnie Xi won't use phishing attacks through that webease website.

Support GNOME 44

image
There're many software repositories update to gnome 44 but not 45, such as nixos-unstable, please consider them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.