rm de-p1st-rotate

This commit is contained in:
Daniel Langbein 2022-05-23 13:54:26 +02:00
parent 571dd91f27
commit 51aef88456
7 changed files with 1 additions and 177 deletions

View File

@ -1,4 +1,4 @@
de-p1st-pam de-p1st-moz-touch de-p1st-cronie de-p1st-pacman-repo-chromium de-p1st-pacman-repo-surface de-p1st-image-width-limit de-p1st-signal-desktop de-p1st-docker de-p1st-zoom de-p1st-rotate de-p1st-locale de-p1st-systemd de-p1st-sudo de-p1st-screen de-p1st-htop de-p1st-pacman-mirrorlist de-p1st-networkmanager de-p1st-ucode-placeholder de-p1st-ucode-intel de-p1st-ucode-amd de-p1st-nano de-p1st-mkinitcpio de-p1st-makepkg de-p1st-grub de-p1st-font de-p1st-keyboard-de de-p1st-keyboard-x11-de de-p1st-gnupg de-p1st-redshift de-p1st-theme de-p1st-sddm-autologin-placeholder de-p1st-sddm-autologin-yoda de-p1st-sddm-theme-default de-p1st-sddm-theme-nordic de-p1st-gpu-generic de-p1st-gpu-amdgpu de-p1st-installer de-p1st-repo de-p1st-ssh-key-placeholder de-p1st-ssh-key-yoda
de-p1st-pam de-p1st-moz-touch de-p1st-cronie de-p1st-pacman-repo-chromium de-p1st-pacman-repo-surface de-p1st-image-width-limit de-p1st-signal-desktop de-p1st-docker de-p1st-zoom de-p1st-locale de-p1st-systemd de-p1st-sudo de-p1st-screen de-p1st-htop de-p1st-pacman-mirrorlist de-p1st-networkmanager de-p1st-ucode-placeholder de-p1st-ucode-intel de-p1st-ucode-amd de-p1st-nano de-p1st-mkinitcpio de-p1st-makepkg de-p1st-grub de-p1st-font de-p1st-keyboard-de de-p1st-keyboard-x11-de de-p1st-gnupg de-p1st-redshift de-p1st-theme de-p1st-sddm-autologin-placeholder de-p1st-sddm-autologin-yoda de-p1st-sddm-theme-default de-p1st-sddm-theme-nordic de-p1st-gpu-generic de-p1st-gpu-amdgpu de-p1st-installer de-p1st-repo de-p1st-ssh-key-placeholder de-p1st-ssh-key-yoda
de-p1st-pacman de-p1st-smartcard de-p1st-kernel-default de-p1st-kernel-lts de-p1st-dns de-p1st-ssh
de-p1st-base
de-p1st-base-gui

View File

@ -1,23 +0,0 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_pkgname=rotate
_reponame=arch
pkgname="de-p1st-$_pkgname"
pkgver=0.1.1
pkgrel=1
pkgdesc="Scripts to automate screen rotation"
arch=('any')
url="https://codeberg.org/privacy1st/${_reponame}"
license=('MIT')
optdepends=('iio-sensor-proxy-git') # iio-sensor-proxy did not work on my Surface Go 2 but the git version dos
makedepends=('git') # to fetch source(s) via git
source=("git+${url}.git")
sha256sums=('SKIP') # 'SKIP' for git sources; Otherwise: autofill using updpkgsums, see https://man.archlinux.org/man/updpkgsums.8.en
package() {
cd "${_reponame}/pkg/${pkgname}"
install -Dm0555 usr/bin/de-p1st-rotate-screen "$pkgdir"/usr/bin/de-p1st-rotate-screen
install -Dm0555 usr/lib/de-p1st-rotate/get-orientation "$pkgdir"/usr/lib/de-p1st-rotate/get-orientation
install -Dm0644 -o0 etc/de-p1st-rotate/config.cfg "$pkgdir"/etc/de-p1st-rotate/config.cfg
}

View File

@ -1,56 +0,0 @@
# Screen rotation scripts
* https://kevinbecker.org/blog/2019/11/21/dell-venue-10-pro-5055-screen-rotation-in-gnome
## Usage - XFCE4
Install the optional dependency `iio-sensor-proxy` or `iio-sensor-proxy-git`.
Create a launcher with an icon symbolising "screen rotation" and use the following command:
```shell
de-p1st-rotate-screen
```
Every time you click on the launcher, the screen gets rotated to the current device orientation.
## Usage without acceleration sensor - XFCE4
Create two launchers, one with icon "arrow left" the other one with "arrow right"
and use the following commands:
```shell
de-p1st-rotate-screen "left"
```
```shell
de-p1st-rotate-screen "normal"
```
With these two launchers rotating the screen left into portrait mode or back to landscape mode
is just one quick click away.
![screenshot of the two launcher icons](launchers-with-left-and-right-arrow-icons.png)
## inotifywait
**TODO**: Use `ionotifywait` to periodically call the rotation script.
See: https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu
## Surface Go 2
```shell
monitor-sensor --accell
```
just returns `orientation: undefined`.
After I switched to `iio-sensor-proxy-git` it was **working** until I rebooted.
Since then it does not work as well ...
**TODO**: Open an issue here: https://gitlab.freedesktop.org/hadess/iio-sensor-proxy

