KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
shareMouseHelper
★ 16
Open GitHub ↗
通过定时重启sharemouse达到无限期使用sharemouse
Download README (.md)
Explore Similar Repositories
mancala
:
No description available.
EmoTune
:
Embrace EmoTune, where tech meets emotions, using Python, HTML, CSS, and JS to craft personalized symphonies based on your mood. Let AI decode real-time feelings into musical delights for a harmonious blend of technology and emotion! 🚀🎶
CrazyCoderWebApp
:
Android App: https://github.com/Yash-Parsana/CrazyCoderApp .................... Backend: https://github.com/Yash-Parsana/CrazyCoderServerlessApi
chat-with-car
:
Issue voice commands to Internet-enabled vehicles.
smartcontract
:
smart contract
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
shareMouseHelper
?
Download (.md)
# ShareMouse Helper 一个用于自动管理 ShareMouse 应用程序的 Node.js 工具,支持定时重启功能以保持应用程序的稳定运行。 ## 🚀 功能特性 - **定时重启**: 每小时自动重启 ShareMouse 应用程序 - **智能休眠检测**: 系统休眠时自动暂停重启,唤醒时立即执行重启 - **跨平台支持**: 同时支持 Windows 和 macOS 系统 - **智能检测**: 自动检测操作系统并执行相应的重启逻辑 - **命令行工具**: 可作为全局命令行工具使用 - **后台运行**: 持续在后台监控并按计划执行重启 ## 📦 安装 ```bash npm install -g pm2 sharemouse ``` ## 🔧 使用方法 ### 启动服务 ```bash pm2 start $(which sharemouse) --name "sharemouse-helper" ``` ### 设置开机自启动 ```bash # 保存当前进程列表 pm2 save # 生成自启动脚本 pm2 startup # 按照提示执行生成的命令(需要管理员权限) ``` ### 常用管理命令 ```bash # 查看状态 pm2 status # 查看日志 pm2 logs sharemouse-helper # 重启服务 pm2 restart sharemouse-helper # 停止服务 pm2 stop sharemouse-helper ``` ## 💻 系统要求 ### Windows - ShareMouse 应用程序需要安装在以下路径之一: - `C:/Program Files/ShareMouse/` - `C:/Program Files (x86)/ShareMouse/` - `D:/Program Files/ShareMouse/` - `D:/Program Files (x86)/ShareMouse/` - `E:/Program Files/ShareMouse/` - `E:/Program Files (x86)/ShareMouse/` ### macOS - ShareMouse 应用程序需要安装在 `/Applications/` 目录下 ## ⚙️ 工作原理 1. **时间计算**: 程序计算到下一个整点的时间间隔 2. **休眠监控**: 通过时间差检测系统休眠/唤醒状态 3. **智能调度**: - 正常运行时:按小时定时重启 - 系统休眠时:暂停所有重启操作 - 系统唤醒时:立即执行一次重启,然后恢复定时调度 4. **进程管理**: - Windows: 使用 `taskkill` 终止进程,使用 `start` 启动程序 - macOS: 使用 `pkill` 终止进程,使用 `open` 启动应用程序 ## 📁 项目结构 ``` sharemouse/ ├── index.js # 主程序入口 ├── sleep-monitor.js # 休眠/唤醒监控模块 ├── restart-mac.js # macOS 重启逻辑 ├── restart-win.js # Windows 重启逻辑 ├── package.json # 项目配置 ├── LICENSE # 开源许可证 └── README.md # 项目说明 ``` ## 🛠️ 开发 ### 克隆项目 ```bash git clone https://github.com/paul-leo/shareMouseHelper.git cd shareMouseHelper ``` ### 安装依赖 ```bash npm install ``` ### 运行测试 ```bash # 运行所有测试 npm test # 运行测试并查看覆盖率 npm run test:coverage # 监听模式运行测试 npm run test:watch ``` ## 📝 更新日志 ### v1.0.6 (最新) - 新增智能休眠检测功能 - 系统休眠时自动暂停重启操作 - 系统唤醒时立即执行重启 - 优化定时调度逻辑 - 改进日志输出和状态提示 ### v1.0.5 - 支持 Windows 和 macOS 双平台 - 实现定时重启功能 ## 🤝 贡献 欢迎提交 Issue 和 Pull Request! 1. Fork 本项目 2. 创建特性分支 (`git checkout -b feature/AmazingFeature`) 3. 提交更改 (`git commit -m 'Add some AmazingFeature'`) 4. 推送到分支 (`git push origin feature/AmazingFeature`) 5. 开启 Pull Request ## 📄 许可证 本项目采用 ISC 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情 ## 🔗 相关链接 - [GitHub 仓库](https://github.com/paul-leo/shareMouseHelper) - [问题反馈](https://github.com/paul-leo/shareMouseHelper/issues) - [ShareMouse 官网](https://www.sharemouse.com/) ## � 快M速开始 ### Windows 系统 ```bash # 安装 npm install -g pm2 sharemouse # 安装 Windows 启动助手 npm install -g pm2-windows-startup pm2-startup install # 启动服务 pm2 start $(where sharemouse) --name "sharemouse-helper" pm2 save ``` ### macOS/Linux 系统 ```bash # 安装 npm install -g pm2 sharemouse # 启动服务 pm2 start $(which sharemouse) --name "sharemouse-helper" # 设置开机自启动 pm2 save pm2 startup # 按照提示执行生成的 sudo 命令 ``` ## ⚠️ 注意事项 - 请确保 ShareMouse 已正确安装在系统中 - 程序需要相应的系统权限来终止和启动进程 - 设置 PM2 自启动需要管理员权限 - 如果系统重启后服务没有自动启动,可以运行 `pm2 resurrect` 手动恢复 ## 👨💻 作者 **Paul** - [GitHub](https://github.com/paul-leo) --- 如果这个工具对你有帮助,请给个 ⭐️ 支持一下!