简体   繁体   中英

Using procmail to trigger applications to run on my computer… But I hit a snag

I wanted to make a setup where if I recieve an email, applications would run automatically. I got the Email and fetchmail setup working, but I seem to be getting problems with the execution of the linux commands themselves.

Here is the Procmail code:

:0
* ^Subject: .*Subject
| xrandr --size 1360x768;\
  firefox "link"; \
  timeout 2m recordmydesktop; \
  xrandr --size 1366x768

This is the error:

(process:3611): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Error: no display specified
No display specified for connection!

I found my answer.

I just needed to add this line just before the other scripts. export DISPLAY=:0.0; \\

Whole code:

:0
* ^Subject: .*subject!
| export DISPLAY=:0.0; \
   xrandr --size 1360x768;\
   firefox "***"; \
   timeout 150m recordmydesktop; \
   xrandr --size 1366x768

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM