Comments (3)
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 which I use with an Alfred workflow to issue the commands (this is similar to remote.py
in the repository). Also check the explanation in the README.
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)
from radiobar.
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?
from radiobar.
Take a look at apps like Alfred, Keyboard Maestro or Fastscripts.
from radiobar.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from radiobar.