sakithb / media-controls

A media indicator for the Gnome shell.
MIT License
244 stars 37 forks source link

Add ability to hide controls with shortcut #157

Closed joes-mama closed 4 months ago

joes-mama commented 4 months ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I'd love to have the ability to hide the player temporarily for a certain media.

Describe the solution you'd like A clear and concise description of what you want to happen.

Add to the list of options for the shortcuts one to hide the controls for the current media. ie. Hide for spotify until I close spotify.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

The only similar thing currently available is manually disabling and re-enabling the extension which is obviously just a big pain. Or I can disable it for a whole app (eg. firefox) which is overkill and means that I don't get to use the extension as much as I want. The similar functionality I'd like is like right clicking to quit the player.

Additional context Add any other context or screenshots about the feature request here.

It would really make this the perfect extension for me. I don't want the controls to always be hidden for a whole app like Firefox (which I can do). But sometimes I want to have them disabled quickly while I am watching one thing in particular.

Thanks for a solid extension

ChrisLauinger77 commented 4 months ago

I do not think we will implement this. Sounds really exotic and not useful for the majority of users. But how about just disable the extension over a shortcut in gnome ?

toggle-gnome-shell-extension.sh mediacontrols@cliffniff.github.com

Content of toggle-gnome-shell-extension.sh

#!/bin/bash

installed=`gnome-extensions list | grep $1`
enabled=`gnome-extensions list --enabled | grep $1`
if [ "$installed" != "$1" ];
then
    notify-send "Extension is not installed" "$1"
    exit 0
fi

if [ "$enabled" = "$1" ];
then
    notify-send --hint=int:transient:1 "Disabled extension" "$1"
    `gnome-extensions disable $1`
else
    notify-send --hint=int:transient:1 "Enabled extension" "$1"
    `gnome-extensions enable $1`
f`i

This script can be called with the name of the extension (in our case mediacontrols@cliffniff.github.com). When then extension is enabled - it disables it and vice versa. So it toggles the extension. (when you want hide the controls - just disable the extension, when you wanna show them again enable the extension) A shortcut for this can be added in gnome and you are good to go ...

toggle-gnome-shell-extension.zip