From 982275b69e5881be356aef13e896485812996df1 Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 1 May 2022 16:49:39 -0400 Subject: [PATCH] use right var --- mpc_shim.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) 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)