<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: fralsare</title>
    <description>The latest articles on DEV Community by fralsare (@fralsare).</description>
    <link>https://dev.to/fralsare</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4128492%2F32354598-5354-4287-9ea5-2e97eafa2d23.png</url>
      <title>DEV Community: fralsare</title>
      <link>https://dev.to/fralsare</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fralsare"/>
    <language>en</language>
    <item>
      <title>How I Built a Linux CLI That Auto-Pauses Your "Active Time"</title>
      <dc:creator>fralsare</dc:creator>
      <pubDate>Thu, 24 Sep 2026 12:32:03 +0000</pubDate>
      <link>https://dev.to/fralsare/how-i-built-a-linux-cli-that-auto-pauses-your-active-time-3917</link>
      <guid>https://dev.to/fralsare/how-i-built-a-linux-cli-that-auto-pauses-your-active-time-3917</guid>
      <description>&lt;p&gt;A few weeks ago I wanted something simple: a way to see how much of my day I was actually using my computer versus just sitting at it. My existing time trackers counted every idle minute as wasted, which felt wrong - I wasn't being lazy, I was just… not doing anything.&lt;/p&gt;

&lt;p&gt;So I built timerCLI, a tiny command-line tool that tracks your active time and automatically pauses it whenever you go idle.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea
&lt;/h2&gt;

&lt;p&gt;The trick is simple but clever: Linux exposes raw input device events at /dev/input/event*. These are the kernel-level files that capture every keyboard press, mouse movement, and touch event.&lt;/p&gt;

&lt;p&gt;All timerCLI does is:&lt;/p&gt;

&lt;p&gt;Open every readable /dev/input/event* device (non-blocking)&lt;br&gt;
Continuously drain any pending input events&lt;br&gt;
Track the timestamp of the last event&lt;br&gt;
If no input arrives for IDLE_LIMIT seconds (default 30s), pause the timer&lt;br&gt;
Resume the instant input returns&lt;br&gt;
That's the entire engine — no machine-learning, no tracking servers, no telemetry. Just raw input watching.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the output looks like
&lt;/h2&gt;

&lt;p&gt;Idle:    0s | Active: 00:04&lt;br&gt;
⏸ Idle 31s — pausing…&lt;br&gt;
▶  Resumed.&lt;br&gt;
Idle:    0s | Active: 00:41   ← keeps counting down while paused&lt;/p&gt;

&lt;p&gt;When you stop typing/moving for 30 seconds, it pauses and shows a ⏸️ indicator. The moment you use your computer, it's back to counting active time. Stop it anytime with Ctrl+C and it prints your final active/paused totals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why keep it tiny?
&lt;/h2&gt;

&lt;p&gt;I deliberately wrote this using only Python's standard library - no psutil, no pyautogui, no dependencies to install. That means:&lt;/p&gt;

&lt;p&gt;It runs on almost any Linux box with Python 3&lt;br&gt;
Nothing to pip install&lt;br&gt;
Easy to read and modify&lt;br&gt;
The only real requirement is permission to read /dev/input/event*, which needs your user in the input group:&lt;/p&gt;

&lt;p&gt;sudo usermod -aG input $USER   # then log out and back in&lt;/p&gt;

&lt;h2&gt;
  
  
  It's open source
&lt;/h2&gt;

&lt;p&gt;timerCLI is MIT licensed and fully open source. You can read the whole thing in a few hundred lines here:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/fralsare/timerCLI" rel="noopener noreferrer"&gt;timerCLI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I built it as a learning project, but I'd love for people to actually use it. I'm also accepting donations (GitHub Sponsors + UPI) to fund my cybersecurity studies - every bit helps. 🙏&lt;/p&gt;

</description>
      <category>cli</category>
      <category>linux</category>
      <category>productivity</category>
      <category>tools</category>
    </item>
  </channel>
</rss>
