使用PHP中的xdotools命令执行Sh

时间:2015-04-22 17:49:22

标签: php linux shell xdotool

我试图在xdotool命令中执行一个sh脚本,这是从PHP页面调用的。

正在执行apache的用户是"守护进程"。

SH代码

public void render(Game game)
{

    for(int y = 0; y < height; y++)
    {
        float yd = ((y + 0.5f) - height / 2.0f) / height;

        if(yd < 0) yd *= -1;

        float z = 10 / yd;

        for(int x = 0; x < width; x++)
        {
            float xd = (x - width / 2.0f) / height;

            xd *= z;
            int xx = (int) (xd) & 7;
            int yy = (int) (z + game.time * 0.1f) & 7;

            pixels[x + y * width] = Art.floors.pixels[xx + yy * 64];
        }
    }
}

PHP代码

echo $1
win=`xdotool search --onlyvisible --name Zoiper windowactivate`
whoami
sleep 2
xdotool $win type $1
key Return
sleep 10
xdotool key alt+h

0 个答案:

没有答案
相关问题