DEV Community

George Shuklin
George Shuklin

Posted on

The most useful command in the age of agentic

I love when this 'thing' do stuff while I'm doing something else. We discussed, corrected plan, or it is in the middle of investigation, anyway, it's 5+ minutes. And I want to close the lid of the laptop, but continue this thing to work.

The modern systemd allows me that. This simple script prevent laptop to go to sleep by timeout or by closed lid, as long as it's running. Press Ctrl-C to terminate.

systemd-inhibit --what=handle-lid-switch:idle --who='manual' --why='nosleep script' sleep infinity
Enter fullscreen mode Exit fullscreen mode

Bingo, you can close lid and have stuff continue to be done.

Top comments (0)