Difference between revisions of "SpotCommander"

From ArchWiki
Jump to: navigation, search
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:Audio/Video]]
 
[[Category:Audio/Video]]
[http://code.google.com/p/spotcommander/ SpotCommander] is an open source web-based remote control for the '''GNU/Linux version''' of [[Spotify]]. The application is written in [[PHP]] and HTML5, and thus optimized especially for mobile devices, like smartphones or tablets. It has a visual appealing, responsive and intuitive user interface.
+
[http://code.google.com/p/spotcommander/ SpotCommander] is a remote control for Spotify for Linux, optimized for mobile devices. It's based on HTML5 & PHP, works on any device with a modern browser, and it's free and open source.
 +
 
 +
SpotCommander is the most elegant, intuitive, feature-rich & universal remote control for Spotify, exclusive for Linux users!
  
 
== Features ==
 
== Features ==
The application offers amongst others the following features:
 
  
* Launch and quit Spotify
+
* Reponsive & intuitive user interface
 +
* Launch/quit Spotify
 
* Now playing
 
* Now playing
 
* Control playback
 
* Control playback
* Change Spotify's volume
+
* Adjust volume
* Toggle shuffle and repeat
+
* Toggle shuffle & repeat
* Browse playlists, albums and starred items
+
* Playlists
* Search for tracks
+
* Starred items
 +
* Search
 +
* Browse playlists
 +
* Browse albums
 +
* Browse artists
 
* Recently played
 
* Recently played
 
* Queue
 
* Queue
 +
* Lyrics
 +
* Start track radio
 +
* Top lists
 +
* Popular playlists
 +
* New albums
 +
* Genres
 +
* Share to social networks
 
* Gestures
 
* Gestures
 
* Keyboard shortcuts
 
* Keyboard shortcuts
 +
* Android app
 +
* Fullscreen on iOS
 +
* Automatic update checking
  
== Installation ==
+
== Option 1: Install from AUR ==
  
{{Note|This must be done as root.}}
+
SpotCommander is [https://aur.archlinux.org/packages/spotcommander/ available in AUR], and can be installed [https://wiki.archlinux.org/index.php/AUR#Installing_packages like any other package from AUR]. The PKGBUILD automates the manual installation process described below.
  
=== Preconditions ===
+
{{Note|If you have any kind of web server software installed on your system already, you should install manually instead to avoid touching your current configuration.}}
==== Install Apache web server ====
+
* To be able to use SpotCommander, it is neccessary to have an Apache web server installed on the device, which should be controlled remotely later. Apache and PHP can be installed this way:
+
  
  $ pacman -S apache php php-apache
+
== Option 2: Install manually ==
  
See the [[LAMP]] article for more detailed information about Apache.
+
{{Note|This must be done as root.}}
 
+
==== Configuration of Apache ====
+
* Configure Apache. In {{ic|/etc/httpd/conf/httpd.conf}} add:
+
  
  AddType text/cache-manifest .appcache
+
=== Install & configure required packages ===
 
+
  <Directory "/srv/http/spotcommander">
+
  AllowOverride All
+
  ExpiresActive On
+
  ExpiresByType text/cache-manifest "access plus 0 seconds"
+
  </Directory>
+
  
* To be able to run the application, the sqlite extension of PHP is required. First, install the package:
+
* Install required packages:
  
   $ pacman -S php-sqlite
+
   $ pacman -S apache php php-apache php-sqlite qt4 inotify-tools xautomation wmctrl wget
  
* Now edit the php configuration in {{ic|/etc/php/php.ini}}:
+
* Enable PHP as described in the [[LAMP]] article
  
  $ nano /etc/php/php.ini
+
* Enable required PHP modules. In {{ic|/etc/php/php.ini}}, uncomment these:
 
+
* Comment out the following lines, to enable the needed extensions:
+
  
 
   extension=curl.so
 
   extension=curl.so
  ...
 
  extension=openssl.so
 
 
   ...
 
   ...
 
   extension=pdo_sqlite.so
 
   extension=pdo_sqlite.so
 +
  ...
 +
  extension=posix.so
 
   ...
 
   ...
 
   extension=sqlite3.so
 
   extension=sqlite3.so
  
{{Note|Make sure you have the ''openssl'' package installed.}}
+
* As root, create the file {{ic|/etc/httpd/conf/extra/spotcommander.conf}} and add:
 +
 
 +
<Directory "/srv/http/spotcommander">
 +
AllowOverride All
 +
</Directory>
 +
 
 +
{{Note|If you are going to install in another directory than /srv/http/spotcommander, make sure you use the correct directory above.}}
 +
 
 +
* In {{ic|/etc/httpd/conf/httpd.conf}}, add to bottom:
 +
 
 +
Include conf/extra/spotcommander.conf
 +
 
 +
* Make Apache start when system boots:
 +
 
 +
  $ systemctl enable httpd.service
  
* Restart Apache:
+
=== Give Apache access to /tmp ===
  
  $ systemctl restart httpd.service
+
* Open {{ic|/usr/lib/systemd/system/httpd.service}} and set:
  
* It is neccessary to give Apache access to /tmp. Search in {{ic|/usr/lib/systemd/system/httpd.service}} for the line ''PrivateTmp=true'' and change it as follows:
 
 
   PrivateTmp=false
 
   PrivateTmp=false
To make this change take effect, a '''reboot''' is needed.
 
  
==== Other required packages ====
+
=== Reboot ===
* In addition the following packages need to be installed:
+
 
  $ pacman -S qt4 inotify-tools xautomation wmctrl
+
* Some of the actions above require a reboot to take effect, so you must reboot your system now before continuing
  
 
=== Install SpotCommander ===
 
=== Install SpotCommander ===
  
 
* Go into the web server root directory:
 
* Go into the web server root directory:
 +
 
   $ cd /srv/http/
 
   $ cd /srv/http/
  
 
* Download the tar.bz2 file:
 
* Download the tar.bz2 file:
   $ wget -N http://www.olejon.net/code/spotcommander/files/spotcommander-8.6.tar.bz2
+
 
 +
   $ wget -N http://www.olejon.net/code/spotcommander/files/spotcommander-8.9.tar.bz2
  
 
* Extract the tar.bz2 file:
 
* Extract the tar.bz2 file:
   $ tar -jxvf spotcommander-8.6.tar.bz2
+
 
 +
   $ tar -jxvf spotcommander-8.9.tar.bz2
  
 
* Remove the tar.bz2 file:
 
* Remove the tar.bz2 file:
   $ rm spotcommander-8.6.tar.bz2
+
 
 +
   $ rm spotcommander-8.9.tar.bz2
  
 
* Go into the spotcommander folder:
 
* Go into the spotcommander folder:
 +
 
   $ cd spotcommander
 
   $ cd spotcommander
  
* Set the correct file permissions:
+
* Set the correct permissions:
 +
 
 
   $ chmod 755 . && chmod 755 bin/* && chmod 777 cache/* && chmod -R 777 db/ && chmod 666 run/*
 
   $ chmod 755 . && chmod 755 bin/* && chmod 777 cache/* && chmod -R 777 db/ && chmod 666 run/*
  
* Create a symlink, to be able to execute the SpotCommander [[daemon]]:
+
* Create symlink:
 +
 
 
   $ ln -fs $(pwd)/bin/spotcommander /usr/local/bin/spotcommander
 
   $ ln -fs $(pwd)/bin/spotcommander /usr/local/bin/spotcommander
  
* Start the daemon:
+
* You must now start the daemon. Open up a '''desktop terminal''' (not SSH) as the '''desktop user''' running Spotify (not root), and run this command:
 +
 
 
   $ spotcommander start
 
   $ spotcommander start
  
* If you have followed the instructions carefully, you should be able to open SpotCommander under ''http://localhost/spotcommander'' now.
+
By running it in the terminal the first time, you will be able to see if there are any errors.
 +
 
 +
* You should add the daemon to your startup applications. As root, create the file {{ic|/etc/xdg/autostart/spotcommander.desktop}} and add:
  
=== Add daemon to startup (optional) ===
+
[Desktop Entry]
If you want the SpotCommander deamon to start automatically, you have to add it to the startup list of your desktop environment. An easy way to execute the right command, is to write a simple bash script:
+
Type=Application
 +
Name=SpotCommander
 +
Exec=spotcommander start
  
  #!/bin/bash
+
=== Try it ===
  spotcommander start
+
  
* '''Under GNOME'''
+
* You should now be able to control Spotify by going to:
Open the startup applications dialog and add the bash script here:
+
  $ gnome-session-properties
+
* '''Under KDE'''
+
Create a symlink to the script in the KDE autostart folder:
+
  $ ln -s /path/to/above/script ~/.kde4/Autostart/
+
  
== Usage ==
+
  http://your.computers.ip.address.or.hostname/spotcommander
After you have set up the server successfully, every device in your local network should be able to access SpotCommander under the ip adress of the server. For example, if the server would have the ip 192.168.0.24:
+
  
  http://192.168.0.24/spotcommander/
+
* To find out your current IP address, run this command:
  
To find out your current ip adress, execute the following:
+
  $ ip addr
  
  ip addr
+
* Android users should download the [http://www.olejon.net/code/spotcommander/?android_app Android app], which can find your computer automatically
  
If you cannot access the server, make sure, that apache is accessible by other hosts in the LAN. Check in {{ic|/etc/httpd/conf/httpd.conf}} to what hosts it is listening to. The line should look like this:
+
=== Configuration ===
  
  Listen 80
+
It is not necessary to configure anything, but in the config.php file there are some options you can change.
  
 
== See also ==
 
== See also ==
  
* [http://code.google.com/p/spotcommander/ Official web site with more detailed information]
+
* [http://code.google.com/p/spotcommander/ Official website]

Revision as of 18:52, 14 December 2013

SpotCommander is a remote control for Spotify for Linux, optimized for mobile devices. It's based on HTML5 & PHP, works on any device with a modern browser, and it's free and open source.

SpotCommander is the most elegant, intuitive, feature-rich & universal remote control for Spotify, exclusive for Linux users!

Features

  • Reponsive & intuitive user interface
  • Launch/quit Spotify
  • Now playing
  • Control playback
  • Adjust volume
  • Toggle shuffle & repeat
  • Playlists
  • Starred items
  • Search
  • Browse playlists
  • Browse albums
  • Browse artists
  • Recently played
  • Queue
  • Lyrics
  • Start track radio
  • Top lists
  • Popular playlists
  • New albums
  • Genres
  • Share to social networks
  • Gestures
  • Keyboard shortcuts
  • Android app
  • Fullscreen on iOS
  • Automatic update checking

Option 1: Install from AUR

SpotCommander is available in AUR, and can be installed like any other package from AUR. The PKGBUILD automates the manual installation process described below.

Note: If you have any kind of web server software installed on your system already, you should install manually instead to avoid touching your current configuration.

Option 2: Install manually

Note: This must be done as root.

Install & configure required packages

  • Install required packages:
 $ pacman -S apache php php-apache php-sqlite qt4 inotify-tools xautomation wmctrl wget
  • Enable PHP as described in the LAMP article
  • Enable required PHP modules. In /etc/php/php.ini, uncomment these:
 extension=curl.so
 ...
 extension=pdo_sqlite.so
 ...
 extension=posix.so
 ...
 extension=sqlite3.so
  • As root, create the file /etc/httpd/conf/extra/spotcommander.conf and add:
<Directory "/srv/http/spotcommander">
AllowOverride All
</Directory>
Note: If you are going to install in another directory than /srv/http/spotcommander, make sure you use the correct directory above.
  • In /etc/httpd/conf/httpd.conf, add to bottom:
Include conf/extra/spotcommander.conf
  • Make Apache start when system boots:
 $ systemctl enable httpd.service

Give Apache access to /tmp

  • Open /usr/lib/systemd/system/httpd.service and set:
 PrivateTmp=false

Reboot

  • Some of the actions above require a reboot to take effect, so you must reboot your system now before continuing

Install SpotCommander

  • Go into the web server root directory:
 $ cd /srv/http/
  • Download the tar.bz2 file:
 $ wget -N http://www.olejon.net/code/spotcommander/files/spotcommander-8.9.tar.bz2
  • Extract the tar.bz2 file:
 $ tar -jxvf spotcommander-8.9.tar.bz2
  • Remove the tar.bz2 file:
 $ rm spotcommander-8.9.tar.bz2
  • Go into the spotcommander folder:
 $ cd spotcommander
  • Set the correct permissions:
 $ chmod 755 . && chmod 755 bin/* && chmod 777 cache/* && chmod -R 777 db/ && chmod 666 run/*
  • Create symlink:
 $ ln -fs $(pwd)/bin/spotcommander /usr/local/bin/spotcommander
  • You must now start the daemon. Open up a desktop terminal (not SSH) as the desktop user running Spotify (not root), and run this command:
 $ spotcommander start

By running it in the terminal the first time, you will be able to see if there are any errors.

  • You should add the daemon to your startup applications. As root, create the file /etc/xdg/autostart/spotcommander.desktop and add:
[Desktop Entry]
Type=Application
Name=SpotCommander
Exec=spotcommander start

Try it

  • You should now be able to control Spotify by going to:
 http://your.computers.ip.address.or.hostname/spotcommander
  • To find out your current IP address, run this command:
 $ ip addr
  • Android users should download the Android app, which can find your computer automatically

Configuration

It is not necessary to configure anything, but in the config.php file there are some options you can change.

See also