Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can I make a wish? I would like a wm which sends SIGSTOP to processes which window I minimized and SIGCONT when I un-minimize it.

For processes which use multiple windows, I'd be OK with all being minimized when one is to allow above functionality.

There was a time when it was desirable to make room on the visible desktop while keeping long running processes running, but today we have lots of desktop real-estate and few legitimate long running processes, instead web pages leaching CPU cycles (I look at you, github!).



On i3, with `i3-msg -m -t subscribe '["window"]'` you can get events when you change focus. With that and possibly the aid of `i3-msg -t get_tree` or some generic X utility like `xdotool search --onlyvisible \^`, you should be able to figure out which windows are hidden and which aren't. With `wmctrl -lp` you can match window ids to process ids and send whatever signals you want from a daemon script.

> There was a time when it was desirable to make room on the visible desktop while keeping long running processes running, but today we have lots of desktop real-estate and few legitimate long running processes, instead web pages leaching CPU cycles (I look at you, github!).

That probably depends on the person. It's not weird for me to have a web server running in the foreground of a terminal that's sometimes hidden. If it's stopped, it's not going to respond to my requests. It's in the foreground because there are times where it'll provide me a console to inspect the running state of the backend.

Same when I'm running an strace on a PID. Sometimes that terminal gets hidden. If that's stopped, the program whose PID I'm tracing is going to get frozen at some point.


You could run the web server (or other long running processes) within screen in the terminal, but yeah, that's stretching it.

I look into i3, thanks!


If your concern are webpages, you should first try sending SIGSTOP manually to some PID. Stopping a particular webpage may not be doable by stopping PIDs. There's nothing stopping multiple processes being involved in managing multiple windows non-exclusively (i.e. not only can a process manage multiple windows, a window can be managed by multiple processes). Your web browser may be beast enough to really complicate what you're trying to do.


Better to just add a new stop button rather than overload minimization. In any case, if your concern is web pages, your browser needs to implement this, not your window manager (unless you are not using tabbed browsing, which I doubt).


Do you happen to know why web browsers don't already do something like this? I find that a large number of domains are called every minute. I say domains as most of them seem to be providing Javascript, although some of them are the web site I have loaded. Very occasionally I can see a legitimate purpose, such as refreshing a page showing a web interface to an email account, but most of the time there doesn't seem to be a legitimate purpose.

Btw, this is from using Little Snitch on the Mac. If I temporarily block the refresh, nothing bad ever seems to happen.


I suspect there are just too many real things it would actually break. Alarm clock websites, for instance, off the top of my head.


Actually, I avoid using tabs. Reason being that I often have way too many pages displayed and have then difficulties finding a give one (chrome's taskmanager comes to the rescue, but that's not the most convenient workflow). The 'window list' applet of the DE allows me to find windows, but not tabs.


FWIW, I think that feature can be added to StumpWM using a few lines of code in .stumpwmrc




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: