ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Announce Your Software/Service/Product

onEVENT

(1/1)

Sjc1000:
onEVENT is an event system for Linux. Basically it lets you run commands when certain events are True or False. Its fairly flexible, you can pass params to each event.

So far, this is a Linux only project. It might work in Windows i dunno.

Its base is Python and you add events to an event file that is JSON. So if you know JSON and Python you will have fun :)
If not, i have explained how to add your own events to the event file in my github repo ( which i will link to ).

Here are a few examples:

Informs me when i plug in my external hard drive. Also informs me when i unplug it.

--- ---{"on": [{"event": "exists", "params": ["/media/steven/TOSHIBA EXT"], "result": "1"}],
"action": [["notify-send","External HDD","External HDD connected! {0}"]],
"repeat": "0",
"delay": {"seconds": "1"},
"alternative": [["notify-send", "External HDD", "External HDD not connected!"]]
}

Informs me when i plug in my Xbox controller.

--- ---{"on": [{"event": "inputdevice", "params": ["X-Box 360"], "result": "1"}],
"action": [["notify-send", "Controller", "X-Box device '{0}' connected."]],
"repeat": "0",
"delay": {"seconds": "1"},
"alternative": [["notify-send", "Controller", "X-Box controller disconnected."]]
}


Informs me when i have a new file in my downloads folder. And displays the new file's name.

--- ---{"on": [{"event": "newfile", "params": ["/home/steven/Downloads"], "result": 1}],
"action": [["notify-send", "New download!", "New file in the downloads folder! {0}", "-t", "7000"]],
"repeat": "0",
"delay": {"seconds": "5"}
}


Uses the new RSS event to notify me whenever something happens on the Donation Coder forum :D

--- ---{"on": [{"event": "rss", "params": ["https://www.donationcoder.com/forum/index.php?action=.xml;type=rss2;limit=10", "DonationCoder"], "result": "1"}],
"action": [["notify-send", "Donation Coder", "[ {boardname} ] {aposter} - {title}"]],
"repeat": "1",
"delay": {"minutes": "5"},
"iterate": "1"
}

These examples are only using the notify-send command on linux. You can run ANY command here, for example, if i plug in my Xbox controller i can run the xbox-drv ( xbox driver ) command automatically.

The link to the repo is here -> https://github.com/Sjc1000/onEVENT

I will keep this updated with stable versions of the main system and event files.
Here is a list of the events -> https://github.com/Sjc1000/onEVENT#built-in-events

You can use python eventfile.py  to see the help for that event. Which tells you what params you need to pass.

If you want help with setting up events, or any aspect of this program you can ask :)
If you want instant help, find me on the IRC channel for Donation Coder.  irc.freenode.net:6667  #donationcoder

mouser:
Hey that's pretty cool  :up:

cranioscopical:
Nice, thanks for sharing!

lanux128:
thanks for posting this, Sjc1000! :Thmbsup:

Navigation

[0] Message Index

Go to full version