Metadata-Version: 2.4
Name: idle-term-killer
Version: 0.2.0
Summary: Kill idle terminal shells after a configurable period of inactivity
License: MIT
Project-URL: Homepage, https://github.com/t0mk/idle-term-killer
Project-URL: Repository, https://github.com/t0mk/idle-term-killer
Project-URL: Issues, https://github.com/t0mk/idle-term-killer/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: X11 Applications
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Desktop Environment
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: psutil>=5.9

# idle-term-killer

Kills terminal shell tabs that have been idle for too long.

A shell tab is killed when its PTY has had no I/O for longer than the configured threshold and it has no running child processes. The idle time is read from `/dev/pts/<N>` atime — the same source used by the `w` command. Works with any terminal emulator that forks shell children (xfce4-terminal, gnome-terminal, konsole, alacritty, kitty, etc.).

## Install

```
pip install idle-term-killer
```

## Configure

Create `~/.config/idle-term-killer/config.toml`:

```toml
[daemon]
idle_time_minutes = 5
check_interval_seconds = 60

# Optional — these are the defaults
[terminals]
emulators = ["xfce4-terminal", "gnome-terminal", "konsole", "xterm", "alacritty", "kitty", "tilix"]
shells = ["zsh", "bash", "sh", "fish", "dash"]
```

The daemon does nothing and exits cleanly if this file is absent.

## Run as a systemd user service

```
idle-term-killer install
```

This copies the service file to `~/.config/systemd/user/` and enables it. The service starts automatically on login.

```
idle-term-killer status     # check service status
idle-term-killer uninstall  # stop and remove the service
```

## One-shot / dry-run

```
idle-term-killer --dry-run --verbose   # show what would be killed
idle-term-killer                       # kill idle shells once and exit
```

## Requirements

- Linux (uses `/proc` and `/dev/pts`)
- Python 3.11+
- `psutil`
