https://github.com/fin-ger/snore
Runs for the given time and is similar to the Unix 'sleep' command
https://github.com/fin-ger/snore
cross-platform sleep
Last synced: 3 months ago
JSON representation
Runs for the given time and is similar to the Unix 'sleep' command
- Host: GitHub
- URL: https://github.com/fin-ger/snore
- Owner: fin-ger
- License: gpl-3.0
- Created: 2020-01-30T16:56:33.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-06T15:03:41.000Z (almost 6 years ago)
- Last Synced: 2025-08-28T07:21:21.195Z (5 months ago)
- Topics: cross-platform, sleep
- Language: Rust
- Homepage:
- Size: 64.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Welcome to snore 😴
Runs for the given time and is similar to the Unix sleep command
---
This program is meant to explore cross-platform distribution over many operating systems and package managers. The program provides a cross-platform interface for delaying the execution of a script for a given amount of time.
## Installation
### Install on Debian GNU/Linux
*Including Ubuntu, Linux Mint, ElementaryOS, SteamOS, ZorinOS, etc.*
**If unsure use this package!**
> The Debian package is not included in the Debian package repository, yet. For now you have to download and install it manually.
Download the `deb` package and install it with:
```shell
$ sudo apt-get install ./snore_0.1.1_amd64.deb
```
### Install on Fedora GNU/Linux
*Including Red Hat, CentOS, OpenSUSE, etc.*
> The Fedora package is not included in the Fedora package repository, yet. For now you have to download and install it manually.
Download the `rpm` package and install it with:
```shell
$ sudo rpm -i ./snore-0.1.1-0.x86_64.rpm
```
### Install on Gentoo GNU/Linux
*Including Sabayon*
> The ebuild is currently not included in the Gentoo packages. For now you have to use a [local overlay](https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/CustomTree#Defining_a_custom_repository) to install `snore`.
Download the ebuild and place it under `sys-apps/snore` under your local overlay and digest the ebuild:
```shell
# mv snore-0.1.1.ebuild /path/to/your/local-overlay/sys-apps/snore/
# ebuild snore-0.1.1.ebuild digest
```
After that you can install snore with `emerge`:
```shell
# emerge snore
```
### Install on Arch GNU/Linux
*Including Manjaro, Parabola, Chakra, etc.*
> snore is not provided in the AUR for the moment, you're required to build it manually via the provided PKGBUILD
To install `snore` download the `PKGBUILD` and use `makepkg` to build & install it with pacman.
```shell
$ mkdir snore-pkg
$ mv PKGBUILD snore-pkg/PKGBUILD
$ cd snore-pkg
$ makepkg -si
```
### Install on Alpine Linux
> snore is currently not included in the Alpine packages, yet. For now you have to download and install it manually.
To install `snore` download the `snore-0.1.1-r0.apk` and install it like this:
```
$ sudo apk add --allow-untrusted ./snore-0.1.1-r0.apk
```
### Install with Cargo
Install it with Cargo:
```shell
$ cargo install snore
```
If cargo installs into your `PATH`, you can run it like this:
```shell
$ snore
```
### MacOS Binary
Download the `snore-macos` binary and rename it to `snore`:
```shell
$ mv snore-macos snore
```
Before you can run the executable, you have to set the executable flag:
```shell
$ chmod +x /path/to/snore
```
You can now run the program with:
```shell
$ /path/to/snore
```
> Move the executable into your [`PATH`](https://askubuntu.com/questions/109381/how-to-add-path-of-a-program-to-path-environment-variable) to use it like any other program installed on the system
### Windows Executable
Download `snore-windows.exe` and rename it to `snore.exe`. You can now run the program in the Windows command-line:
```cmd
C:\> \path\to\snore.exe
```
> Move the executable into your [`PATH`](https://stackoverflow.com/a/41895179/7216382) to use it like any other program installed on the system
### Statically Linked Binary for Linux
Download the `snore-linux` binary suitable for your CPU architecture. If unsure, use **amd64**. After downloading, rename the executable to `snore`:
```shell
$ mv snore-linux-amd64 snore
```
Before you can run the executable, you have to set the executable flag:
```shell
$ chmod +x /path/to/snore
```
You can now run the program with:
```shell
$ /path/to/snore
```
> Move the executable into your [`PATH`](https://askubuntu.com/questions/109381/how-to-add-path-of-a-program-to-path-environment-variable) to use it like any other program installed on the system
## Usage
When `snore` is available in your `PATH` you can start using it.
**Run `snore` for one second**
```shell
$ snore 1
```
**Run `snore` for 200 milliseconds**
```shell
$ snore 200ms
```
**Run `snore` for 1 hour and 20 minutes**
```shell
$ snore 1h 20m
```
**Run `snore` for 2 seconds and 500 milliseconds**
```shell
$ snore 500ms 2s
```
**Run `snore` for one and a half seconds**
```shell
$ snore 1.5s
```
**Run `snore` for 0.001 days**
```shell
$ snore 0.001d
```
## Building the Project
Instead of downloading a precompiled binary, you can build the project yourself from source. First you have to setup a Rust toolchain. I recommend using [`rustup`](https://rustup.rs/). When the latest Rust stable toolchain is successfully installed, you can compile the code.
```
$ cargo install --path .
```
The program will be installed to `~/.cargo/bin/snore`.
## Troubleshooting
If you find any bugs/unexpected behaviour or you have a proposition for future changes open an issue describing the current behaviour and what you expected.
## Deployment TODO
- [x] elf statically linked binary
- [x] mac executable
- [x] windows exe
- [x] ebuild
- [x] rpm
- [x] deb
- [x] pkgbuild
- [x] apkbuild
- [ ] windows msi
- [ ] solaris
- [ ] homebrew
- [ ] macports
- [ ] chocolatey
- [ ] scoop
- [ ] nix
- [ ] openbsd
- [ ] netbsd
- [ ] freebsd
- [ ] npm
- [ ] pip
- [x] cargo
- [ ] ruby bundler
## Authors
**Fin Christensen**
> [:octocat: `@fin-ger`](https://github.com/fin-ger)
> [:elephant: `@fin_ger@weirder.earth`](https://weirder.earth/@fin_ger)
> [:bird: `@fin_ger_github`](https://twitter.com/fin_ger_github)
## Show your support
Give a :star: if this project helped you!