mirror of
https://github.com/rywng/dotfiles.git
synced 2024-11-15 15:31:50 +08:00
20 lines
363 B
Bash
Executable File
20 lines
363 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Disable and enable laptop screen only when external monitors found
|
|
monitor_count=$(swaymsg -t get_outputs | grep name | wc -l)
|
|
laptop_output="eDP-1"
|
|
|
|
if [ $monitor_count -gt 1 ]; then
|
|
case "$1" in
|
|
disable)
|
|
swaymsg output $laptop_output disable
|
|
;;
|
|
enable)
|
|
swaymsg output $laptop_output enable
|
|
;;
|
|
*)
|
|
echo "Invalid argument"
|
|
;;
|
|
esac
|
|
fi
|