Command | Function |
---|---|
PO |
Power On |
PF |
Power Off |
?P |
Query power status |
VD |
Volume Up |
VU |
Volume Down |
?V |
Query volume status |
MO |
Mute On |
MF |
Mute Off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm i --save jsonp | |
import jsonp from 'jsonp'; | |
var host = 'http://192.168.1.140'; | |
var data = { | |
'jsonrpc': '2.0', | |
'method': 'Application.GetProperties', | |
'params': '[["volume","muted","version"]]', | |
'id': Math.ceil(Math.random() * 10000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function randomIntFromInterval(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
} | |
function getRandomName() { | |
const names = [ | |
'Bear', | |
'Monkey', | |
'Space', | |
'Bird', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hs.alert.show('Hammerspoon config loaded') | |
hotkeyF3 = hs.hotkey.modal.new('', 'f3') | |
hotkeyF4 = hs.hotkey.modal.new('', 'f4') | |
hs.window.animationDuration = 0.1 | |
cachedNumScreens = #hs.screen.allScreens() | |
hs.dockicon.hide() | |
kodihost = 'http://192.168.1.140' | |
------------------------------- | |
-- Auto-reload functionality -- |