Skip to content

A simple COSMIC applet that prevents your system from going idle by creating a systemd-inhibit lock session.

License

Notifications You must be signed in to change notification settings

codevardhan/caffeine-applet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caffeine Applet for COSMIC DE

A simple COSMIC applet that prevents your system from going idle by creating a systemd-inhibit lock session. Perfect for keeping your machine awake on demand!

Features

  • Toggle Caffeine: Click the applet's icon to enable or disable an inhibit session.
  • Minimal: Only uses a tiny amount of memory and CPU.
  • Built with COSMIC: Integrates into your cosmic desktop or panel.

Installation

A justfile is included by default for the casey/just command runner.

  • just builds the application with the default just build-release recipe
  • just run builds and runs the application
  • just install installs the project into the system
  • just vendor creates a vendored tarball
  • just build-vendored compiles with vendored dependencies from that tarball
  • just check runs clippy on the project to check for linter warnings
  • just check-json can be used by IDEs that support LSP

Translators

Fluent is used for localization of the software. Fluent's translation files are found in the i18n directory. New translations may copy the English (en) localization of the project, rename en to the desired ISO 639-1 language code, and then translations can be provided for each message identifier. If no translation is necessary, the message may be omitted.

Packaging

If packaging for a Linux distribution, vendor dependencies locally with the vendor rule, and build with the vendored sources using the build-vendored rule. When installing files, use the rootdir and prefix variables to change installation paths.

just vendor
just build-vendored
just rootdir=debian/caffeine-applet prefix=/usr install

It is recommended to build a source tarball with the vendored dependencies, which can typically be done by running just vendor on the host system before it enters the build environment.

Developers

Developers should install rustup and configure their editor to use rust-analyzer. To improve compilation times, disable LTO in the release profile, install the mold linker, and configure sccache for use with Rust. The mold linker will only improve link times if LTO is disabled.

Usage

Once the applet is running:

  • Click the coffee-cup icon to toggle between awake (caffeine mode) and idle (normal). A PID file (/tmp/caffeine-id.txt) is maintained to track the systemd-inhibit session.
  • If the PID file already exists, it means a caffeine session is running (and you won’t be able to start a new one without stopping it first).

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request on GitHub. For major changes, please open an issue first to discuss what you would like to change.

About

A simple COSMIC applet that prevents your system from going idle by creating a systemd-inhibit lock session.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published