mirror of
https://codeberg.org/privacy1st/arch
synced 2024-12-23 01:16:04 +01:00
further work on de-p1st-rotate
This commit is contained in:
parent
743cf91312
commit
2c09337e61
@ -2,7 +2,7 @@
|
|||||||
_pkgname=rotate
|
_pkgname=rotate
|
||||||
_reponame=arch
|
_reponame=arch
|
||||||
pkgname="de-p1st-$_pkgname"
|
pkgname="de-p1st-$_pkgname"
|
||||||
pkgver=0.0.6
|
pkgver=0.0.7
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Scripts to automate screen rotation"
|
pkgdesc="Scripts to automate screen rotation"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
@ -17,7 +17,7 @@ package() {
|
|||||||
cd "${_reponame}/pkg/${pkgname}"
|
cd "${_reponame}/pkg/${pkgname}"
|
||||||
|
|
||||||
install -Dm0555 usr/bin/de-p1st-rotate-screen "$pkgdir"/usr/bin/de-p1st-rotate-screen
|
install -Dm0555 usr/bin/de-p1st-rotate-screen "$pkgdir"/usr/bin/de-p1st-rotate-screen
|
||||||
install -Dm0555 usr/bin/de-p1st-auto-rotate "$pkgdir"/usr/bin/de-p1st-auto-rotate
|
|
||||||
|
|
||||||
|
install -Dm0644 -o0 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
|
install -Dm0644 -o0 etc/de-p1st-rotate/config.cfg "$pkgdir"/etc/de-p1st-rotate/config.cfg
|
||||||
}
|
}
|
||||||
|
3
pkg/de-p1st-rotate/examples/rotate.sh
Normal file
3
pkg/de-p1st-rotate/examples/rotate.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
de-p1st-rotate-screen
|
@ -3,12 +3,20 @@
|
|||||||
# @post: $SCREEN variable and $DEVICES array are set
|
# @post: $SCREEN variable and $DEVICES array are set
|
||||||
source /etc/de-p1st-rotate/config.cfg || exit $?
|
source /etc/de-p1st-rotate/config.cfg || exit $?
|
||||||
|
|
||||||
if [ "$#" -ne "1" ]; then
|
if [ "$#" -gt "1 " ] || [ "${1}" = "-h" ] || [ "${1}" = "--help" ] ; then
|
||||||
echo "usage: $0 ORIENTATION";
|
echo "usage:
|
||||||
|
- Manually specify orientation:
|
||||||
|
${0} ORIENTATION
|
||||||
|
- Automatically detect orientation:
|
||||||
|
${0}";
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "${1}" ]; then
|
||||||
|
ORIENTATION="$(/usr/lib/de-p1st-rotate/get-orientation)" || exit $?
|
||||||
|
else
|
||||||
ORIENTATION="$1"
|
ORIENTATION="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
# "xrandr ... || exit 1" does not work to check if $SCREEN exists.
|
# "xrandr ... || exit 1" does not work to check if $SCREEN exists.
|
||||||
# if e.g. the given output "$SCREEN" does not exist.
|
# if e.g. the given output "$SCREEN" does not exist.
|
||||||
|
@ -33,5 +33,4 @@ case "${ORIENTATION_STR}" in
|
|||||||
exit 1;
|
exit 1;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# echo "Detected device orientation ${ORIENTATION}"
|
echo "${ORIENTATION}"
|
||||||
de-p1st-rotate-screen "${ORIENTATION}"
|
|
Loading…
Reference in New Issue
Block a user