From 30228ec14fa0406ffed4e3baf51e78ef5a4e618a Mon Sep 17 00:00:00 2001 From: JoYo <> Date: Wed, 8 Jun 2022 20:56:10 -0400 Subject: [PATCH] systemd timer --- README.mdown | 31 +++++++------------------------ banana.timer | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 24 deletions(-) create mode 100644 banana.timer diff --git a/README.mdown b/README.mdown index 47599d9..cabdafe 100644 --- a/README.mdown +++ b/README.mdown @@ -90,37 +90,20 @@ Press enter to confirm removal. # Linux Installation -Install `python3` and `pip3`, the following instructions are for Debian. +The following instructions are for any linux system using systemd. +This include the Steam Deck. ``` -sudo apt install python3-pip -cd ./eso-banana/ -pip3 install . +cp banana.py /home/deck/ +cp banana.timer /etc/systemd/system/ +sudo systemctl enable banana.timer ``` -Once the project is installed to python's packages you may invoke the addon script with the following command: - -``` -eso-banana-script -``` - -To schedule a periodic background run of `eso-banana` can be performed with the [crontab](https://help.ubuntu.com/community/CronHowto) command: - -```bash -crontab -e -``` - -Add the following line to your `crontab`. - -``` -0 11 * * * eso-banana-script --log -``` # Linux Unschedule Only run the following command if you wish to remove scheduled run of `eso-banana`. -To remove the schedule, delete the following line from your `crontab -e`. - ``` -0 11 * * * eso-banana-script --log +systemctl list-timers --all +sudo systemctl disable banana.timer ``` diff --git a/banana.timer b/banana.timer new file mode 100644 index 0000000..7003031 --- /dev/null +++ b/banana.timer @@ -0,0 +1,14 @@ +[Unit] +Description=Run banana daily and on boot. + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target + +[Service] +Type=oneshot +ExecStart=python3 /home/deck/banana.py +User=deck