Skip to main content

Kill idle terminal shells after a configurable period of inactivity

Project description

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:

[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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idle_term_killer-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idle_term_killer-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file idle_term_killer-0.1.0.tar.gz.

File metadata

  • Download URL: idle_term_killer-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for idle_term_killer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 55fd7abb5cb97ceaeba8f80d4bf7efab1d1a9247cd37dc5ece569fdf1368af6c
MD5 c7ad33750fa09f52454babeb0884b87b
BLAKE2b-256 7f40c05fc9c52976956d3c70858f19b251d2917c4b96e18d884857a4cdb4cabe

See more details on using hashes here.

File details

Details for the file idle_term_killer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: idle_term_killer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for idle_term_killer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 708d26c932894bb34f68a195fb58ed780c99317fc86f7785df7f0dbccb0c8b07
MD5 ebd7e9d766994c6c1f1f1ccd5e950893
BLAKE2b-256 4c04ac276707ade1b5889f3420ab7b7d1e0b752615d59b6d540b0ca395f388b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page