tizonia / tizonia-openmax-il

Command-line cloud music player for Linux with support for Spotify, Google Play Music, YouTube, SoundCloud, TuneIn, iHeartRadio, Plex servers and Chromecast devices.
https://tizonia.org
GNU Lesser General Public License v3.0
1.69k stars 87 forks source link

next song and random #590

Open ghost opened 5 years ago

ghost commented 5 years ago

Hello,

Is it possible to have keyboard shortcuts in the command line?

That is, type something like: tizonia -n to put the next song?

second thing, when you want a playlist given the list and always in the same order regardless of the listening platform. Is there a way that the chonson is totally random at each reading?

Thank you in advance

Sorry for my English I am French.

versions

tizonia 0.18.0.

Psycoguana commented 5 years ago

For the next song type n while playing something. For shuffle type something like: tizonia --soundcloud-user-playlist some_playlist -s, -s being the shuffle option.

For more commands type : tizonia --help keyboard and tizonia --help global

ghost commented 5 years ago

thank you but the problem is that I would like to order in order to integrate domotic ...

-s ist perfect !!!

jofftiquez commented 5 years ago

This should be on the documentation.

ghost commented 5 years ago

In which documentation? because I can not find anything

tizonia commented 5 years ago

Hi all!,

thanks for the feedback.

With regards to the documentation, have you guys looked through the docs at http://docs.tizonia.org/? The documentation is very basic but there are some screenshots that should be helpful. E.g.:

Contributions are more than welcome, If anybody feels like helping with the docs, let me know. Doc sources are located in https://github.com/tizonia/tizonia-openmax-il/tree/master/docs

@jeremya37

I would like to order in order to integrate domotic ...

At the moment Tizonia is currently all about automatically generated playlists provided by the various services, or user playlists that are located in the cloud. For example, you can create your own playlist in Spotify, Google Play Music, SoundCloud or YouTube and get those played back with Tizonia. However, you can't feed local playlists to Tizonia in either pls or m3u formats. There is no support for that right now. If you are interested, please feel free to raise a separate issue with your suggestion.

ghost commented 5 years ago

ok i am just looking for a command to type in the terminal to go to the next music. To replace the keyboard -n

tizonia commented 5 years ago

@jeremya37 Sorry for the delayed reply.

Are you saying that you would like to use some command on another terminal, different from where Tizonia is running? Tizonia supports MPRISv2 and you could control Tizonia from another terminal using the remote control script. I've never released it in the debs or Snap package out of lack of time, but you can download it from here:

https://github.com/tizonia/tizonia-openmax-il/blob/master/player/tools/tizonia-remote.in

Just grab it, make it executable, and remember to enable MPRIS in your configuration file: https://github.com/tizonia/tizonia-openmax-il/blob/9004bc40b89eeafb04b28fbb2b772e47dd62fdc9/config/src/tizonia.conf.in#L63

ghost commented 5 years ago

Here I would like my home automation assistant to launch a playlist in the background (which he is already doing very well).

And that on a terminal in ssh I can pause mutate or put the next song in command line. (ex tizonia cmdnext)

I'm going to look at what you gave me but I do not know too much and when I activate MPRIS I have an error 'Tiz :: DBus :: Error'

fr :

