1 个不稳定版本

0.1.0 2022年6月11日

#994硬件支持

MIT 许可证

9KB
104

Meth: 保持清醒!

Graphic shows two cursors moving with pixel-art motion blur

保持电脑清醒!

我经常运行长时间模拟,并喜欢离开我的电脑。

  • 我不想更改我的电源设置,
  • 我只希望有一个程序在运行时或仅当它执行特定任务时阻止电脑休眠。

用法

一个 Meth 实例会在释放前保持电脑唤醒状态。

// computer will not sleep until
// `important_computation()` completes.
{
  let meth = Meth::new();
  important_computation();
}

// `meth` dropped,
// computer might enter sleep now.

操作系统支持

Windows + macOS

应该可以正常工作

Linux

确保已安装 libxdo-dev

  • Ubuntu: sudo apt-get install libxdo-dev

  • Arch: pacman -S xdotool

  • AWS Linux, CentOS 等: yum install libxdo

工作原理

GIF showing a macOS cursor moving in a square

它只是偶尔轻微地移动鼠标(使用 mouse-rs)。

如果鼠标30秒内没有移动,meth 将将其移动,绘制一个正方形。

MIT 许可证

Permission is hereby granted, free of charge, to any person obtaining a 
copy of this software and associated documentation files (the "Software"), 
to deal in the Software without restriction, including without limitation 
the rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or sell copies of the Software, and to permit persons to whom the 
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in 
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
DEALINGS IN THE SOFTWARE.

依赖关系

~21–690KB
~12K SLoC