1 |
On 09/07/2013 18:54, Joseph wrote: |
2 |
> How to design a sticky note pop-up when file is present? |
3 |
> |
4 |
> I would like to check if file is present via and open a terminal window |
5 |
> with a simple message. |
6 |
> I think a simple bash script and a cron job would do the trick or is |
7 |
> there a better solution? |
8 |
> |
9 |
> I've tried cron + bash script |
10 |
> |
11 |
> cron: |
12 |
> 32 10 * * * sh /home/joseph/xp_share/wall.sh |
13 |
> |
14 |
> wall.sh |
15 |
> terminal |
16 |
> wall file ready |
17 |
> |
18 |
> When I open terminal and type: "terminal" new windows pops up |
19 |
> But if close all the terminals and run wall.sh script the terminal will |
20 |
> not open. |
21 |
> I get an error message: (terminal:24945): Gtk-WARNING **: cannot open |
22 |
> display: |
23 |
> |
24 |
|
25 |
|
26 |
You want inotify for this. |
27 |
|
28 |
You are polling something to discover if it's there, what yu really want |
29 |
to do is let the kernel notify you when the event you are interested in |
30 |
occurs. |
31 |
|
32 |
There are many tools out there that interface with the kernel's inotify |
33 |
system. |
34 |
|
35 |
|
36 |
-- |
37 |
Alan McKinnon |
38 |
alan.mckinnon@×××××.com |