mheine / gnome-shell-spotify-label Goto Github PK
View Code? Open in Web Editor NEW🔧 GNOME shell extension to show the currrently playing song on Spotify in the top bar
License: MIT License
🔧 GNOME shell extension to show the currrently playing song on Spotify in the top bar
License: MIT License
Hi, is there anyway you could add a feature which allows a drop down display which opens up when clicked on the label? With all the buttons (pause, play next, rewind), album cover, and a button to redirect to Spotify app?
Hi,
I'm running Fedora 31 and installed spotify via Snap (spotify 1.1.26.501.gbe11e53b-15 41 latest/stable spotify✓ -
)
Unfortunately the extension is not able to display any information about the currently played song.
Executing dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'
shows the following output:
method return time=1593712509.780259 sender=:1.40429 -> destination=:1.41180 serial=786 reply_serial=2
variant array [
dict entry(
string "mpris:trackid"
variant string "spotify:track:1BW2QdLe6RtJTMJDSYmg9w"
)
dict entry(
string "mpris:length"
variant uint64 227440000
)
dict entry(
string "mpris:artUrl"
variant string ""
)
dict entry(
string "xesam:album"
variant string ""
)
dict entry(
string "xesam:albumArtist"
variant array [
string ""
]
)
dict entry(
string "xesam:artist"
variant array [
string ""
]
)
dict entry(
string "xesam:autoRating"
variant double 0
)
dict entry(
string "xesam:discNumber"
variant int32 0
)
dict entry(
string "xesam:title"
variant string ""
)
dict entry(
string "xesam:trackNumber"
variant int32 0
)
dict entry(
string "xesam:url"
variant string "https://open.spotify.com/track/1BW2QdLe6RtJTMJDSYmg9w"
)
]
So spotify does not provide any artist or title information, but the url does change on every track change
is there another way to get the currently played song information? Or do you have any idea why spotify does not provide this information via dbus in my case?
I feel like the README could potentially use an overhaul; particularly the installation instructions. If you feel that you can and/or want to improve the instructions, feel free to create a PR 🎉
When I attempted to download the extension via Gnome Extensions I got an error right away and the following log:
The settings of extension [email protected] had an error:
GLib.FileError: Failed to open file “/home/pedro/.local/share/gnome-shell/extensions/[email protected]/schemas/gschemas.compiled”: open() failed: No such file or directory
Stack trace:
buildPrefsWidget@/home/pedro/.local/share/gnome-shell/extensions/[email protected]/prefs.js:15:44
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:207:40
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
It looks like user Andorius solved the problem with the following instructions:
Works great in Ubuntu 20.0.4, but needs some manual massaging to run. Essentially you need to create the "schemas" sub-folder that wasn't created by the installation, then move the gschemas.compiled folder into it, then restarting GNOME or your PC so the extension picks it up. Full steps are below.
If you like the terminal, run this command after you install the extension:
mkdir ~/.local/share/gnome-shell/extensions/[email protected]/schemas && mv ~/.local/share/gnome-shell/extensions/[email protected]/gschemas.compiled ~/.local/share/gnome-shell/extensions/[email protected]/schemas/
Then, restart GNOME with Alt+F2 > "r" > Enter, or this terminal command (works for me in GNOME 3.36.8):
busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")'
If you want do do this in GUI, use the below.
- Install Extension from this page. You will get an error, this is fine for now.
- Open your terminal or file explorer and navigate to home/.local/share/gnome-shell/extensions/[email protected]/
If you do not see .local, you can click on the hamburger/other menu and click "show hidden files" or use the terminal command I placed above these steps (Open terminal with Ctrl+Alt+T).- Create a new sub-folder named "schemas" (all lower-case)
- Move the file "gschemas.compiled" from the parent folder into the folder you just created.
- Restart Gnome with Alt+F2, type "r" (no quotes) and push enter. Gnome will restart and the extension will work as expected.
Thanks for developing this awesome piece of software!
Hey! Can you make it compatible with Ubuntu 20.04 Focal Fossa?
Hello,
I am just wondering if you could simply add version 40 as an accepted version of Gnome of your extension and create a new release ?
I changed the metadata.json file on my machine to look like this, and it works flawlessly.
{
"name": "Spotify Song Label",
"description": "Show the currently playing song on Spotify in the top bar",
"uuid": "[email protected]",
"shell-version": [
"3.36.4",
"40"
]
}
Thanks for your work, I really appreciate your extension.
I just updated my Fedora 32, now Gnome version 3.36.4 is installed. Looking glass provides the following error for this extension.
TypeError: this.actor.reparent is not a function
I Like the extension a lot, I hope it's fixable.
Is there a way to add plexamp functionality to this?
If an artist or song name contains a "
, it's not parsed completely
the string is cut off just before the first instance of a quotation mark.
As in this song:
Epitaph - Including "March for No Reason" and "Tomorrow and Tomorrow"
gets displayed as:
Epitaph (Including ) - King Crimson
This is because of how this extension extracts both strings from d-bus
var titleBlock = data.substring(data.indexOf("xesam:title"));
var title = titleBlock.split("\"")[2]
var artistBlock = data.substring(data.indexOf("xesam:artist"));
var artist = artistBlock.split("\"")[2]
As you can see, it gets artist and title from a string(substring?) surrounded by quotation marks, so if either string have a quotation mark somewhere it gets cut.
I have a fix to this for a week now (and few others).
I will submit a pull request right away.
when attempting to open the add-on configuration:
Error: No property margin on GtkGrid
Stack trace:
_init/Gtk.Widget.prototype._init@resource:///org/gnome/gjs/modules/core/overrides/Gtk.js:47:50
buildPrefsWidget@/home/jorge/.local/share/gnome-shell/extensions/[email protected]/prefs.js:25:23
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:219:40
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:128:33
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:115:22
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:177:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
run@resource:///org/gnome/gjs/modules/script/package.js:206:19
start@resource:///org/gnome/gjs/modules/script/package.js:190:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
Incorrect spelling of title
in options/config menu
Max string length (Each artist and _**titel**_):
Correct spelling is title
:)
GLib.FileError: Failed to open file “/home/user/.local/share/gnome-shell/extensions/[email protected]/schemas/gschemas.compiled”: open() failed: No such file or directory
Stack trace:
buildPrefsWidget@/home/user/.local/share/gnome-shell/extensions/[email protected]/prefs.js:15:44
_init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:207:40
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
Preferences are not available when the extension is installed via https://extensions.gnome.org/
Only 3 files are downloaded in the extension folder, extension.js, metadata.json and stylesheet.css.
Please update the code on the site.
For titles with 2 hypens, a trailing parentheses is displayed.
In extensions.js
, songs with hypens are assumed to be remixes, but that's not always the case.
See
Song data | Extension Preview | Comment |
---|---|---|
Bug | ||
Bug | ||
OK |
I couldn't find songs with three hypens. You can post a picture below if you find one.
Simple solution:
Assume remix only if -
(spaces) are present.
I'll try to make a PR.
Hey,
if you go to: https://extensions.gnome.org/extension/2603/spotify-label/
and select Shell version: 3.36.4
and Extension version: 3
you will get an archive where #8 is still not fixed.
The gschemas.compiled
and org.gnome.shell.extensions.spotifylabel.gschema.xml
files are still in the root folder and not in the schemas
folder.
Could you update the archive on the extensions page?
Love this extension, was wondering if it was possible to make it work with other music players like rhythm and clementine to
Hey,
first of all.. i totally love this extension :)
This is more a question than an issue, so please forgive me...
Version 3 has defined gnome shell version 3.36.4
in its manifest.json
Is this really required? Or could we lower this to something like 3.30.2
I´m asking because on Debian Buster 3.30.2
is the highest version i can get without adding the backports ore something.
I tried installing the latest version of this extension manually and it works fine AFAIK.
Main thing i need/want is new added settings of the extension so i can tweak it a bit.
Bumping shell-version in metadata.json no longer works.
A quick look at journal-ctf shows deprecation errors.
Currently, there's no settings - which means the label's position is not configurable. I'd like an option to have the label at the right side of the panel.
I figured that human interaction - while scary, as you mentioned - might actually be easier and better for the community than me whipping this up on my own :)
Hey!
I really like this extension and I thought it would look nice to add the spotify icon on the left side of the spotify info, making it look something like this:
I would also be great if you could tweak the size and color of the icon. To my understanding there is two ways to approach this. First create the a class in stylesheet.css
with the icon size and color. Then either: (1) use a icon font (e.g., FontAwesome or IcoFont) which includes the spotify icon. Or (2) use a .svg file of the icon.
From here I am completely lost how to apply this to code. I have tried to look through the to the extension.js
but my knowledge in java script is scarce.
I am very grateful for any suggestions or documentation that could help me to create this. Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.