From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15483 invoked from network); 14 Dec 2020 12:40:09 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Dec 2020 12:40:09 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1607949609; b=ZsHnO3j/b/4YWl6kzm1Kv+dPf8QkriO8Y9X+JQTWG4TNfCKLNDyN08WJUYC9iLROqn3m4quYxi rLRCfjtSpFzD5Gb5T7MFiCoZnHfgmzvC4qKvW7i/PItr0QNlaILSKuY9Mi4+dClwbtctt6SzDa 29laBPdwfIRwbeQn9kuclYkXdSEBJFdNoTYtWvWYJ2ygDyPISaQtMlK4Dd8nentkvb86QnHQ2l 5rBWDjenn3Pxo2elv3HQH+Lv6rGl0Cen/IvHFGqQ5c+bGj0vqOhLMxMrKWV/MMnr142k6Me61d hh4Ey8hw2TKFs0qhjOLkyI+Ki2kS3r6E36h9+9Os5M0OJA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wr1-f53.google.com) smtp.remote-ip=209.85.221.53; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1607949609; bh=caxH5EHYu2h14HhfQ7+4lNNnTt3Hu1WUWEHnE3LgfWM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=Ao6XKsoJPx5E42DdC/PzHFonsLwZ99PEhB2zXEWkYMTsITS/CK5rdZepNMs34ikJHwC53lfoWG 5bF+UEYCU+m0cHG/R51mmWTqu4FGQH8wuozG+XWaFJ5aL7MI3KtsjM2vreWpz04DTN7JD/IlUA sj/JsckvpfWgkX+3mEr7Apo8ElXPkY/I/OGMAQUpp1RFBD4Xbzz4gzbSkfzildk0WVo5U6hwzL N7511P1Jri29NOhZ9MsPDAZhAXSSpH2ACFqc9/4w+qE0UNLYKC3I8gwa+lF7Uxf7Dun92/hI4h SS/qnAd1XxDXqak8aGa4EEG6I8wGq/QbJ5w4dNCXzFxyiQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=A84QbdB25E62fdFn3ayatqhF4s8SBdbM2+pFvCTtlHQ=; b=L7bE38lzubp+xSnKhtsRGIyOEa 4bBbloDMZqNGAmgvTn7Ln4xjYzrDfz6R4Iq+odoXXelw79W5Bw0YNnBycTTQFt4EpUNt6HMRVtqox z1Mm0n1TUWAz7lYUmxwgWvZa4FV10vKthRKkspyn9xvanmHH1REPYKpd2yJODgnFiU7v3dV22UVXJ qX4u5o7oPEJjh2umzWdPHT57KaHoHf05jtYzt8gQRKaIAjsBdZZJkz8UbvUcEyXMOknhxKvAnYwkI V9jvfjrOsqwd4/9yofADPkmbew1lBtXCIS5dShPov8o+Hvl2s813++UDmmscSHgM0QwFNR2Giw4JZ 6hkdVV/g==; Received: from authenticated user by zero.zsh.org with local id 1kon93-00066R-0I; Mon, 14 Dec 2020 12:40:05 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wr1-f53.google.com) smtp.remote-ip=209.85.221.53; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wr1-f53.google.com ([209.85.221.53]:41608) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kon8W-0005ir-Od; Mon, 14 Dec 2020 12:39:34 +0000 Received: by mail-wr1-f53.google.com with SMTP id a12so16200302wrv.8 for ; Mon, 14 Dec 2020 04:39:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=A84QbdB25E62fdFn3ayatqhF4s8SBdbM2+pFvCTtlHQ=; b=MCnLgx2/7v92kJJjTQraQ5nT8e2O4R8kV9htgfUy6/dATWwOWXL89q96LwzkIzK+xE 5nTOvHfNQqIHL2AaLn3cGWnH4UtspR5+ajgd9li5SblBwDR1e3WxBJq4fUF2w8JzvkNb Z1zHg0+qpmMu0U+/TVnCYPFEiE4cGzSDeYT4zNO7bcxN2EM/BPJOptYlcSsZpWnotwt3 1JLL2CF+EnTOiSjJDqrZ9BJ/EAxLfz5IbTG1gyaiZ6vLmDCWK+YtAI/dDMmSmpGf/B6x vC/LatImHjkymSeBGg8/MFDiUXPRCQepS9FbAM9ImLrmEJsGOmIuhOKUNu71NMhsZpY0 WS0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=A84QbdB25E62fdFn3ayatqhF4s8SBdbM2+pFvCTtlHQ=; b=oOQCdkd7SMpXb5iQUfBy1h4tUO9Jnj/sil9JwA3iKiYpofTCnn7BFI8aqVjmqvtGv8 Q4JGW5VCcuoAR6IYJbgqUsRnDlP3R/nwycRcKJt1ETppExg897fTdEcfqPm/k849t5aU WUiQoP49FUQfkRwXDiiz1aT+PZx23qxD4dmMnEhrSgufxWylKkHGLH/LQI9PHIE0IbBn K3P8k8rwm9u+EmJiys11GxFQpulob+g3cztXArf7SJf9MFr9W0zIDI8IKg3D3TdW9xUq jd06fneqjYqF5goH1GWRHFSBE15OkRA4Fj2BY2e96kBzKyzkS2UPxOahKIrXuBmFHudN KSWA== X-Gm-Message-State: AOAM5336nvAEHM6Q5lIKJGZ2i+Jolf29cQcMVayB8DowmjtaX4A+S6E4 DFHXvkuehTiK8MK/tQ3e6dzaviMjXOhP8MbE1WTEqiEY X-Google-Smtp-Source: ABdhPJxgoiV3QZwx6TEqCEIgZqEjDtSfTWqDmRRBrjDNKSTB10yqJg+ebiMg36KdZZBk5XMQ1cWlbjziaZFCzuL2V9c= X-Received: by 2002:a19:4ad8:: with SMTP id x207mr10411173lfa.9.1607949154178; Mon, 14 Dec 2020 04:32:34 -0800 (PST) MIME-Version: 1.0 From: "A. Wik" Date: Mon, 14 Dec 2020 11:57:59 +0000 Message-ID: Subject: Call a function when idle? To: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 26224 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: Hi all, For the most part, when I get started working at a terminal, I can do just fine with a simple and short prompt like "% ". A prompt that includes the current directory often gets annoyingly long so that you can rarely type a command line that doesn't scroll onto another line, which is harder to read. However, when I've been away from a terminal (window or tab) for some time, I would like to know where in the file system I am, to remind me (hopefully) of what I was doing. If the current working directory is not in the prompt, I have to type "pwd" manually. To solve the problem, I was thinking of getting a function to run after a specified period of idle time. This function could then run "print -P" to print useful pieces of data, such as the hostname, the tty name, etc., and of course the current directory. So, the question is how to set up an idle timer to call the function. I figured someone had already done something like that before (perhaps to log out automatically). Cheers, Albert Wik.