Skip to content

nogenem/control-pc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Control-pc

A simple way to control your pc using a cellphone.

Front-end image

The problem

I wanted a way to control my pc while i'm lying in bed, without the use of a wireless keyboard/mouse. I would use it primarily when i'm watching some movie/series, to play/pause it or control the volume.

The solution

Considering that i wanted to play/pause the video and control the volume, i thought that the best way to do this is using the Fn keys on the keyboard. After searching the simplest way to do it, using the programming languages that i already know, i ended with the combination of Java + Autohotkey. I use Java for the server and basic keyboard/mouse controls and Autohotkey to trigger the Fn keys, since i couldn't find an easy way to do this with Java.

The easiest way that i found to access the server, running on my PC, from my cellphone is by fixing my IP address. After doing that, i can simply use that IP to access a front-end page that i made with HTML + Javascript + JQuery which contains some controls that send the commands to the server.

Technologies

Requirements for development

How to run the project for development

  1. Clone the repository:
$ git clone https://github.com/nogenem/control-pc.git
  1. Open the project with an IDE / Code editor.

    • With Eclipse, you should open it in the folder that you did the git clone and then go into File > Import... > Maven > Existing Maven Projects....
      • Make sure that the project is running with JRE 1.8+.
        • Right click the "JRE System Library" and click on "Properties".
        • Check if the "JavaSE-1.8 (jdk1.8.x_xxx)" is selected, or a higher version.
  2. Copy the file .env.example and rename it to .env.

    • You can edit the values inside the file as you please, but the default ones will work fine.
    • If you want to create a new KeyStore.jks file, you can use the following command:
$ keytool -genkey -alias control-pc -keyalg RSA -keystore KeyStore.jks -keysize 2048
  1. Open the Main.java file and click on "Run as...".

  2. You can now open http://localhost:7777/ and start controlling your PC.

    • If you fixed your IP address, you can access the front-end on your cellphone too, using the same port (7777).

Requirements to run the compiled version

How to run the compiled version

  1. Download the latest release.
  2. Extract the .zip file.
  3. Open a terminal and navigate to the extracted folder.
cd /path/to/control-pc
  1. Execute the following command:
java -jar control-pc.jar
  1. You can now open http://localhost:7777/ and start controlling your PC.

    • If you fixed your IP address, you can access the front-end on your cellphone too, using the same port (7777).

Full image of the project

Full cellphone view

About

Simple way to control your pc using a cellphone

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors