Skip to content
Advertisement

Linux Shell: VLC programming

Is there a way to manipulate VLC with a Linux shell script without the script waiting for VLC to close.

JavaScript

This code keeps running VLC until the file is completed, and then evidently it is to late to pause the file.

Advertisement

Answer

You need to use dbus interface of VLC.

enter image description here

Now, you can use the mpris interface of VLC. It’s a standard for most players like clementine, banshee, songbird, spotify etc.

So, lets suppose you want to Pause the currently playing song.

JavaScript

To play a song:

JavaScript

I generally use qdbusviewer to know about the dbus-interface available to me.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement