diff --git a/mpc_shim.rb b/mpc_shim.rb index 06faa7d..0deb84c 100644 --- a/mpc_shim.rb +++ b/mpc_shim.rb @@ -1,51 +1,51 @@ class MpcShim def update() - `mpc #{host_arg} update` + `mpc #{@host_arg} update` end def clear() - `mpc #{host_arg} clear` + `mpc #{@host_arg} clear` end def play() - `mpc #{host_arg} play` + `mpc #{@host_arg} play` end def stop() - `mpc #{host_arg} stop` + `mpc #{@host_arg} stop` end def next() - `mpc #{host_arg} next` + `mpc #{@host_arg} next` end def reset() - `mpc #{host_arg} clear` - `mpc #{host_arg} add /` - `mpc #{host_arg} shuffle` - `mpc #{host_arg} repeat` + `mpc #{@host_arg} clear` + `mpc #{@host_arg} add /` + `mpc #{@host_arg} shuffle` + `mpc #{@host_arg} repeat` end def update() - `mpc #{host_arg} update` + `mpc #{@host_arg} update` end def toggle() - `mpc #{host_arg} toggle` + `mpc #{@host_arg} toggle` end def add(filename = nil) if filename == nil - `mpc #{host_arg} add /` + `mpc #{@host_arg} add /` else - `mpc #{host_arg} add #{filename}` + `mpc #{@host_arg} add #{filename}` end return $?.success? end def start() `systemctl start mpd` unless `ps aux | grep mpd` != "" - `mpc ${host_arg} repeat` + `mpc ${@host_arg} repeat` end def running?() @@ -53,7 +53,7 @@ class MpcShim end def nowplaying() - return `mpc ${host_arg} | head -n 1` + return `mpc ${@host_arg} | head -n 1` end def initialize(hostname=:localhost)