-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit with StayActive formula and script
- Loading branch information
0 parents
commit ecb1b61
Showing
5 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class Stayactive < Formula | ||
desc "Keeps Slack online and Mac awake" | ||
homepage "https://github.com/pinkynrg/slack-awake" | ||
url "https://github.com/yourusername/stayactive/archive/refs/tags/v0.1.0.tar.gz" # Replace with your tarball URL | ||
sha256 "your_sha256_checksum" # Replace with the actual SHA256 checksum | ||
license "MIT" | ||
|
||
depends_on "cliclick" # This ensures cliclick is installed | ||
|
||
def install | ||
bin.install "stay-active.sh" => "stayactive" | ||
end | ||
|
||
test do | ||
system "#{bin}/stayactive", "--version" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Francesco Meli | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# StayActive | ||
|
||
**StayActive** is a simple utility script designed to keep Slack online and your Mac awake, even when you’re away from your desk. It works by subtly moving the mouse cursor periodically to prevent your system from going idle. | ||
|
||
## Features | ||
|
||
- **Keeps Slack Online**: Prevents Slack from marking you as away. | ||
- **Keeps Mac Awake**: Ensures your Mac doesn't go to sleep when you're away. | ||
|
||
## Installation | ||
|
||
You can install **StayActive** using Homebrew: | ||
|
||
```bash | ||
brew tap yourusername/stay-active | ||
brew install stay-active | ||
``` | ||
|
||
> **Note:** This script relies on the `cliclick` tool, which will be installed automatically as a dependency. | ||
## Usage | ||
|
||
After installation, simply run the following command in your terminal: | ||
|
||
```bash | ||
stay-active | ||
``` | ||
|
||
This will start the script, which will continuously move the mouse cursor by a single pixel every second. | ||
|
||
To stop the script, simply press `Ctrl + C` in the terminal. | ||
|
||
## How It Works | ||
|
||
The script runs an infinite loop, moving the mouse cursor by one pixel to the right and then one pixel to the left every second. This movement is subtle enough not to interfere with your work but ensures that Slack and your Mac remain active. | ||
|
||
## Contributing | ||
|
||
If you'd like to contribute to **StayActive**, please fork the repository, make your changes, and submit a pull request. All contributions are welcome! | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details. | ||
|
||
## Disclaimer | ||
|
||
Use this tool responsibly. Keeping your system active while you're away may have unintended consequences, such as preventing important updates or energy-saving features. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
while true; do | ||
cliclick m:+1,+0 m:-1,+0; | ||
sleep 1; | ||
done |