Moon-0xff / gnome-mpris-label

A music related GNOME extension.
GNU General Public License v3.0
50 stars 9 forks source link

label color change #93

Closed slaygun closed 4 months ago

slaygun commented 5 months ago

hey can u lmk how i could change the color of the label text which gets displayed

Batwam commented 5 months ago

hi,

we don't currently have an option for this but you can update _setText() in extensions.js manually around row 485 as follows (example here with red font using hex code):

    _setText() {
        try{
            if(this.player == null || undefined)
                this.label.set_text("")
            else {
                this.label.set_text(buildLabel(this.players,this.settings));
                this.label.set_style('color: #FF0000');
            }
        }
        catch(err){
            log("Mpris Label: " + err);
            this.label.set_text("");
        }
    }

Then logout/ log back in: image

slaygun commented 5 months ago

omg thank u so much im not well versed with javascript so i was having a pretty hard time

slaygun commented 5 months ago

image_2024-01-31_152846243 it works!

Batwam commented 5 months ago

No problem, it's a good suggestion and I was actually thinking this weekend about an option to change the font.

I'll see if I can integrate an option in the Preferences to allow the user to pick a colour easily.

Batwam commented 5 months ago

@slaygun could you please test the solution in #94 ?

slaygun commented 5 months ago

@Batwam what is the command to get that branch

Batwam commented 5 months ago

Sorry, first git clone the other repo: git clone https://github.com/Batwam/gnome-mpris-label-batwam then change to the testing branch by doing git checkout font_colour

or directly git clone -b font_colour https://github.com/Batwam/gnome-mpris-label-batwam

the rest of the installation instructions is the same

slaygun commented 5 months ago

image yes its working!

Batwam commented 5 months ago

ok, that's great. This should allow you to try different colours without having to manually change the code and without having to restart the extension all the time.

Let me see if I can integrate a nice button to select a colour more easily... color-button

Batwam commented 5 months ago

@slaygun I have updated the Preferences to include a button to select the colour. Would you be able to download the latest code and try it? image

slaygun commented 5 months ago

i did and its working :+1:

Batwam commented 5 months ago

Ok, that's great to hear.

i'll give it a couple of days to let things settle and merge if all goes well. Let me know if you face any issues. Are you using gnome 45?

slaygun commented 5 months ago

Okaaay will do. Yes, I'm using gnome 45

Batwam commented 4 months ago

Closing this as the requested feature has now been implemented in #94