9

I would like to start a song from my terminal, starting from the first minute. i.e.: the command will run the music.mp3 starting from the minute 1.

I am able to run a music with

 rhythmbox music.mp3 

However it is starting from 0. How to do it for starting from minute 1?

Anthon
  • 78,313
  • 42
  • 165
  • 222
musicisme
  • 123
  • 1
  • 2
  • 4

1 Answers1

7

Take a look at the command line tool rhythmbox-client. Looking at the options there's a --seek switch which should do what you want.

rhytmbox-client --seek=+60

There are reports that this should work but doesn't. Might be a bug?

As an alternative method you can fire the commands directly yourself using dbus:

# seek forward 60 sec
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Seek int64:60000000
sleep 2    

# skip to next track
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
sleep 2

# toggle play/pause state
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
sleep 2

A bit too verbose for routine command line use, so just pop them into conveniently named scripts, and away you go! The list of commands can be found here.

slm
  • 363,520
  • 117
  • 767
  • 871