Code Monkey home page Code Monkey logo

gnome-shell-spotify-label's Introduction

Heya! 👋

I'm Marcus Heine. By day I work as a backend developer, mostly working in node.js. When I'm not at the office (or working remotely) I like to tinker with my configuration files, play around with visualizations of all sorts, or just create small pieces of (hopefully) helpful software. I'm a strong supporter of open source, and will always use them for both my personal and my professional projects if possible.

If you find a repository you like, if you want to know more about what I do, or if you just want to talk, feel free to get in touch with me! My socials and other information can be found on my personal website.

Cheers! 🍻 💻

gnome-shell-spotify-label's People

Contributors

koolskateguy89 avatar mheine avatar raujonas avatar sanjarcode avatar

Stargazers

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

Watchers

 avatar

gnome-shell-spotify-label's Issues

Click to toggle Spotify window/work window is not working

I have the option enabled:
image

But it does not work. I am on Fedora 35 and have spotify installed via flatpak:

➜  ~ flatpak list
Name                                       Application ID                                         Version                 Branch        Origin     Installation
Spotify                                    com.spotify.Client                                     1.1.68.632.g2b11de83    stable        flathub    system

Configurable position

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 :)

GLIB.FileError

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

Bug - Trailing parentheses for title with 2 hypens

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.

Feature request: Add spotify logo

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:

extension-mockup

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.

Parsing errors when strings contains quotation marks

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.

Gnome 40 ?

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.

Error on Installation

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

Update (that was quick)

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.

  1. Install Extension from this page. You will get an error, this is fine for now.
  2. 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).
  3. Create a new sub-folder named "schemas" (all lower-case)
  4. Move the file "gschemas.compiled" from the parent folder into the folder you just created.
  5. 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!

Hide label if Spotify is off

The extension works nicely if spotify is ON. But it clogs the top bar if Spotify is off. Can the label be turned off if spotify is closed.
image

Update and clean up the README

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 🎉

Error in Gnome version 41.3: No property margin on GtkGrid

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

not working with spotify installed via snap

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?

Redirect to Spotify

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?

Feature request

Love this extension, was wondering if it was possible to make it work with other music players like rhythm and clementine to

Not working with Gnome 3.36.4

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.

Question: Shell version 3.36.4 really required?

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.

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.