Skip to content

IdleNotify

Library implementing the ext-idle-notify-v1 wayland protocol.

Usage

You can browse the IdleNotify reference.

Library

js
import IdleNotify from "gi://AstalIdleNotify"

const notifier = IdleNotify.get_default()

const notif = notifier.get_input_idle_notification(1000)

notif.connect("idled", () => print("idled"))
notif.connect("resumed", () => print("resumed"))
py
from gi.repository import AstalIdleNotify as IdleNotify

notifier = IdleNotify.get_default()

notif = notifier.get_input_idle_notification(1000)

notif.connect("idled", lambda _: print("idled"))
notif.connect("resumed", lambda _: print("resumed"))
lua
local IdleNotify = require("lgi").require("AstalIdleNotify")

local notifier = IdleNotify.get_default()

local notif = notifier:get_input_idle_notification(1000)

notif.on_idled = function() print("idled") end
notif.on_resumed = function() print("resumed") end
vala
var notifier = AstalIdleNotify.get_default();

var notif = notifier.get_input_idle_notification(1000);

notif.idled.connect(() => print("idled\n"));
notif.resumed.connect(() => print("resumed\n"));

Installation

  1. install dependencies

    This lib does depend on AstalWl, which needs to be installed first.

    sh
    sudo pacman -Syu meson vala valadoc wayland-client gobject-introspection
    sh
    sudo dnf install meson vala valadoc wayland-devel wayland-protocols-devel gobject-introspection-devel
    sh
    sudo apt install meson valac valadoc libwayland-dev wayland-protocols gobject-introspection
  2. clone repo

    sh
    git clone https://github.com/aylur/astal.git
    cd astal/lib/idle-notify
  3. install

    sh
    meson setup build
    meson install -C build

Released under the LGPL v2.1 License