Code review comment for lp:~ertain/elementaryos/pause-media-player-script

Revision history for this message
Jason Anderson (ertain) wrote :

Okay, I have managed to get it to work.

What I have done is used setuid and checked whether the user is running
the media player. I had to use qdbus exclusively just to get the media
player and to tell it to pause.

I'll update my branch soon with the latest script.

On 12/26/2014 07:51 PM, Sergey "Shnatsel" Davidoff wrote:
> Review: Needs Fixing
>
>> What's also strange is that, when I test this script (e.g. closing my laptop lid to send the omputer into suspension), it doesn't pick up the currently playing media player.
>
> That's because your script runs as root, not as the "current user" of which there may be several - multiseat is still a thing, not to mention several users being logged in at the same time.
>
> So you'd have to iterate over all the users currently logged in, drop privileges to each user and then execute your MPRIS poking magic.
>

« Back to merge proposal