oui voila je voudrais que mon assistant domotique lance une playlist en arrière plan ( ce qu'il fait déjà très bien).

Et que sur un terminal en ssh je puisse mettre en pause muter ou mettre la chanson suivante en ligne de commande. ( ex tizonia cmdnext)

Je vais me pencher sur ce que tu m'as donné mais je ne m'y connais pas de trop et quand j'active MPRIS j'ai une erreur 'Tiz::DBus::Error'

ghost commented 5 years ago

Just grab it, make it executable

what do you mean by:

Just grab it, make it executable

I'm starting out sorry

tizonia commented 5 years ago

@jeremya37

Yes, sorry I should've explained. The tool is called tizonia-remote. It is a shell script. You can download it directly from the terminal using wget or similar, and then you can make it executable and put it somewhere in your path.

$ wget https://raw.githubusercontent.com/tizonia/tizonia-openmax-il/master/player/tools/tizonia-remote.in
$ mv tizonia-remote.in tizonia-remote
$ chmod +x tizonia-remote
$ sudo install tizonia-remote /usr/local/bin 
ghost commented 5 years ago

I only enabled mpris mpris-enabled = true in the configuration file:

sudo nano /etc/xdg/tizonia/tizonia.conf

When I tap tizonia-remote pause I have this error:

pi@gladys:~ $ tizonia-remote pause Failed to open connection to "session" message bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11 /usr/local/bin/tizonia-remote: line 151: dbus-launch: command not found declare -x HOME="/home/pi" declare -x LANG="en_GB.UTF-8" declare -x LOGNAME="pi" declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.Z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:" declare -x MAIL="/var/mail/pi" declare -x NO_AT_BRIDGE="1" declare -x OLDPWD declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games" declare -x PWD="/home/pi" declare -x SHELL="/bin/bash" declare -x SHLVL="2" declare -x SSH_CLIENT="192.168.1.54 51808 22" declare -x SSH_CONNECTION="192.168.1.54 51808 192.168.1.41 22" declare -x SSH_TTY="/dev/pts/0" declare -x TERM="xterm" declare -x TEXTDOMAIN="Linux-PAM" declare -x USER="pi" declare -x XDG_RUNTIME_DIR="/run/user/1000" declare -x XDG_SESSION_ID="c52" D-Bus per-session daemon address is: D-Bus per-session daemon PID is :

after i have raspbian without GUI if sometimes this can help

tizonia commented 5 years ago

enabled mpris mpris-enabled = true in the configuration file:

sudo nano /etc/xdg/tizonia/tizonia.conf 

I think you probably should modify the user's configuration file, which is located in $HOME/.config/tizonia/tizonia.conf

With regards to running tizonia-remote on a headless system, you will need to make sure that D-BUS is available on your system (you need to install it first using the package manager).

Once the D-Bus daemon is installed, you need to launch it at the start of your user's session. There may be many ways of doing this, but the following shell snippet works for me. I usually add this to my $HOME/.bashrc or $HOME/.zshrc

DBUS_VARS_FILE="$HOME/.dbus_vars" # Where file with variables is stored
# This function launches dbus and saves environment variables
launch_dbus() {
    OLDUMASK=$(umask) # Save umask
    umask 0077 # Set secure umask
    if dbus-launch --auto-syntax > "$DBUS_VARS_FILE"; # Launch DBus and save its environment variables
    then
        . "$DBUS_VARS_FILE" # Load environment variables
    else
        # Error
        echo Failed to launch DBus
    fi
    umask $OLDUMASK # Restore umask
}

    if [ -f "$DBUS_VARS_FILE" ];
    then
        . "$DBUS_VARS_FILE" # Load environment variables
        if ps ax | grep -q '^ '"$DBUS_SESSION_BUS_PID"; # Check whether DBus is running
        then
            echo -n # DBus is running, so do nothing
        else
            launch_dbus # DBus is not running (old file was loaded)
        fi

    else
        launch_dbus
    fi
ghost commented 5 years ago

I can not find anything there .... I even install dbus I always have this error:

terminated after throwing an instance of 'Tiz :: DBus :: Error'
  what (): Unable to autolaunch a dbus-daemon without a $ DISPLAY for X11
Aborted

So, thank you very much for your patience I will not continue on the creation of plugins too bad but I keep tizonia for my home automation anyway

antoinebou12 commented 5 years ago

@jeremya37 I reproduce the issue in the my Windows Subsystem for Linux sudo apt install dbus-x11 and i install xming on windows to have a x11 server display and i added export DISPLAY=:0 and since that i don't have the issue

terminate called after throwing an instance of 'Tiz::DBus::Error'
  what():  /usr/bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.

Aborted (core dumped)

,but the remote application doesn't work for me

[Spotify] [Connected] : '7yWsPfsWneO9DjvcoXOs07'.
shared memfd open() failed: Function not implemented
tizonia-remote pause
D-Bus per-session daemon address is: unix:abstract=/tmp/dbus-gMIOHKFNT2,guid=08f331482c69365fe3f749045ced86fe
D-Bus per-session daemon PID is    : 29519
tizonia-remote loopstatus
"--dest=" requires an NAME
Usage: dbus-send [--help] [--system | --session | --bus=ADDRESS | --peer=ADDRESS] [--dest=NAME] [--type=TYPE] [--print-reply[=literal]] [--reply-timeout=MSEC] <destination object path> <message name> [contents ...]

doesn't know if that help you problem because you have a displayless device