AppleGamer22/cocainate
关于
A cross-platform caffeinate alternative that keeps your screen on.
开发工具实测星标增长
- 24小时
- 0
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文cocainate
Description
cocainate is a cross-platform CLI utility for keeping the screen awake until stopped, or for a specified duration.
Why This Name?
The program's functionality and name are inspired by macOS's caffeinate utility that prevents the system from entering sleep mode.
This name is simply a stupid pun, therefore I do not condone and do not promote drug use, for more information: Wikipedia.
Installation
Nix Flakes
{
inputs = {
# or your preferred NixOS channel
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
applegamer22.url = "github:AppleGamer22/nur";
};
outputs = { nixpkgs }: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
specialArgs = {
pkgs = import nixpkgs {
# ...
overlays = [
(final: prev: {
# ...
ag22 = applegamer22.packages."<your_system>";
})
];
};
};
modules = [
# or in a separate Nix file
({ pkgs, ... }: {
programs.nix-ld.enable = true;
environment.systemPackages = with pkgs; [
ag22.cocainate
];
})
# ...
];
};
};
}
Arch Linux Distributions
yay:
yay -S cocainate-bin
paru:
paru -S cocainate-bin
macOS
brew install AppleGamer22/tap/cocainate
Windows (working progress)
winget install AppleGamer22.cocainate
Other
go:- Does not ship with:
- a manual page
- pre-built shell completion scripts
- Does not ship with:
go install github.com/AppleGamer22/cocainate
Functionality
Root -d/--duration Flag
This is an optional flag that accepts a duration string (see Go's time.ParseDuration for more details). If this flag is not provided, the program will run until manually stopped.
Acceptable Time Units
- nanoseconds:
ns - microseconds:
usorµs - milliseconds:
ms - seconds:
s - minutes:
m - hours:
h
Examples
- 10 hours:
-d 10h - 1 hour, 10 minutes and 10 seconds:
-d 1h10m10s - 1 microsecond:
-d 1us
If the -p flag is provided, the -d flag's value is used as process polling interval.
Root -p/--pid Flag
This is an optional flag that accepts a process ID (PID). If a valid PID is provided, the program will wait until that process is terminated. The delay between the termination of the provided process and the termination of screensaver inhibitation depends on the -d flag (which must be provided).
version Sub-command
-v/--verbose Flag
- If this flag is provided, the following details are printed to the screen:
- semantic version number
- commit hash
- Go compiler version
- processor architecture & operating system
- Otherwise, only the semantic version number is printed.
Dependencies
Linux
- D-Bus
- One of the following desktop environments:
- KDE 4 or later
- GNOME 3.10 or later
- Any other desktop environment that implements
org.freedesktop.ScreenSaver
Common Contributor Routines
Testing
Running the following command will run go test on the commands and session sub-modules:
make test
Building From Source
Development
- Using the following
makecommand will save acocainatebinary with the last version tag and the latest git commit hash:
make debug
Release
- Using the following GoReleaser command with a version
gittag and a cleangitstate:
goreleaser build --clean
- All release artificats will stored in the
distchild directory in the codebase's root directory:- compressed package archives with:
- a
cocainatebinary - manual page
- shell completion scripts
- a
- checksums
- change log
- compressed package archives with:
Copyright
cocainate is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
cocainate is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
探索相关项目
加载中…