I’m making a Python script to play music through VLC and I wanted to add a way to control audio playback of VLC, like pause/play, next/previous, etc.

I know I can change shuffle mode before launching VLC with the --random and --no-random arguments. However, is there a way to change playback settings through the Linux terminal while VLC is running?

  • floquant@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    18 hours ago

    You can test if a command exists in several ways, but the most portable one should be using command -v which is POSIX.

    if command -v playerctl &> /dev/null
      # do things
    else
      # warn and exit (or prompt for installation)
    end