All Projects → sharkdp → Trigger

sharkdp / Trigger

Licence: mit
Run a user-defined command on file changes

Programming Languages

shell
77523 projects

Labels

Projects that are alternatives of or similar to Trigger

inotify-rs
Idiomatic inotify wrapper for the Rust programming language
Stars: ✭ 219 (+34.36%)
Mutual labels:  inotify
Watcher
Watcher is a daemon that watches specified files/folders for changes and fires commands in response to those changes. It is similar to incron, however, configuration uses a simpler to read ini file instead of a plain text file. Unlike incron it can also recursively monitor directories. It's also written in Python, making it easier to hack.
Stars: ✭ 127 (-22.09%)
Mutual labels:  inotify
Inotify
📢 JS achieve the browser title flashing, scrolling, voice prompts, Chrome/Safari/FireFox/IE notice. has no dependencies. It not interfere with any JavaScript libraries or frameworks. has a reasonable footprint 5.05kb (gzipped: 1.75kb)
Stars: ✭ 892 (+447.24%)
Mutual labels:  inotify
watcherd
A shell daemon that will listen for directory changes and execute custom commands for each event.
Stars: ✭ 48 (-70.55%)
Mutual labels:  inotify
hxinotify
Haxe→C++/Hashlink/Neko bindings to the inotify linux kernel subsystem
Stars: ✭ 21 (-87.12%)
Mutual labels:  inotify
Trackma
Open multi-site list manager for Unix-like systems. (ex-wMAL)
Stars: ✭ 490 (+200.61%)
Mutual labels:  inotify
gowatch
watch go files for developer, support run test case and auto reload server application
Stars: ✭ 18 (-88.96%)
Mutual labels:  inotify
Dfs
A distributed file server framework based on swoole and inotify
Stars: ✭ 112 (-31.29%)
Mutual labels:  inotify
docker base images
Vlad's Base Images for Docker
Stars: ✭ 61 (-62.58%)
Mutual labels:  inotify
Gerbera
UPnP Media Server for 2021: Stream your digital media through your home network and consume it on all kinds of UPnP supporting devices 📱💻📺
Stars: ✭ 710 (+335.58%)
Mutual labels:  inotify
gevent inotifyx
gevent compatibility for inotifyx
Stars: ✭ 22 (-86.5%)
Mutual labels:  inotify
DirectoryWatcher
Watch changes in directories
Stars: ✭ 70 (-57.06%)
Mutual labels:  inotify
Gowatch
🚀 gowatch is a command line tool that builds and (re)starts your go project everytime you save a Go or template file.
Stars: ✭ 539 (+230.67%)
Mutual labels:  inotify
fswatch
File/Directory Watcher for Modern C++
Stars: ✭ 56 (-65.64%)
Mutual labels:  inotify
Entr
A utility for running arbitrary commands when files change
Stars: ✭ 976 (+498.77%)
Mutual labels:  inotify
pmOCR
A wrapper for tesseract / abbyyOCR11 ocr4linux finereader cli that can perform batch operations or monitor a directory and launch an OCR conversion on file activity
Stars: ✭ 53 (-67.48%)
Mutual labels:  inotify
Fswatch
A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
Stars: ✭ 3,974 (+2338.04%)
Mutual labels:  inotify
Clsync
file live sync daemon based on inotify/kqueue/bsm (Linux, FreeBSD), written in GNU C
Stars: ✭ 115 (-29.45%)
Mutual labels:  inotify
Go Fsevents
Recursive filesystem event watcher using inotify in golang
Stars: ✭ 107 (-34.36%)
Mutual labels:  inotify
Onedrived Dev
A Microsoft OneDrive client for Linux, written in Python3.
Stars: ✭ 672 (+312.27%)
Mutual labels:  inotify

trigger

Usage: trigger COMMAND [FILE...]

trigger runs the given COMMAND every time one of the FILEs is changed. If no FILE argument is given, trigger watches everything in the current directory, recursively.

In the COMMAND string, #1, #2, .. can be used as synonyms for the FILEnames. The helper tg COMMAND FILE ... is a shortcut for trigger 'COMMAND #1' FILE ....

Example usage

Examples

Make

Run make every time one of the files in the current directory changes:

trigger make

Python

Run python main.py every time either main.py or config.py changes:

trigger 'python #1' main.py config.py

By using the tg helper command, this can be shortened to:

tg python main.py config.py

Markdown to PDF

Convert a Markdown document to PDF every time it is changed. Combine this with an auto-reloading PDF-viewer (e.g. okular) to get a live preview:

tg 'pandoc -t latex -o README.pdf' README.md

Less to CSS

Convert a LESS file to CSS:

trigger 'lessc #1 > main.css' main.less

Interrupt mode

If trigger is called with the -i (or --interrupt) option, it will kill running subprocesses whenever a file changes:

trigger -i longRunningCommand input.dat

Requirements

trigger is just a simple wrapper around inotifywait. It should be available for most Linux distributions (the package is typically called inotify-tools).

Installation

Keeping in mind that, in principle, you should not copy-and-paste into your shell, something like this should work:

git clone https://github.com/sharkdp/trigger ~/.trigger

echo 'export PATH="$PATH:$HOME/.trigger"' >> .bashrc

Related projects

Also have a look at these projects, to see if they fit your needs better:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].