Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3296  / 2 Years ago, wed, march 9, 2022, 9:03:19

After googling for a while now I'm unable(-.-) to find a solution for this:


I want to tell my standard(as noted in settings) music/video player to play/stop/next via terminal. But with a global command and not /usr/bin/banshee --next command for example.


Here is what I found till now: X86AudioNext(keyboard keys), xmodmap(organisation of keyboard keys).


More From » xmodmap

 Answers
1

There is no general answer to your question, since music players can implement whatever they want.


However, the default players for Ubuntu all implement the mpris2 interface (if they are integrated into the soundmenu). Therefore they can be controlled via the command line.


One possible script to use is here: pympris.


You can run it like this:



mpris2-remote.py play


mpris2-remote.py stop


mpris2-remote.py next



If you prefer something more basic, you can look at the mpris2 definition here.


Alternatively you can emulate the gnome multimedia keys as you already wrote in your question.


[#39574] Friday, March 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
utilitere

Total Points: 394
Total Questions: 110
Total Answers: 114

Location: Solomon Islands
Member since Wed, Mar 29, 2023
1 Year ago
;