Coder Social home page Coder Social logo

winsleepwell's Introduction

WinSleepWell

This project includes a service that detects when Windows wakes from sleep and puts it back to sleep, and a taskbar-resident application that minimizes wake-ups from sleep caused by mouse movement as much as possible.

Folder Structure

/MyProject
│
├── /src
│   ├── /WinSleepWell          # Project for the Windows (WPF) tray application
│   ├── /WinSleepWellService   # Project for the Windows service
│   ├── /WinSleepWellLib       # Project for the shared library
│   └── WinSleepWell.sln       # Solution file
│
├── /bin
│   └── /Release               # Released program contents
│       ├── /App               # Windows application
│       ├── /Service           # Windows service
│       ├── settings.json      # Shared configuration file
│       ├── setup.ps1          # Setup script for Users (Same as the script in the project root)
│       ├── UserGuide.txt      # English user guide
│       └── UserGuide-ja.txt   # Japanese user guide
│
├── /images                     # Images used in the project
│
├── .gitignore
├── build.ps1                   # Build script
├── setup.ps1                   # Setup script for Developers to install and uninstall the service and task
├── README.md                   # English README file
├── README-ja.md                # Japanese README file
├── LICENSE                     # License file
└── CONTRIBUTING.md             # Contribution guidelines

Prerequisites for running PowerShell scripts

Before running the build.ps1 and setup.ps1 scripts, ensure that your execution policy is configured correctly:

  1. Open Developer PowerShell for VS 2022 with administrator privileges. You can find this in the Start Menu under All Programs > Visual Studio 2022 > Developer PowerShell for VS 2022.
  2. Check the current execution policy:
    $OriginalPolicy = Get-ExecutionPolicy
    Write-Host "Current Execution Policy: $OriginalPolicy"
  3. If the policy is not set to Unrestricted, set it using:
    Set-ExecutionPolicy Unrestricted -Scope CurrentUser
    Note: Setting the execution policy to Unrestricted allows all scripts to run, but you may receive warnings when running scripts downloaded from the internet. Changing the execution policy requires administrator privileges. The author of this project assumes no liability for any issues that may arise from modifying the execution policy.
  4. After completing the setup or build process, if you do not plan to run these scripts frequently, you can revert to the original policy using:
    Set-ExecutionPolicy $OriginalPolicy -Scope CurrentUser

How to setup for developers

To set up the project for development, you can follow these steps:

  1. Open Developer PowerShell for VS 2022 with administrator privileges.
  2. Navigate to the root directory of the project.
  3. Run the build script to compile all projects:
    ./build.ps1
  4. After the build is complete, run the setup script to install the service and task:
    ./setup.ps1 -i
  5. The built artifacts will be placed in the bin\Debug and bin\Release directories, and the service will be installed and started automatically.
  6. To uninstall the service and task, run:
    ./setup.ps1 -u

How to develop

Run Visual Studio with administrator privileges to debug. This program requires administrator privileges.

How to build

To build the project, you can use the build.ps1 script. This script will compile all projects and place the artifacts in the appropriate bin directories.

Using the build script

  1. Open Developer PowerShell for VS 2022 with administrator privileges.
  2. Navigate to the root directory of the project.
  3. Run the build script:
    ./build.ps1
  4. The built artifacts will be placed in the bin\Debug and bin\Release directories.

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines on how to contribute to this project.

License

This project is licensed under the terms of the Apache 2.0 license. See the LICENSE file for details.

winsleepwell's People

Contributors

isshiki avatar

Watchers

 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.