Work from home tips

Work from home tips

Not only in WFH but will help in office also ๐Ÿคช

ยท

3 min read

When you do WFH, there are certain things that may irritate you which include keeping the screen awake.

Those normal people simply say just go and turn off sleep settings. They don't know that most IT company's employee PC is managed by the organization itself.

So changing those won't work. It is the same for me. But I ain't the one who just keeps sitting and simply moving the mouse.

There are many ways to solve this. let's see them one by one.

1. Changing sleep settings

I'm adding this because maybe for most people that'll be solved here itself if their PCs are not managed by organizations.

This may differ concerning OS that you're using. Search google accordingly for steps to turn off sleep settings.

2. Teams

Most organizations use Microsoft products. Hence you'll get Microsoft Teams access also. For this to implement you may need help from one of your colleagues.

Just call them in the team's app and put it in mute nothing else. The screen will never go to sleep until the call hangs up.

If teams is not available then go for Google meet as there are many out there. we are making the PC stay awake by joining in meetings.

3. Simple Java program

This may surely help if you have JDK or java installed on your pc.

Initially, I had the code which automatically moves the cursor every 4 mins. But it got me irritated while working. so I made some modifications to the code.

Let me explain how the below code works.

import java.awt.Robot;
import java.util.Random;
import java.awt.AWTException;
import java.awt.MouseInfo;

public class runner {
    public static void main(String[] args) throws InterruptedException {
        try {
            Robot robot = new Robot();
            System.out.println("Started....");
            Random random = new Random();
            while (true) {
                double t1 = MouseInfo.getPointerInfo().getLocation().getX();
                Thread.sleep(60000);
                double t2 = MouseInfo.getPointerInfo().getLocation().getX();
                if (t1 == t2){
                   robot.mouseMove(random.nextInt(400), random.nextInt(400));
                }
            }
        } catch (AWTException e) {
            e.printStackTrace();
        }
    }
}

When the above program starts to run, it'll get the mouse pointer location and store it in t1. Then it'll go to sleep for 2 mins. Again the reads the mouse location, and stores it in t2. If got the same position as before and both t1, t2 are equal then the pointer is moved to a random place.

If you left the system the program will run continuously and the position is same every time will move the cursor to a random place.

In another case, you got back to the system and started working. The mouse pointer position is not going to be the same when 2 minutes are completed. Hence no action is done. This way it'll not affect your work and if you suddenly leave the system also, nothing will be turned off.

Run code

Java needs to be installed on your pc. Then open the notepad -> copy & paste the above code. Save it as runner.java.

Open the command prompt in the location of the java file saved.

Run, javac runner.java to compile the program. Once compilation is done, no errors will be shown. Then run java runner.

It'll give the message as started. That's it.

Don't forget to plug in the adapter and switch it on ๐Ÿ˜†

I think with 2nd step itself mostly the probably issue will be solved.

I want to conclude by saying that this will be useful in the office when you go to get your coffee and chit-chat with friends.

As I always say, If any doubts about the article point them out in the comments.

Have fun. Thank you.

ย