Е
Size: a a a
AP
LA
ГБ
#!/bin/bash
# Copyright (C) 2021 George Bartolomey
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
#
inputs=$(xrandr | grep -v "disconnected" | grep connected | grep -Eo "^[^ ]+")
offinputs=$(xrandr | grep "disconnected" | grep -Eo "^[^ ]+")
command="xrandr"
prevdis=""
for display in $inputs
do
command="$command --output $display --auto"
if [ ! -z "$prevdis" ]; then
command="$command --right-of $prevdis"
else
command="$command --primary"
fi
prevdis=$display
done
for display in $offinputs
do
command="$command --output $display --off"
done
echo $command
echo "Is it ok (enter or ctrl-c)"?
read -r
$command
ГБ
ГБ
ГБ
Е
ГБ
ГБ
Е