Skip to content

Instantly share code, notes, and snippets.

@nbtk123
nbtk123 / displays_count_sleep.sh
Last active August 16, 2021 10:43
Helps you not to forget your laptop active when no monitors are connected and the lid is closed
#!/bin/bash
# This script is for laptops only!
# It counts your displays. If you have only 1 display (the built-in), when you close the led the laptop will sleep.
# If you have at least <DISPLAYS_NUM> displays, hen you close the led nothing will happen.
# that's for cases that you forget your laptop not connected.
DISPLAYS_NUM=2
`touch test`