简体   繁体   English

使用procmail触发应用程序在计算机上运行...但是我遇到了麻烦

[英]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. 我可以使用Email和fetchmail设置,但是我似乎在执行Linux命令本身时遇到问题。

Here is the Procmail code: 这是Procmail代码:

: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; 出口DISPLAY =:0.0; \\ \\

Whole code: 整个代码:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用USB串行端口运行程序时,为什么我的计算机仍然暂停? - Why does my computer keep pausing when I run a progam using the USB-serial ports? 如何使用scp将文件从远程计算机(运行Linux)复制到Windows计算机? - How do I copy files from a remote computer (running Linux) to my Windows computer using scp? Python - 如何获取在我的计算机上运行的服务 - Python - how to get the services that run on my computer 我如何使用不同的端口在同一IP上运行多个Web应用程序 - how can i run multiple web applications on same ip using different ports 当我的Web应用程序正在使用时,我想阻止使用任何计算机应用程序 - I want to block using any application of computer, when my web application is using 如何在仍在我自己的计算机中进行编码的同时在另一台计算机上运行Rails应用程序? - How to run a rails application in another computer while still coding in my own computer? 当我使用 linux 时,为什么 laravel 上的 Jobs 会导致我的计算机崩溃? 但是当我使用 Windows 时工作正常? - Why Jobs on laravel crashes my computer when I'm using linux? but works fine when I'm using Windows? 为什么malloc没有“用完”计算机上的内存? - Why is malloc not “using up” the memory on my computer? 如何独立于当前计算机使用SSH远程运行程序 - How to remotely run a program with SSH independent of my current computer 如何从使用ssh连接的AWS VM运行GUI应用程序? - How to run gui applications from aws vm connected using ssh?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM