Actually include the oneshot service files
This commit is contained in:
parent
6899638969
commit
1f1a291447
3 changed files with 74 additions and 0 deletions
30
application/service/harbour-batterybuddy-oneshot.service
Normal file
30
application/service/harbour-batterybuddy-oneshot.service
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Battery Buddy, a Sailfish application to prolong battery lifetime
|
||||
#
|
||||
# Copyright (C) 2019-2020 Matti Viljanen
|
||||
#
|
||||
# Battery Buddy is free software: you can redistribute it and/or modify it under the terms of the
|
||||
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# Battery Buddy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# See the GNU General Public License for more details. You should have received a copy of the GNU
|
||||
# General Public License along with CarBudget. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Author: Matti Viljanen
|
||||
|
||||
[Unit]
|
||||
Description=Battery Buddy file permission daemon
|
||||
Requires=harbour-batterybuddy.service
|
||||
After=harbour-batterybuddy.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash /usr/share/harbour-batterybuddy/service/set-write-permissions.sh
|
||||
RemainAfterExit=true
|
||||
ExecStop=/bin/bash /usr/share/harbour-batterybuddy/service/restore-write-permissions.sh
|
||||
StandardOutput=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
22
application/service/restore-write-permissions.sh
Executable file
22
application/service/restore-write-permissions.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Battery Buddy, a Sailfish application to prolong battery lifetime
|
||||
#
|
||||
# Copyright (C) 2019-2020 Matti Viljanen
|
||||
#
|
||||
# Battery Buddy is free software: you can redistribute it and/or modify it under the terms of the
|
||||
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# Battery Buddy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# See the GNU General Public License for more details. You should have received a copy of the GNU
|
||||
# General Public License along with CarBudget. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Author: Matti Viljanen
|
||||
|
||||
chmod 644 /sys/class/power_supply/battery/input_suspend 2>/dev/null
|
||||
chmod 644 /sys/class/power_supply/battery/charging_enabled 2>/dev/null
|
||||
chmod 644 /sys/class/power_supply/usb/charger_disable 2>/dev/null
|
||||
exit 0
|
22
application/service/set-write-permissions.sh
Executable file
22
application/service/set-write-permissions.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Battery Buddy, a Sailfish application to prolong battery lifetime
|
||||
#
|
||||
# Copyright (C) 2019-2020 Matti Viljanen
|
||||
#
|
||||
# Battery Buddy is free software: you can redistribute it and/or modify it under the terms of the
|
||||
# GNU General Public License as published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# Battery Buddy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# See the GNU General Public License for more details. You should have received a copy of the GNU
|
||||
# General Public License along with CarBudget. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Author: Matti Viljanen
|
||||
|
||||
chmod 666 /sys/class/power_supply/battery/input_suspend 2>/dev/null
|
||||
chmod 666 /sys/class/power_supply/battery/charging_enabled 2>/dev/null
|
||||
chmod 666 /sys/class/power_supply/usb/charger_disable 2>/dev/null
|
||||
exit 0
|
Loading…
Reference in a new issue