EVIL-DOER

Rating: 
5
Your rating: None Average: 5 (1 vote)

EVIL-DOER is a program used to define and manage scripts for Sailfish OS using python, dbus-monitor, and timeclient. You can schedule scripts to run but to have notifications you should add notifications to your scripts from the source code example in the notes.md file.

DOWNLOAD:
https://gitlab.com/Meganerd.eth/EVIL-DOER

Install required packages
[nemo@Sailfish ~]$ pip3 install dbus pexpect

Why not just use SailCron / Cron?

Scripts I run from Cron are not popping notifications from the DBUS api.
This solves that issue I was experiencing.

How to use EVIL-DOER for task automation
Step 1/5: Download EVIL-DOER.py from GitLab
step 2/5: Open terminal to run program from
Step 3/5 : python3 EVIL-DOER.py --initdb
Step 4/5 : python3 EVIL-DOER.py --interactiveschedule
Step 5/5 : python3 EVIL-DOER.py

Show scripts in the database
[nemo@Sailfish ~]$ python3 EVIL-DOER.py --scripts

Remove a script from the database
[nemo@Sailfish ~]$ python3 EVIL-DOER.py --removescript Villiany

Further instructions
https://gitlab.com/Meganerd.eth/EVIL-DOER/blob/master/README.md

Check Gitlab for latest builds
I will be compiling the program to an RPM in future releases

DOWNLOAD:
https://gitlab.com/Meganerd.eth/EVIL-DOER

Sample python3 script using dbus for notifications

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import dbus

bus = dbus.SessionBus()
object = bus.get_object('org.freedesktop.Notifications','/org/freedesktop/Notifications')
interface = dbus.Interface(object,'org.freedesktop.Notifications')

interface.Notify('app_name',
         0,
         'icon-m-notifications',
         'Test title',
         '<u>Test Body</u>\nLine 2 test',
         dbus.Array(['default', '']),
         dbus.Dictionary({'x-nemo-preview-body': 'Test Body Preview',
                          'x-nemo-preview-summary': 'Test Preview Summary'},
                          signature='sv'),
         0)

** I have only tested this on my Gemini PDA running SFOS 2.1.3.7 and 2.1.4.14

Screenshots: 
Application versions: 
AttachmentSizeDate
File evildoer-0.1-1.armv7hl.rpm222.7 KB25/07/2018 - 11:17
File evildoer-0.1-1.i486.rpm86.86 KB25/07/2018 - 11:29
Changelog: 

(none)

Comments

ade's picture

To get things straight, cron is perfectly capable to display notifications. You just need to make sure DBUS_SESSION_BUS_ADDRESS is set.