LinuxCommandLibrary

kde-inhibit

Inhibit KDE power management and screen locking

TLDR

Inhibit power management

$ kde-inhibit --power [command] [command_arguments]
copy

Inhibit screen saver
$ kde-inhibit --screenSaver [command] [command_arguments]
copy

Launch VLC, and inhibit color correction (night mode) while it's running
$ kde-inhibit --colorCorrect [vlc]
copy

SYNOPSIS

kde-inhibit [inhibitor]... [-w|--wait] [--] [command [args...]]

PARAMETERS

screensaver
    Inhibit screensaver activation

dpms
    Inhibit Display Power Management Signaling

sleep
    Inhibit system suspend/sleep

switchuser
    Inhibit user switching

logout
    Inhibit logout prompts

idle
    Inhibit all idle timeouts (screensaver, DPMS, sleep)

-w, --wait
    Tie inhibition to command exit (default: forever)

--
    Separator; ends inhibitor list

command [args]
    Optional command to run under inhibition

DESCRIPTION

kde-inhibit is a command-line tool in KDE Plasma for temporarily disabling automatic desktop behaviors like screensavers, display power management (DPMS), system sleep, logout prompts, user switching, and idle detection. It is ideal for scripts or applications needing uninterrupted sessions, such as backups, compilations, video rendering, or presentations where sleep or blanking would disrupt work.

The tool uses D-Bus to communicate with Plasma's power management services (e.g., KScreenSaver, KIdleTime, solid-power). Specify one or more inhibitors, optionally the --wait flag to tie inhibition to a command's duration, and a command to execute. Without a command, inhibition persists until manually terminated (e.g., Ctrl+C or kill).

Inhibitions are application-scoped with an auto-generated ID based on the command or a fallback. It adheres to Freedesktop standards for portability. Use cases include preventing laptop sleep during long tasks or blocking logout during critical operations. Note that effectiveness depends on the Plasma session and configured power settings.

CAVEATS

Requires KDE Plasma session; ineffective in other DEs. May conflict with global power settings or other inhibitors. No stacking for identical apps; use SIGTERM to release indefinite inhibitions.

EXAMPLES

kde-inhibit screensaver sleep 3600
Inhibits screensaver during 1-hour sleep.

kde-inhibit -w idle make -j8
Inhibits idle during compilation until done.

kde-inhibit sleep logout
Inhibits sleep/logout forever (Ctrl+C to stop).

APP ID

Auto-generated from command basename; customize via DBus if needed for multi-instance.

HISTORY

Developed for KDE Plasma 4/5 by KDE team to simplify D-Bus inhibition calls. Enhanced in Plasma 5.20+ for better Freedesktop compliance and idle handling.

SEE ALSO

Copied to clipboard