danigm / spotify-ad-blocker

GNOME shell extension to mute spotify ads
GNU General Public License v3.0
57 stars 8 forks source link

Preference for hiding icon on status bar #6

Closed sanjarcode closed 1 year ago

sanjarcode commented 3 years ago

I don't think anyone wants to listen to ads occasionally. So it would be great if you could have an option to hide the icon.

Ftamino commented 2 years ago

just remove constructor() { this.media = new Mpris.MediaSection(); this.player = null; this.playerWatchTimeoutId = 0; this.activated = false; this.playerId = 0; this.button = new St.Bin({ style_class: 'panel-button', reactive: true, can_focus: true, track_hover: true });

    this.music_icon = new St.Icon({
        icon_name: 'folder-music-symbolic',
        style_class: 'system-status-icon'
    });

    this.ad_icon = new St.Icon({
        icon_name: 'tv-symbolic',
        style_class: 'system-status-icon'
    });

    this.button.set_child(this.music_icon);
    this.button.connect('button-press-event', this.toggle.bind(this));

    this.muted = false;
    this.muteTimeout = 0;
    this.enable();
}

in extension.js

sanjarcode commented 2 years ago

Thanks for the code. I'll try to add this as a preference in the extension settings, but keep it OFF by default.

Will post PR soon.