Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # -*- mode: sh; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
- # vim: et sts=4 sw=4
- # SPDX-License-Identifier: LGPL-2.1+
- #
- # Copyright © 2019,2021 Collabora Ltd.
- # Copyright © 2019,2021 Valve Corporation.
- #
- # This file is part of steamos-customizations.
- #
- # steamos-customizations is free software; you can redistribute it and/or modify
- # it under the terms of the GNU Lesser General Public License as published
- # by the Free Software Foundation; either version 2.1 of the License, or
- # (at your option) any later version.
- set -eu;
- GPD=;
- DEBUG=0;
- XORG_CONF_FILE=/etc/X11/xorg.conf.d/40-rotation-quirk.conf;
- XORG_CONF_TEXT=$(cat - <<EOF
- Section "Monitor"
- Identifier "eDP-1"
- Option "Rotate" "right"
- Option "PreferredMode" "720x1280"
- EndSection
- Section "InputClass"
- Identifier "pointer:Goodix Capacitive TouchScreen"
- Option "Transformation Matrix" "0 1 0 -1 0 1 0 0 1"
- MatchProduct "Goodix"
- EndSection
- EOF
- );
- DEVICE_TEST=$(cat - <<EOF
- # this test block detects a thinkpad x220 which I use for
- # testing when I don't have a GPD: edit to match your own hw
- dmi system-manufacturer EQ LENOVO
- dmi system-product-name EQ 42914CG
- dmi system-version EQ ThinkPad\\ X220
- file /sys/class/drm/card0-LVDS-1/modes EQ 1366x768
- dmi bios-release-date IN 07/18/2013
- EOF
- );
- DEVICE_GPD=$(cat - <<EOF
- # This test block replicates the logic used by the kernel quirk
- # code so if it's wrong we're going to be broken anyway:
- dmi system-manufacturer EQ Default\\ string
- dmi system-product-name EQ Default\\ string
- dmi system-version EQ Default\\ string
- file /sys/class/drm/card0-eDP-1/modes EQ 720x1280
- dmi bios-release-date IN 12/07/2017 05/24/2018 06/29/2018
- EOF
- );
- trace ()
- {
- if [ "$DEBUG" = "1" ];
- then
- echo "$@" >&2;
- fi;
- }
- add-config ()
- {
- local file=$1;
- local text=$2;
- mkdir -p $(dirname "$file");
- echo "$text" > "$file";
- }
- del-config ()
- {
- local file=$1;
- if [ -f "$file" ]; then rm -f "$file"; fi;
- }
- export LC_ALL=C;
- export LANG=C;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement