将xinit与我传递的bash结合起来作为参数,是否可能?

时间:2012-05-25 22:53:27

标签: bash

我将PlayOnlinux用于一些旧的Win游戏。我通常在新的X窗口中启动非常旧的。

#!/bin/bash

xinit  '/home/deckoff/.PlayOnLinux/shortcuts/heroes.sh' -- :1 -ac -depth 16

这是实际sh文件的内容,主要由PlayOnLinux

创建
#!/bin/bash

xrandr -s 800x600

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
export WINEPREFIX="/home/deckoff/.PlayOnLinux//wineprefix/HOMM3"
export WINEDEBUG="-all"
cd "/home/deckoff/.PlayOnLinux//wineprefix/HOMM3/drive_c/./Program Files/GOG.com/Heroes of Might and Magic 3 Complete"
POL_Wine "Heroes3.exe"  "$@"

有没有办法将两个脚本合二为一,我尝试过分叉,但有点失败

1 个答案:

答案 0 :(得分:1)

你可以试试这个:

#!/bin/bash
xinit -- :1 -ac -depth 16 <<EOF

xrandr -s 800x600

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
export WINEPREFIX="/home/deckoff/.PlayOnLinux//wineprefix/HOMM3"
export WINEDEBUG="-all"
cd "/home/deckoff/.PlayOnLinux//wineprefix/HOMM3/drive_c/./Program Files/GOG.com/Heroes of Might and Magic 3 Complete"
POL_Wine "Heroes3.exe"  "$@"
EOF

如果这不起作用,请尝试将xinit行更改为其中任何一行,看看它们是否有效:

xinit - -- :1 -ac -depth 16 <<EOF

xinit /dev/stdin -- :1 -ac -depth 16 <<EOF