opened
helotpl
username_0
This app is great, but one final piece is missing, ability to pause/resume or switch radio staton with media keys on keyboard or touchbar. Also in Big Sur currently playing has been introduced to menubar and radiobar is not present there with it's playback. Finally bluetooth headphones have media controls and they are not working with radiobar.
Keyboard / Touchbar media keys not working
issue
created
mdbraber
username_1
You can send commands through a TCP connection on port 65432 on localhost. E.g. you can use the commands 'on' 'off' or any number that corresponds with your radio presets. Below is an example script to issue the commands:

```
import socket
import sys
import time
import subprocess
import errno
from socket import error as socket_error

HOST = '127.0.0.1'  # The server's hostname or IP address
PORT = 65432        # The port used by the server

def connect():
    try:
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect((HOST, PORT))
        return s
    except socket_error as serr:
        if serr.errno != errno.ECONNREFUSED:
            raise serr
        subprocess.Popen(["open","/Applications/RadioBar.app"])
        time.sleep(5)
        return connect()

try:
    s = connect()
    s.sendall(sys.argv[1])
    data = s.recv(1024)
    print(data)
except socket_error as serr:
    print(serr)
    sys.exit(1)
 ```
comment
created
helotpl
username_0
Thank you for reply. How are you plugging such script to keys? Are you able to control other media apps once they are playing after assigning these keys to radiobar?
comment
created
mdbraber
username_1
Take a look at apps like Alfred, Keyboard Maestro or Fastscripts.
comment