Created
March 28, 2019 09:12
-
-
Save wjt/cf0fa99d4dbdeaa5ad0a2647cfb3a0f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/gjs | |
| const Lang = imports.lang; | |
| const GLib = imports.gi.GLib; | |
| const Gio = imports.gi.Gio; | |
| let file = Gio.file_new_for_path(ARGV[0]); | |
| let monitor = file.monitor_file(Gio.FileMonitorFlags.WATCH_HARD_LINKS, null); | |
| monitor.connect('changed', (monitor, file, otherfile, ev, data) => { | |
| log('file changed with event ' + ev); | |
| }); | |
| let main_loop = new GLib.MainLoop(null, false); | |
| main_loop.run(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment