I am trying to save my laptop’s battery by pausing/stopping completely chrome from doing stuff while minimized by manually sending it a kill-stop signal.
When I did that, I pressed CTRL+T to test if chrome can create a tab when it is stopped, chrome didn’t react with creating a new tab, but I noticed that the title of the window changed from my current tab name to “New Tab”, meaning it still somewhat working.
The line I am using for sending kill-stop signal is
sudo kill -STOP $(pidof chrome).
How can I completely stop chrome from consuming CPU time for a period of time, and saving all of my session in-memory (not having to exit and launch it again)? And why the method above didn’t completely work?
pidof is missing some processes, testing it with Chromium on Debian it returns 17 pid’s, while
ps ax|grep [path] returns 18 pid’s.
I’d use this instead, after finding chrome’s path with
cpath=`which chrome` pkill -f -STOP "$cpath"
Taking advantage of pkill’s
The pattern is normally only matched against the process name. When -f is set,
the full command line is used.