View File

@ -1,18 +0,0 @@
# The screen to rotate.
# One can list all screens with "xrandr --listmonitors".
SCREEN=eDP-1 # other values could be "eDP1" or "HDMI1"
# xinput devices to rotate together with the screen.
# One can list all xinput devices with "xinput --list".
DEVICES=()
#DEVICES+=( 'pointer:Wacom Pen and multitouch sensor Finger touch' ) # LenovoYoga460
#DEVICES+=( 'pointer:Wacom Pen and multitouch sensor Pen stylus' ) # LenovoYoga460
#DEVICES+=( 'pointer:Wacom Pen and multitouch sensor Pen eraser' ) # LenovoYoga460
#
DEVICES+=( 'pointer:ELAN9038:00 04F3:2A1C' ) # SurfaceGo2 (default)
DEVICES+=( 'pointer:ELAN9038:00 04F3:2A1C Stylus Pen (0)' ) # SurfaceGo2 (default)
DEVICES+=( 'pointer:ELAN9038:00 04F3:2A1C Stylus Eraser (0)' ) # SurfaceGo2 (default)
#
#DEVICES+=( 'pointer:ELAN9038:00 04F3:2A1C touch' ) # SurfaceGo2
#DEVICES+=( 'pointer:ELAN9038:00 04F3:2A1C stylus' ) # SurfaceGo2
#DEVICES+=( 'pointer:ELAN9038:00 04F3:2A1C eraser' ) # SurfaceGo2

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@ -1,44 +0,0 @@
#!/bin/bash
# @post: $SCREEN variable and $DEVICES array are set
source /etc/de-p1st-rotate/config.cfg || exit $?
if [ "$#" -gt "1 " ] || [ "${1}" = "-h" ] || [ "${1}" = "--help" ] ; then
echo "usage:
- Manually specify orientation:
${0} ORIENTATION
- Automatically detect orientation:
${0}" >&2;
exit 1;
fi
if [ -z "${1}" ]; then
ORIENTATION="$(/usr/lib/de-p1st-rotate/get-orientation)" || exit $?;
else
ORIENTATION="$1"
fi
# "xrandr ... || exit 1" does not work to check if $SCREEN exists,
# e.g. if the given output "$SCREEN" does not exist.
# Thus we check if $SCREEN is valid with grep:
xrandr --listmonitors | grep --quiet "\s${SCREEN}\$" || {
echo "The given screen ${SCREEN} does not exist." >&2;
exit 1;
}
xrandr --output "${SCREEN}" --rotate "${ORIENTATION}" || {
echo "Could not rotate ${SCREEN}!" >&2;
exit 1;
}
for i in "${DEVICES[@]}"; do
xinput --map-to-output "${i}" "${SCREEN}" || {
echo "Could not map device ${i} to screen ${SCREEN}! Please check output of 'xinput'." >&2;
FAILURE=true
}
done
if [ "${FAILURE}" = "true" ]; then
# At least one error occurred.
exit 1;
fi

View File

@ -1,35 +0,0 @@
#!/bin/bash
#
# Inspired by https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu
# Output of "monitor-sensor --accel | grep 'orientation'":
# === Has accelerometer (orientation: normal)
# Accelerometer orientation changed: right-up
# Feed output of 'monitor-sensor' and stop after first match of 'orientation'
ORIENTATION_STR="$(grep -m 1 'orientation' <( monitor-sensor ))" || exit $?
case "${ORIENTATION_STR}" in
*": normal"*)
ORIENTATION="normal";
;;
*": bottom-up"*)
ORIENTATION="inverted";
;;
*": right-up"*)
ORIENTATION="right";
;;
*": left-up"*)
ORIENTATION="left";
;;
*": undefined"*)
echo "Reported orientation is 'undefined'. Please rotate the device a bit and try again." >&2;
exit 1;
;;
*)
echo "Could not parse ORIENTATION_STR: ${ORIENTATION_STR}" >&2;
exit 1;
esac
echo "${ORIENTATION}"