https://github.com/probeldev/niri-screen-time
Niri Screen Time
https://github.com/probeldev/niri-screen-time
hyprland linux macos niri screentime
Last synced: 5 months ago
JSON representation
Niri Screen Time
- Host: GitHub
- URL: https://github.com/probeldev/niri-screen-time
- Owner: probeldev
- License: mit
- Created: 2025-05-20T11:55:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-22T07:25:08.000Z (7 months ago)
- Last Synced: 2025-11-22T09:11:33.002Z (7 months ago)
- Topics: hyprland, linux, macos, niri, screentime
- Language: Go
- Homepage:
- Size: 12.3 MB
- Stars: 18
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-niri - niri-screen-time - A utility that collects information about how much time you spend in each application. (Tools / Miscellaneous)
- awesome-hyprland - Niri Screen Time
README
# Niri Screen Time
A utility that tracks how much time was spent on applications by their class and its title.

## Supported OS
### MacOs
- AeroSpace
- Default windows manager
### Linux
Supported Wayland Compositors:
- Niri
- Hyprland
## Installation
### go
```bash
go install github.com/probeldev/niri-screen-time@latest
```
> [!NOTE]
> If you get an error claiming that `niri-screen-time` cannot be found or that it is not defined, you
> may need to add `~/go/bin` to your $[PATH](https://jvns.ca/blog/2025/02/13/how-to-add-a-directory-to-your-path/).
### [aur](https://aur.archlinux.org/packages/niri-screen-time-git) (unofficial)
```bash
yay -S niri-screen-time-git
```
### nix
```bash
nix profile install github:probeldev/niri-screen-time
```
> [!NOTE]
> This is an imperative way of installing, and it is not preferred on Nix.
> You should define it in your Nix configuration instead.
## Usage
### Daemon
Daemon — a background service that collects data on application usage time (requires adding to startup for proper operation).
Start the daemon:
```bash
niri-screen-time -daemon
```
Add to startup for MacOs
```bash
niri-screen-time -autostart enable
```
### Report
(without key)
```bash
niri-screen-time
```
View data from a selected date until today:
```bash
niri-screen-time -from=2023-10-20
```
View data within a date range:
```bash
niri-screen-time -from=2023-10-01 -to=2023-10-31
```
#### Subroutine and Website Configuration
To track specific websites or console commands within applications, use the configuration file:
**Supported formats:** YAML (.yaml, .yml) or JSON (.json)
**Location:**
`~/.config/niri-screen-time/subprograms.{yaml,yml,json}`
*Priority order: .yaml → .yml → .json*
##### Configuration Format
**YAML:**
```yaml
- app_ids:
- application_identi1
- application_identi2
title_list:
- partial_window_title1
- partial_window_title2
alias: display_name
```
**JSON:**
```json
[
{
"app_ids": [
"application_identi1",
"application_identi2"
],
"title_list": [
"partial_window_title1",
"partial_window_title2"
],
"alias": "display_name"
}
]
```
##### Configuration Examples
For terminal commands:
**YAML:**
```yaml
- app_ids:
- com.mitchellh.ghostty
title_list:
- "NeoVim: ~/script/"
- "NeoVim: ~/.config"
alias: "NeoVim: edit configs"
```
**JSON:**
```json
{
"app_ids": [
"com.mitchellh.ghostty"
],
"title_list": [
"NeoVim: ~/script/",
"NeoVim: ~/.config"
],
"alias": "NeoVim: edit configs"
}
```
For websites in browser:
**YAML:**
```yaml
- app_ids:
- zen
- app.zen_browser.zen
title_list:
- Monkeytype
alias: Monkeytype
```
**JSON:**
```json
{
"app_ids": [
"zen",
"app.zen_browser.zen"
],
"title_list":[
"Monkeytype"
],
"alias": "Monkeytype"
}
```
Just alias:
**YAML:**
```yaml
- app_ids:
- org.gnome.Nautilus
title_list: []
alias: Nautilus
```
**JSON:**
```json
{
"app_ids": [
"org.gnome.Nautilus"
],
"title_list": [ ],
"alias": "Nautilus"
}
```
### Details
This mod adds detailed per-application stats.
```bash
niri-screen-time -details -appid="org.telegram.desktop" -title="" -from='2025-01-20' -to='2025-08-20' -limit=20 -onlytex
t
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.