Permalink
Browse files

example: pull battery to separate variable in 'dynamic' example (than…

…ks nguillaumin!)
  • Loading branch information...
1 parent f58e2ae commit 1fdbc802c303f743a0724dae93a64316765a3472 @teleshoes committed May 8, 2016
View
11 examples/systemd_dynamic_threshold/tpacpi.conf.d
@@ -1,5 +1,8 @@
-# Start charging threshold, in format "lower-bound higher-bound".
-STARTTHRES="0 40"
+# battery is 1 for main, 2 for secondary, or 0 for either/both
+BATTERY="0"
-# Stop charging threshold, in format "lower-bound higher-bound".
-STOPTHRES="0 80"
+# Start charging threshold (0 for default, 1-99 for percent)
+START_THRESHOLD="40"
+
+# Stop charging threshold (0 for default, 1-99 for percent)
+STOP_THRESHOLD="80"
View
4 examples/systemd_dynamic_threshold/tpacpi.service
@@ -5,8 +5,8 @@ Description=sets battery thresholds
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/conf.d/tpacpi
-ExecStart=/usr/bin/tpacpi-bat -s ST $STARTTHRES
-ExecStart=/usr/bin/tpacpi-bat -s SP $STOPTHRES
+ExecStart=/usr/bin/tpacpi-bat -s ST $BATTERY $START_THRESHOLD
+ExecStart=/usr/bin/tpacpi-bat -s SP $BATTERY $STOP_THRESHOLD
[Install]
WantedBy=multi-user.target

0 comments on commit 1fdbc80

Please sign in to comment.