diff --git a/thinkpad-yoga-rotate/PKGBUILD b/thinkpad-yoga-rotate/PKGBUILD deleted file mode 100644 index 9d377fb..0000000 --- a/thinkpad-yoga-rotate/PKGBUILD +++ /dev/null @@ -1,27 +0,0 @@ -# Maintainer: oggy - -pkgname=thinkpad-yoga-rotate -pkgver=0.3 -pkgrel=1 -pkgdesc="A small Thinkpad Yoga utility to automatically rotate the screen in tablet mode" -url="https://github.com/oggy-/thinkpad-yoga-rotate" -license=('GPL-3') -arch=('any') -depends=('xorg-xrandr' 'acpid') -source=('rotate-screen.sh' 'tablet-mode') -sha1sums=('81eebe35cbfc61f17ecaef51506cadefc9412155' - 'adf3aa47174d32f23f4f52186bdc8de07a802ddc') -install=$pkgname.install - -package() { - # "Register" the tablet-mode event and set the handler - mkdir -p "$pkgdir/etc/acpi/events" - install -m 644 tablet-mode "$pkgdir/etc/acpi/events" - - # Install the handler - mkdir -p "$pkgdir/etc/acpi/actions" - install -m 755 rotate-screen.sh "$pkgdir/etc/acpi/actions" -} - - - diff --git a/thinkpad-yoga-rotate/rotate-screen.sh b/thinkpad-yoga-rotate/rotate-screen.sh deleted file mode 100755 index e56cc19..0000000 --- a/thinkpad-yoga-rotate/rotate-screen.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# Note: xrandr needs to execute in the context of the X server - -# Find the user running the X server -user="$(who -u | grep -F '(:0)' | head -n 1 | awk '{print $1}')" - -# A convenience function to run a command in the X server context -with_display() { DISPLAY=:0 su -c "$(printf "%q " "$@")" "$user"; } - -# As the same ACPI event is currently emitted for both going in and out -# of the tablet mode, we need to toggle the orientation - -# Figure out the current rotation: -current=`with_display xrandr -q --verbose | grep eDP1 | grep -o -E 'left|normal' | head -1` - - -# Set the next orientation -case $current in - normal) next=left;; - left) next=normal;; -esac - -with_display xrandr -o $next diff --git a/thinkpad-yoga-rotate/tablet-mode b/thinkpad-yoga-rotate/tablet-mode deleted file mode 100644 index 3e79724..0000000 --- a/thinkpad-yoga-rotate/tablet-mode +++ /dev/null @@ -1,2 +0,0 @@ -event=ibm/hotkey LEN0068:00 00000080 000060c0 -action=/etc/acpi/actions/rotate-screen.sh diff --git a/thinkpad-yoga-rotate/thinkpad-yoga-rotate.install b/thinkpad-yoga-rotate/thinkpad-yoga-rotate.install deleted file mode 100644 index 25b8b5f..0000000 --- a/thinkpad-yoga-rotate/thinkpad-yoga-rotate.install +++ /dev/null @@ -1,11 +0,0 @@ -_note_restart_acpi(){ - echo "You need to restart acpid now" -} - -post_install(){ - _note_restart_acpi -} - -post_upgrade(){ - _note_restart_acpi -} diff --git a/thinkpad-yoga-tablet/PKGBUILD b/thinkpad-yoga-tablet/PKGBUILD deleted file mode 100644 index 9d377fb..0000000 --- a/thinkpad-yoga-tablet/PKGBUILD +++ /dev/null @@ -1,27 +0,0 @@ -# Maintainer: oggy - -pkgname=thinkpad-yoga-rotate -pkgver=0.3 -pkgrel=1 -pkgdesc="A small Thinkpad Yoga utility to automatically rotate the screen in tablet mode" -url="https://github.com/oggy-/thinkpad-yoga-rotate" -license=('GPL-3') -arch=('any') -depends=('xorg-xrandr' 'acpid') -source=('rotate-screen.sh' 'tablet-mode') -sha1sums=('81eebe35cbfc61f17ecaef51506cadefc9412155' - 'adf3aa47174d32f23f4f52186bdc8de07a802ddc') -install=$pkgname.install - -package() { - # "Register" the tablet-mode event and set the handler - mkdir -p "$pkgdir/etc/acpi/events" - install -m 644 tablet-mode "$pkgdir/etc/acpi/events" - - # Install the handler - mkdir -p "$pkgdir/etc/acpi/actions" - install -m 755 rotate-screen.sh "$pkgdir/etc/acpi/actions" -} - - - diff --git a/thinkpad-yoga-tablet/rotate-screen.sh b/thinkpad-yoga-tablet/rotate-screen.sh deleted file mode 100755 index e56cc19..0000000 --- a/thinkpad-yoga-tablet/rotate-screen.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# Note: xrandr needs to execute in the context of the X server - -# Find the user running the X server -user="$(who -u | grep -F '(:0)' | head -n 1 | awk '{print $1}')" - -# A convenience function to run a command in the X server context -with_display() { DISPLAY=:0 su -c "$(printf "%q " "$@")" "$user"; } - -# As the same ACPI event is currently emitted for both going in and out -# of the tablet mode, we need to toggle the orientation - -# Figure out the current rotation: -current=`with_display xrandr -q --verbose | grep eDP1 | grep -o -E 'left|normal' | head -1` - - -# Set the next orientation -case $current in - normal) next=left;; - left) next=normal;; -esac - -with_display xrandr -o $next diff --git a/thinkpad-yoga-tablet/thinkpad-yoga-rotate.install b/thinkpad-yoga-tablet/thinkpad-yoga-rotate.install deleted file mode 100644 index 25b8b5f..0000000 --- a/thinkpad-yoga-tablet/thinkpad-yoga-rotate.install +++ /dev/null @@ -1,11 +0,0 @@ -_note_restart_acpi(){ - echo "You need to restart acpid now" -} - -post_install(){ - _note_restart_acpi -} - -post_upgrade(){ - _note_restart_acpi -}