ewmhisto

Ewmhisto

You ever restart your desktop and wonder what changed since yesterday? I have. A lot.

ewmhisto is a command-line tool that shows you the history of your desktop environment. It’s not magic. It’s just logs.

Plain text records of window manager states, session changes, and config tweaks.

Most people don’t know how to read those logs. Or even that they exist. So when something breaks (or) just feels off (you’re) guessing instead of knowing.

You want to fix things faster. You want to see what actually happened before the crash. You want control (not) just hope.

This article walks you through ewmhisto step by step. No jargon. No assumptions.

If you’ve run ls once, you can use this.

I’ve used it to track down misbehaving keybindings. To spot when a theme update silently broke my layout. To answer “Why did this stop working yesterday?”

You’ll learn how to run it. How to read its output. And how to tie that info to real problems you’re having right now.

By the end, you’ll know exactly when and why your desktop changed (and) how to go back.

What ewmhisto Actually Does

I run ewmhisto when my desktop starts acting weird.

It watches your window manager like a security camera watches a room.

Not the whole screen. Just the events: windows opening, closing, moving, switching focus.

That’s it. No screenshots. No keylogging.

Just clean timestamps and actions.

It works because of EWMH. The spec that lets parts of your desktop talk to each other.

You don’t need to know EWMH to use it. You just need to know something broke. And you want to see what happened right before.

Did a window vanish? Did focus jump for no reason? ewmhisto shows you the log.

You’ll ask yourself: What changed right before this stopped working?

I check it after crashes or freezes.

That’s where the log helps.

No fluff. No guessing. Just facts in order.

It doesn’t fix anything. It tells you what went down.

And sometimes that’s all you need.

You ever stare at a frozen app and think what the hell just happened?

Yeah. That’s why I leave it running.

Run ewmhisto Right Now

Open your terminal. That’s it. No setup yet.

Just open it.

Type ewmhisto and hit Enter. You’ll see a short list of recent window manager events. Nothing fancy.

Just timestamps and what changed.

It shows the last ten events by default. No config needed. No flags.

Just run it.

What if you get command not found?
Then it’s not installed.

On Ubuntu or Debian, try sudo apt install ewmh. Fedora users: sudo dnf install ewmh. Arch?

It’s in AUR as ewmh-git.

Don’t wait for perfect setup.
Run it now (even) if it fails.

You’ll learn more from that error than from reading three more paragraphs.

Why does it fail? Maybe your distro packages it under a different name. Maybe you need to build from source.

(I did. Took six minutes.)

But first. Just try it.

See what happens.

Then ask: Is this output useful for my workflow?
Or Do I even care about window focus changes right now?

Most people don’t. Until they do.

So run it. Look at the output. Decide if you want more.

That’s how you start.

What That ewmhisto Output Actually Says

I run ewmhisto and stare at the scroll.
It looks like noise until you know what to ignore.

First line: a timestamp. Like 1712345678. That’s seconds since 1970.

(Yes, Unix time. Yes, it’s ugly.)

Next comes the event type. Window Focus Changed. MapRequest. UnmapNotify. These aren’t cryptic. They’re literal.

Focus changed means you clicked into a window. MapRequest means a window just opened. UnmapNotify means it closed or minimized.

Then you get a window ID. Something like 0x1a00001. That number points to a real window on your screen.

Right now. You can ask xwininfo -id 0x1a00001 to see its title and size.

You’ll also see titles sometimes. Terminal (bash.) Firefox (News.) But don’t trust them blindly. Some apps lie. Some windows have no title at all.

That’s why the ID matters more.

Why does this matter? Because you’re debugging focus loss in your tiling WM. Or tracking why a window vanishes mid-type.

You’re not reading logs. You’re watching X11 breathe.

What’s the first thing you look for when it breaks? The timestamp? The ID?

Or just scream “why won’t this window stay focused”?

It’s not magic. It’s just X11 doing what X11 does. Loudly.

Cut the Noise. See What Matters.

ewmhisto

I run ewmhisto when I need to know what just happened. Not everything. Just the part I care about right now.

The -n flag cuts the list short. ewmhisto -n 10 shows only the last 10 events. That’s it. No scrolling.

No guessing.

You ever stare at fifty lines and think which one was the crash?
Yeah. Me too. So I type -n 5.

Five lines. Done.

The -s option lets you jump in time. Say you know something broke at 2:17 PM. You can start there instead of reading from the top.

(It’s not magic. It’s just time math.)

Combine them if you need to. ewmhisto -n 3 -s "2024-06-12 14:17" gives you three entries starting right when things went sideways. Try it. You’ll use it again tomorrow.

Why does this matter? Because logs aren’t stories. They’re evidence.

You don’t read all of them. You look for the clue.

I skip the rest.
You should too.

When ewmhisto Saves Your Sanity

My window vanished.
What happened right before that?

You’re not imagining it. That’s exactly when ewmhisto pays off.

It shows you the real-time event log from your window manager. No guessing. Just facts.

Why does that app keep stealing focus?
ewmhisto tells you. Down to the millisecond.

Debugging a weird race condition? You’ll see the exact order events fired. No more blind spots.

Curious how your desktop actually works? Run it for five minutes. You’ll learn more than three blog posts.

It’s not magic. It’s just raw data, served fast.

And if you want to go deeper? Check out the ewmhisto sisterhood empowerment by emergewomanmagazine for community-driven takeaways.

I run it every time something feels off.
You should too.

Your Desktop’s Story Starts Now

I know you’re tired of guessing what’s running on your desktop.
You want answers (not) mystery.

ewmhisto gives you that. No fluff. No guesswork.

Just raw history, right there in your terminal.

You’ve read this because something felt off. Because you needed control. Because you’re done with blind spots.

So stop reading.
Open your terminal right now and run ewmhisto.

See your desktop’s story unfold (today.)

About The Author

Scroll to Top