From 626bc11ba27c93bfd28b218c179c4cb1df97a85b Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Thu, 16 Jun 2022 16:45:03 +0100 Subject: [PATCH] display-scaler: Make compatible with modesetting and xorg-video-intel --- data/umpc-display-scaler | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/data/umpc-display-scaler b/data/umpc-display-scaler index 4608556..b194732 100755 --- a/data/umpc-display-scaler +++ b/data/umpc-display-scaler @@ -10,13 +10,16 @@ case "${PRIMARY_RESOLUTION}" in SCALE=1;; esac -PRIMARY_DISPLAY=$(xrandr | grep "connected primary" | cut -d' ' -f1 | sed 's/ //g' | sed 's/-//g') -if [ "${PRIMARY_DISPLAY}" == "eDP1" ] || [ "${PRIMARY_DISPLAY}" == "DSI1" ]; then - xrandr --output "${PRIMARY_DISPLAY}" --brightness 0 - xrandr --output "${PRIMARY_DISPLAY}" --scale "${SCALE}x${SCALE}" - sleep 0.85 - xrandr --output "${PRIMARY_DISPLAY}" --brightness 1 - notify-send --expire-time=5000 --icon=info "${NOTIFY} (${PRIMARY_DISPLAY})" -else - notify-send --expire-time=5000 --icon=error "The primary display (${PRIMARY_DISPLAY}) is not compatible with UMPC Display Scaler." -fi +PRIMARY_DISPLAY=$(xrandr | grep "connected primary" | cut -d' ' -f1 | sed 's/ //g') +case "${PRIMARY_DISPLAY}" in + eDP1|eDP-1|DSI1|DSI-1) + xrandr --output "${PRIMARY_DISPLAY}" --brightness 0 + xrandr --output "${PRIMARY_DISPLAY}" --scale "${SCALE}x${SCALE}" + sleep 0.85 + xrandr --output "${PRIMARY_DISPLAY}" --brightness 1 + notify-send --expire-time=5000 --icon=info "${NOTIFY} (${PRIMARY_DISPLAY})" + ;; + *) + notify-send --expire-time=5000 --icon=error "The primary display (${PRIMARY_DISPLAY}) is not compatible with UMPC Display Scaler." + ;; +esac