Как уже говорилось в mem75, gnome-terminal не усекает, а завершает длинные строки. Но вы все равно используете less, и в этом случае это то, что делает обертку.
Чтобы less не обматывать длинные строки, используйте --chop-long-lines (или -S для короткий) вариант. (Они отображаются только на дисплее, и вы можете прокручивать их влево и вправо с помощью клавиш со стрелками.)
Перейдите в «Клавиатура» -> «Ярлыки», выберите «Пользовательские ярлыки» и нажмите «+», чтобы добавить новый ярлык.
«Имя» - описательное имя для действия (т. е. «Повернуть монитор», ). В «Command» введите пользовательскую команду для запуска при активации ярлыка.
Как только ярлык находится в списке, выберите его строку, нажмите ENTER, затем комбинацию клавиш, которую вы хотите активировать. Если есть конфликт, менеджер ярлыков скажет вам об этом, и вы можете выбрать другую комбинацию.
У вас может быть ярлык, позволяющий поворачивать дисплей, а другой - возвращать его в вертикальное положение. Вы можете даже, если вы достаточно осведомлены, напишите команду, которая поддерживает состояние и просто переключается между вертикальным / поворотным.
Теперь, что касается команды, которую вы должны использовать, это, вероятно, xrandr: [!d4 ]
xrandr --output HDMI1 --rotate left
xrandr --output HDMI1 --rotate normal
Выходной параметр зависит от того, к какому порту подключен ваш монитор. Чтобы узнать, что у вас есть, введите:
xrandr -q
Mine говорит:
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
1366x768 60.0*+
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA2 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
В этом случае my --output будет LVDS1, так как все остальные отключены.
Отлично работает с
xrandr --output LVDS1 --rotate left
xrandr --output LVDS1 --rotate right
xrandr --output LVDS1 --rotate inverted
xrandr --output LVDS1 --rotate normal
Вот хороший пример того, как это сделать, основываясь на вводе сенсора: https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu
. Поэтому в основном попробуйте приведенное выше, чтобы определить экран, который вы хотите увидеть повернутым , В зависимости от монитора модели может быть датчик, который посылает сигнал?
Это хорошо работает для моей Lenovo Yoga 2 11 с встроенным датчиком вращения, и он также перемещает док-станцию.
Сценарий:
#!/bin/sh
# Auto rotate screen based on device orientation
# Receives input from monitor-sensor (part of iio-sensor-proxy package)
# Screen orientation and launcher location is set based upon accelerometer position
# Launcher will be on the left in a landscape orientation and on the bottom in a portrait orientation
# This script should be added to startup applications for the user
# Clear sensor.log so it doesn't get too long over time
> sensor.log
# Launch monitor-sensor and store the output in a variable that can be parsed by the rest of the script
monitor-sensor >> sensor.log 2>&1 &
# Parse output or monitor sensor to get the new orientation whenever the log file is updated
# Possibles are: normal, bottom-up, right-up, left-up
# Light data will be ignored
while inotifywait -e modify sensor.log; do
# Read the last line that was added to the file and get the orientation
ORIENTATION=$(tail -n 1 sensor.log | grep 'orientation' | grep -oE '[^ ]+$')
# Set the actions to be taken for each possible orientation
case "$ORIENTATION" in
normal)
xrandr --output eDP1 --rotate normal && gsettings set com.canonical.Unity.Launcher launcher-position Left ;;
bottom-up)
xrandr --output eDP1 --rotate inverted && gsettings set com.canonical.Unity.Launcher launcher-position Left ;;
right-up)
xrandr --output eDP1 --rotate right && gsettings set com.canonical.Unity.Launcher launcher-position Bottom ;;
left-up)
xrandr --output eDP1 --rotate left && gsettings set com.canonical.Unity.Launcher launcher-position Bottom ;;
esac
done
и предпосылка для датчиков:
sudo apt install iio-sensor-proxy inotify-tools
Я написал сценарий оболочки для этого. (Требуется xrandr grep awk)
#!/bin/sh
# invert_screen copyright 20170516 alexx MIT Licence ver 1.0
orientation=$(xrandr -q|grep -v dis|grep connected|awk '{print $4}')
display=$(xrandr -q|grep -v dis|grep connected|awk '{print $1}')
if [ "$orientation" == "inverted" ]; then
xrandr --output $display --rotate normal
else
xrandr --output $display --rotate inverted
fi
Если вам нравятся однострочные:
[ "$(xrandr -q|grep -v dis|grep con|awk '{print $4}')" == 'inverted' ] && xrandr -o normal || xrandr -o inverted