-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiio-sensor-rotate.service
More file actions
27 lines (24 loc) · 1.14 KB
/
iio-sensor-rotate.service
File metadata and controls
27 lines (24 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[Unit]
Description=Auto-rotate screen based on accelerometer info
After=basic.target dbus.socket
Conflicts=exit.target
[Service]
Type=simple
# Python3 defaults to quite a large buffer for stdout/stderr.
# This makes the journal significantly less useful for debugging because the log messages don't appear immediately.
Environment=PYTHONUNBUFFERED=LiterallyAnyNonZeroString
ExecStart=%h/vcs/misc-scripts/iio-sensor-rotate.py
# Reset rotation back to normal
ExecStopPost=xrandr --output eDP-1 --rotation normal
# Hide the on-screen keyboard
ExecStopPost=dbus-send --type=method_call --print-reply --dest=org.onboard.Onboard /org/onboard/Onboard/Keyboard org.onboard.Onboard.Keyboard.Hide
ExecStopPost=sleep 2
ExecStopPost=dbus-send --type=method_call --print-reply --dest=org.onboard.Onboard /org/onboard/Onboard/Keyboard org.onboard.Onboard.Keyboard.Hide
# Screen isn't always turning back on properly
ExecStopPost=xrandr --output eDP-1 --auto
## FIXME: these are copied from most of PrisonPC's systemd jobs, but apparently are "NOT APPROPRIATE for" any of them
Restart=on-failure
RestartSec=30s
StartLimitBurst=0
# [Install]
# WantedBy=graphical-session.target