-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from prtuson/master
Changes to make orientation work under systemd
- Loading branch information
Showing
4 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# /etc/systemd/system/orientation.service | ||
|
||
[Unit] | ||
Description=Authomativally Orientate Screen | ||
Wants=permissions.service | ||
After=permissions.service | ||
|
||
[Service] | ||
Group=users | ||
Environment="DISPLAY=:0" | ||
ExecStart=/usr/bin/orientation --debug=-1 | ||
ExecStop=/usr/bin/pkill -f orientation | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=graphical.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# /etc/systemd/system/permissions.service | ||
|
||
[Unit] | ||
Description=Set up Permissions for Automatic Screen Orientation | ||
After=suspend.target | ||
|
||
[Service] | ||
Type=oneshot | ||
Environment="DISPLAY=:0" | ||
# | ||
# Re-enable the touchscreen after suspend | ||
ExecStart=/sbin/rmmod usbhid hid_multitouch | ||
ExecStart=/sbin/modprobe usbhid hid_multitouch | ||
# | ||
# Set permissions | ||
ExecStart=/opt/set_permissions.sh | ||
|
||
[Install] | ||
# | ||
# Activate on startup and after suspend | ||
WantedBy=suspend.target | ||
WantedBy=graphical.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#! /bin/sh | ||
# | ||
# /opt/set_permissions.sh | ||
|
||
/bin/chgrp users /sys/bus/iio/devices/iio:device*/scan_elements/in_*_en /sys/bus/iio/devices/iio:device*/buffer/* /sys/bus/iio/devices/iio:device*/trigger/current_trigger | ||
/bin/chmod g+w /sys/bus/iio/devices/iio:device*/scan_elements/in_*_en /sys/bus/iio/devices/iio:device*/buffer/* /sys/bus/iio/devices/iio:device*/trigger/current_trigger | ||
/bin/chgrp users /dev/iio:device* | ||
/bin/chmod g+rw /dev/iio:device* |