Clamshell mode allows you to work with your laptop lid closed, using an external monitor, keyboard, and mouse.
Required
- At least one external monitor is connected
- The laptop lid is closed
Optional
The laptop is connected to AC powerTODO
macOS and systemd-based implementations require AC power as an absolute condition for clamshell mode, but clamshell does not. It also does not depend on any init system, so it works in any environment.
To install, you need xmake, cmake, ninja, and gcc.
chmod +x service/systemd/install.sh
service/systemd/install.shAfter installation, enable clamshell with the following commands:
sudo systemctl restart systemd-logind
sudo systemctl enable --now clamshellA configuration file that disables systemd's control of the lid will be created at /etc/systemd/logind.conf.d/clamshell.conf.
To uninstall clamshell, delete /etc/systemd/logind.conf.d/clamshell.conf to restore systemd's lid control.
chmod +x service/openrc/install.sh
service/openrc/install.shAfter installation, enable clamshell with the following commands:
sudo rc-update add clamshell default
sudo rc-service clamshell startContributions are welcome ;)
The configuration file is in TOML format and is loaded in the following order:
~/.config/clamshell/config.conf โ /etc/clamshell/config.conf
Whether to automatically fall back to another mode if the mode specified by suspend_mode_type is unavailable.
Default: false
The suspend method to use.
Default: freeze
| Value | Description |
|---|---|
freeze |
Freezes the CPU. The lightest option and works in most environments. |
suspend_to_ram |
Uses RAM suspend (S3). |
suspend_to_disk |
Uses disk suspend (hibernation). |
The suspend method to use when an NVIDIA GPU is present.
Default: official_script
| Value | Description |
|---|---|
official_script |
Uses /usr/bin/nvidia-sleep.sh This is the recommended option. |
direct_proc |
Directly uses /proc/driver/nvidia/suspend Not recommended due to instability. |
- Turn off the laptop display using DPMS
- Allow user configuration via D-Bus
- Add AC power connection as an optional condition
