Skip to content

Commit

Permalink
Initial commit with StayActive formula and script
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkynrg committed Aug 28, 2024
0 parents commit ecb1b61
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
17 changes: 17 additions & 0 deletions Formula/stay-active.rb
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
21 changes: 21 additions & 0 deletions LICENSE
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.
47 changes: 47 additions & 0 deletions README.md
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.
6 changes: 6 additions & 0 deletions src/stay-active.sh
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

0 comments on commit ecb1b61

Please sign in to comment.