Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
osx-wifi-volume-remote
Advanced tools
A web-based html5 / node.js app to control OS X system volume from iPhone, Android, etc
Stop serving the empire and join the rebel alliance!
A web-based html5 / node.js app to control OS X system volume from iPhone, Android, etc
Get Node.js
Open Terminal
Install osx-wifi-volume-remote
like so
npm install -g osx-wifi-volume-remote
Start the server like so (and note that it shows the name of your computer)
osx-wifi-volume-server 4040
Type the http://<your-computer-name>.local:4040/
whatever onto your phone's browser
(NOTE: Your phone or whatever device must be on the same WiFi or ethernet network as your computer)
Enjoy controlling your MacBook's volume over wifi!
Use with serve-https
to be able to use this with your own
domain (i.e. <username>.daplie.me
) over the Internet (i.e. your laptop on WiFi and your phone on 3g/4g/LTE).
npm install --global daplie-tools
npm install --global serve-https@2.x
git clone https://git.daplie.com/coolaj86/osx-wifi-volume-remote.git
Register a domain with daplie.me:
daplie domains:search
Run the tunnel server
USER=jane # or whatever
EMAIL=jane@example.com # or whatever
serve-https \
--servername $USER.daplie.me \
--agree-tos --email $EMAIL \
--tunnel \
--express-app osx-wifi-volume-remote/app.js
Initiate (the very first time) with curl:
curl "https://$USER.daplie.com"
npm install --save osx-wifi-volume-remote
(function () {
'use strict';
var applvol = require('osx-wifi-volume-remote')
;
// All callbacks have the same arguments
applvol.get(function (err, volume, muted) {
console.log('Volume is set to ' + volume + '% and is ' + (muted ? '' : 'not ') + 'muted');
});
}());
get(cb)
read the current volume level and mute statusfade(cb, level, duration)
specify a volume level to fade tofadeBy(cb, difference, duration)
specify a positive or negative difference in volume to fade tomute(cb, duration)
fades to 0, mutes, then restores volume while mutedunmute(cb, duration)
sets volume to 0, unmutes, then fades back in to volume levelset(cb, level)
hard set a volume without fadingerr, volume, muted
NOTE: The callbacks all must come first (it was just easier to write the code that way).
If you want to develop, here's the clone and build process:
git clone https://git.daplie.com/coolaj86/osx-wifi-volume-remote.git
pushd osx-wifi-volume-remote
npm install -g jade
jade browser/index.jade; mv browser/index.html public/
npm install
node app 4040
I had to learn a bit of AppleScript to get this all together. I'll give the gist of it below an you can also read the article on my blog.
# Check volume level and mute status
osascript -e "output volume of (get volume settings) & output muted of (get volume settings)"
# Mute
osascript -e "set volume with output muted"
# Unmute
osascript -e "set volume without output muted"
# Mute status
osascript -e "output muted of (get volume settings)"
# Set volume by 100ths
osascript -e "set volume output volume 51 --100%"
# Set to 0% without muting (the secret lowest possible setting)
osascript -e "set volume without output muted output volume 0 --100%"
# Set to non-0 without unmuting
osascript -e "set volume with output muted output volume 42 --100%"
# Decrement the current volume by 1
osascript -e "set volume output volume (output volume of (get volume settings) - 1) --100%"
It turns out that AppleScript takes about 80ms to start up and run, so for the fade I actually create a file with the whole loop unrolled and it looks like this:
set volume without output muted output volume 18 --100%
delay 0.033
set volume without output muted output volume 17 --100%
delay 0.033
set volume without output muted output volume 16 --100%
FAQs
A web-based html5 / node.js app to control OS X system volume from iPhone, Android, etc
The npm package osx-wifi-volume-remote receives a total of 7 weekly downloads. As such, osx-wifi-volume-remote popularity was classified as not popular.
We found that osx-wifi-volume-remote demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.