9 Commits

Author SHA1 Message Date
forust 779d329d06 chore: release v1.3.3
ci / rust (push) Successful in 50s
ci / lint-yaml (push) Successful in 8s
release / verify (push) Successful in 21s
release / linux-amd64 (push) Successful in 31s
2026-09-10 11:54:34 +02:00
forust 897bbf7442 fix: mute input source instead of unmute
ci / rust (push) Successful in 49s
ci / lint-yaml (push) Successful in 12s
2026-09-06 12:38:33 +02:00
forust d82f5e7d99 Merge branch 'dev' into main
ci / rust (push) Successful in 49s
ci / lint-yaml (push) Successful in 11s
2026-08-07 08:31:15 +02:00
forust 1fdf46e42a fix: mute_input always mutes instead of toggling
release / verify (push) Successful in 20s
release / linux-amd64 (push) Failing after 28s
2026-08-07 08:31:12 +02:00
forust d0841d2c9b chore: release v1.3.1
release / verify (push) Successful in 28s
release / linux-amd64 (push) Failing after 47s
2026-07-12 14:22:45 +02:00
forust af2deabca4 feat: add mute_input, inhibit_sleep, monitor-off, notify actions
- mute_input: toggle mic via wpctl/pactl
- inhibit_sleep: systemd-inhibit during timer
- monitor-off: dpms backends (hyprland, niri, sway, kde, gnome, x11)
- notify: notify-send on timer finish
- lock: refactored with backend selection (loginctl, hyprlock,
  swaylock, i3lock, gnome, kde, xscreensaver)
