GithubHelp home page GithubHelp logo

winthing's Introduction

WinThing

Build Status

A modular background service that makes Windows remotely controllable through MQTT. For home automation and Internet of Things.

Compilation

mvn clean package

Running

java -jar -Dwinthing.brokerUrl=tcp://localhost:1883 target/winthing-1.1.0-SNAPSHOT.jar

Configuration

Configuration can be passed either by Java system properties from command line or application.properties file placed in the classpath.

PropertyDescriptionDefault
winthing.brokerUrl URL of the MQTT broker to use. tcp://localhost:1883
winthing.brokerUsername Username used when connecting to MQTT broker. bob
winthing.brokerPassword Password used when connecting to MQTT broker. supersecret11
winthing.clientId Client ID to present to the broker. WinThing
winthing.topicPrefix Client ID to present to the broker. winthing
winthing.reconnectInterval Time interval between connection attempts in seconds. 5

Supported messages

The payload of all messages is either empty or a valid JSON element (possibly a privimite, like a single integer). This means, specifically, that if an argument is supposed to be a single string, it should be sent in double quotes.

Example valid message payloads:

  • 123
  • true
  • "notepad.exe"
  • [1024, 768]
  • ["notepad.exe", "C:\file.txt", "C:\"]

Broadcasted status

System

Topic: winthing/system/online QoS: 2 Persistent: yes
Payload: state:boolean
True when WinThing is running, false otherwise.

Commands

System

Topic: winthing/system/commands/shutdown
Payload:-
Trigger immediate system shutdown.
Topic: winthing/system/commands/reboot
Payload:-
Trigger immediate system reboot.
Topic: winthing/system/commands/suspend
Payload:-
Trigger immediate system suspend.
Topic: winthing/system/commands/hibernate
Payload:-
Trigger immediate system hibernate.
Topic: winthing/system/commands/run
Payload:[command:string, arguments:string, workingDirectory:string]
Run a command. Arguments and working directory are optional (empty string and null by default).
Topic: winthing/system/commands/open
Payload:uri:string
Opens an URI, like a website in a browser or a disk location in a file browser.

Desktop

Topic: winthing/desktop/commands/close_active_window
Payload:-
Closes currently active window.
Topic: winthing/desktop/commands/set_display_sleep
Payload:displaySleep:boolean
Puts the display to sleep (on true) or wakes it up (on false).

Keyboard

Topic: winthing/keyboard/commands/press_keys
Payload:[key:string...]
Simulates pressing of given set of keyboard keys. Keys are specified by name. List of availble key names and aliases can be found [here](src/main/java/com/fatico/winthing/windows/input/KeyboardKey.java).

ATI Radeon display driver

Topic: winthing/radeon/commands/set_best_resolution
Payload:-
Sets the screen to the best available resolution.
Topic: winthing/radeon/commands/set_resolution
Payload:[widthInPixels:integer, heightInPixels:integer]
Sets the screen to the given resolution.

License

Copyright 2015-2016 Mikołaj Siedlarek <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

winthing's People

Contributors

msiedlarek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.