- workspace: custom command override, sway/i3 backends
- power: add suspend, hibernate, hybrid-sleep modes
- editor: split VISUAL/EDITOR into program+args
- run: check stop flag during action loop
- history: record "partial" on action failures
2026-07-12 10:08:38 +02:00
forust 1edb82a057 feat: add monitor-off action, sway/i3 workspace
Monitor-off follows same per-backend dispatch as workspace.
Backends: hyprland, niri, sway, kde, gnome, x11, auto.
New workspace backends: sway, i3.
2026-07-07 23:23:50 +02:00
forust 1a77043a71 fix: editor split, stop flag in actions, write errors, history on failure, expect panic, string match
- src/main.rs: split VISUAL/EDITOR into prog+args, drop expect panic in reap_timer, propagate write_timer errors, check stop during actions, record history on partial failure, use const for stop msg
- Cargo.toml: add authors/homepage, bump noyalib 0.0.12->0.0.13
- release.yaml: tighten tag glob, fix curl 404 fallback, URI-encode asset name, upgrade upload-artifact v3->v4
- ci.yaml: add cargo cache step
- README.md: sync feature list, fix push to two-step
- RELEASING.md: clarify Cargo.lock regeneration
2026-07-07 23:13:19 +02:00
forust 69e20c89ee chore: release v1.2.2
ci / rust (push) Successful in 53s
ci / lint-yaml (push) Successful in 5s
release / verify (push) Successful in 27s
release / linux-amd64 (push) Successful in 38s
2026-07-05 03:26:48 +02:00
9 changed files with 1933 additions and 295 deletions
+8
View File
@@ -14,6 +14,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache Cargo registry and build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
target
key: cargo-${{ hashFiles('Cargo.lock') }}
- name: Check formatting
shell: bash
run: cargo fmt --check
+5 -4
View File
@@ -3,7 +3,7 @@ name: release
"on":
push:
tags:
- "v*.*.*"
- "v[0-9]*.[0-9]*.[0-9]*"
workflow_dispatch:
permissions:
@@ -69,7 +69,7 @@ jobs:
release_url="https://gitea.forust.xyz/api/v1/repos/forust/gosleep/releases"
existing="$(curl -fsS \
"${release_url}/tags/${tag}" \
-H "Authorization: token ${GITEA_TOKEN}" || true)"
-H "Authorization: token ${GITEA_TOKEN}")" || existing='{}'
release_id="$(printf '%s' "$existing" | jq -r '.id // empty')"
if [ -z "$release_id" ]; then
@@ -112,14 +112,15 @@ jobs:
-X DELETE "${release_url}/${release_id}/assets/${asset_id}" \
-H "Authorization: token ${GITEA_TOKEN}"
fi
encoded="$(printf '%s' "$name" | jq -sRr @uri)"
curl -fsS \
-X POST "${release_url}/${release_id}/assets?name=${name}" \
-X POST "${release_url}/${release_id}/assets?name=${encoded}" \
-H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@${asset}"
done
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: gosleep-timer-linux-amd64
path: dist/*
+58
View File
@@ -4,6 +4,60 @@ All notable changes to this project are documented here.
The project uses semantic versioning. Tags are formatted as `vMAJOR.MINOR.PATCH`.
## [1.3.3] - 2026-09-09
### Fixed
- Closed shell injection via `notify.message``notify-send` now uses direct args.
- Separated KDE monitor handling from lock — uses `kscreen-doctor --dpms off`.
- `pkill` and `notify-send` use `--` separator against option-injection.
- `is_dangerous` no longer false-positives on notify text and flags user-controlled shell.
- Edit error no longer loses input.
- `start_timer` validates config before spawning the thread.
### Changed
- TUI header centered and collapsed into `loaded config:`.
- Settings renamed/regrouped — screen off, mic mute, prevent sleep, power, kill processes.
- `enabled` suffix shown only for enabled actions.
- Edit input visible inline while editing.
- README synced: sway/i3, kscreen-doctor, notify.
## [1.3.2] - 2026-08-07
### Changed
- `mute_input` action now always mutes the microphone instead of toggling its current state.
## [1.3.1] - 2026-07-12
### Added
- Added `mute_input` action to toggle microphone mute via `wpctl`/`pactl`.
- Added `inhibit_sleep` config option to run `systemd-inhibit` during the timer.
- Added `monitor` action with backend selection (hyprland, niri, sway, kde, gnome, x11) to turn off displays.
- Added `notify` action to send desktop notification on timer finish.
- Added `suspend`, `hibernate`, `hybrid-sleep` power modes.
- Added workspace backend support for `sway` and `i3`.
- Added custom `workspace command` override.
### Changed
- Lock action refactored with backend selection: `loginctl`, `hyprlock`, `swaylock`, `i3lock`, `gnome`, `kde`, `xscreensaver`.
- Editor command now correctly splits `VISUAL`/`EDITOR` into program and arguments.
- Timer action loop checks the stop flag between actions.
### Fixed
- History now records `partial` status when some actions fail instead of bailing entirely.
## [1.2.2] - 2026-07-05
### Changed
- Updated Ratatui to 0.30.2 to remove the unmaintained `paste` transitive dependency and pick up the fixed `lru` dependency line.
- Replaced deprecated `serde_yaml`/`unsafe-libyaml` with the pure-Rust `noyalib` YAML parser.
## [1.2.1] - 2026-07-05
### Changed
@@ -48,6 +102,10 @@ The project uses semantic versioning. Tags are formatted as `vMAJOR.MINOR.PATCH`
- Added YAML configuration, CLI `init`, `preview`, and `run` commands.
- Added Gitea CI and tag-based release workflows.
[1.3.3]: https://gitea.forust.xyz/forust/gosleep/releases/tag/v1.3.3
[1.3.2]: https://gitea.forust.xyz/forust/gosleep/releases/tag/v1.3.2
[1.3.1]: https://gitea.forust.xyz/forust/gosleep/releases/tag/v1.3.1
[1.2.2]: https://gitea.forust.xyz/forust/gosleep/releases/tag/v1.2.2
[1.2.1]: https://gitea.forust.xyz/forust/gosleep/releases/tag/v1.2.1
[1.2.0]: https://gitea.forust.xyz/forust/gosleep/releases/tag/v1.2.0
[1.1.3]: https://gitea.forust.xyz/forust/gosleep/releases/tag/v1.1.3
Generated
+1107 -174
View File
File diff suppressed because it is too large Load Diff
+6 -4
View File
@@ -1,11 +1,13 @@
[package]
name = "gosleep-timer"
version = "1.2.1"
version = "1.3.3"
authors = ["forust"]
edition = "2024"
rust-version = "1.85"
rust-version = "1.88"
description = "Terminal sleep timer for Linux desktop actions, with YAML config and a Rust TUI"
license = "MIT"
repository = "https://gitea.forust.xyz/forust/gosleep"
homepage = "https://gitea.forust.xyz/forust/gosleep"
readme = "README.md"
keywords = ["timer", "tui", "linux", "desktop", "sleep"]
categories = ["command-line-utilities"]
@@ -18,9 +20,9 @@ path = "src/main.rs"
anyhow = "1.0"
clap = { version = "4.5", features = ["derive"] }
crossterm = "0.29"
ratatui = "0.29"
ratatui = "0.30.2"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.9"
noyalib = "0.0.13"
[profile.release]
codegen-units = 1
+14 -5
View File
@@ -2,7 +2,7 @@
Rust TUI sleep timer for Linux desktop actions.
`gosleep-timer` waits for a configured duration, then runs post-countdown desktop commands such as switching workspace, stopping media, dimming brightness, muting audio, locking the session, killing selected processes, powering off/rebooting, or running custom shell commands.
`gosleep-timer` waits for a configured duration, then runs post-countdown desktop commands such as switching workspace, stopping media, dimming brightness, muting audio, locking the session, turning the screen off, sending a desktop notification, killing selected processes, powering off/rebooting, or running custom shell commands.
## Status
@@ -15,10 +15,10 @@ Rust TUI sleep timer for Linux desktop actions.
- Single Rust binary, independent of Python.
- Ratatui/Crossterm terminal UI.
- YAML config at `~/.config/gosleep-timer/config.yaml` or `$XDG_CONFIG_HOME/gosleep-timer/config.yaml`.
- CLI commands for initialization, preview, and direct timer runs.
- CLI commands for init, status, validate, edit, preview, run, history, and stats.
- Time-left display and progress bar.
- Wrapped command preview for smaller terminals.
- Linux desktop action support for niri, Hyprland, KDE, playerctl, brightnessctl/light, PipeWire/PulseAudio, systemd, and custom shell commands.
- Linux desktop action support for niri, Hyprland, sway, i3, KDE, playerctl, brightnessctl/light, PipeWire/PulseAudio, systemd, desktop notifications, and custom shell commands.
## Install
@@ -145,6 +145,8 @@ actions:
value: 30
mute:
enabled: false
mute_input:
enabled: false
lock:
enabled: false
command: loginctl lock-session
@@ -163,7 +165,7 @@ Supported values:
| Field | Values |
| --- | --- |
| `duration` | Go-style duration strings such as `25m`, `45m`, `1h30m`, `10s` |
| `actions.workspace.backend` | `auto`, `niri`, `hyprland`, `kde` |
| `actions.workspace.backend` | `auto`, `niri`, `hyprland`, `sway`, `i3`, `kde` |
| `actions.media.action` | `none`, `stop`, `pause`, `play-pause`, `next`, `previous` |
| `actions.power.mode` | `none`, `poweroff`, `reboot` |
@@ -174,15 +176,21 @@ Supported values:
```sh
niri msg action focus-workspace <number>
hyprctl dispatch workspace <number>
swaymsg workspace number <number>
i3-msg workspace number <number>
qdbus org.kde.KWin /KWin org.kde.KWin.setCurrentDesktop <number>
```
Screen off (`monitor`) on KDE runs `kscreen-doctor --dpms off`, desktop notifications (`notify`) use `notify-send`, and `inhibit_sleep` maps to the TUI `prevent sleep` toggle.
Other actions use common Linux desktop tools:
- `playerctl`
- `brightnessctl` or `light`
- `wpctl` or `pactl`
- `loginctl`
- `kscreen-doctor`
- `notify-send`
- `pkill`
- `systemctl`
@@ -224,7 +232,8 @@ Release tags must match the package version:
```bash
git tag -a vMAJOR.MINOR.PATCH -m "gosleep-timer vMAJOR.MINOR.PATCH"
git push origin main --tags
git push origin main
git push origin vMAJOR.MINOR.PATCH
```
## Releases
+1 -1
View File
@@ -52,7 +52,7 @@ version=1.1.4
Update:
- `Cargo.toml`: `package.version`
- `Cargo.lock`: package version, regenerated by Cargo
- `Cargo.lock`: run `cargo build --release` (without `--locked`) to regenerate
- `VERSION`
- `CHANGELOG.md`
+1 -1
View File
@@ -1 +1 @@
1.2.1
1.3.3
+733 -106
View File
File diff suppressed because it is too large Load Diff