有沒有人能幫忙做一個啟動器

Wine、Cedega、CrossOver 等配置
头像
豬豬
帖子: 1216
注册时间: 2006-08-30 20:54
来自: 廣州

有沒有人能幫忙做一個啟動器

#1

帖子 豬豬 » 2009-05-20 22:31

比如像圖那樣的,可以自己編輯腳本修改兩個按鈕執行的命令行,我不懂編程,請高人幫忙
附件
Screenshot.png
上次由 豬豬 在 2009-05-20 22:37,总共编辑 1 次。
Intel G1610
Samsung DDR1333 4G
SOYO SY-I6H-L 4.1
Maxtor 250GB+Seagate 500GB
Nvidia GeForce 8500GT
Samsung SyncMaster S22B360
Ubuntu 10.04 LTS
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: 有沒有人能幫忙做一個啟動器

#2

帖子 xiooli » 2009-05-20 22:37

图在何处?
头像
豬豬
帖子: 1216
注册时间: 2006-08-30 20:54
来自: 廣州

Re: 有沒有人能幫忙做一個啟動器

#3

帖子 豬豬 » 2009-05-20 22:39

圖來了,這是ps的圖,大概就是做成這個樣子
Intel G1610
Samsung DDR1333 4G
SOYO SY-I6H-L 4.1
Maxtor 250GB+Seagate 500GB
Nvidia GeForce 8500GT
Samsung SyncMaster S22B360
Ubuntu 10.04 LTS
头像
bobobo80
帖子: 841
注册时间: 2007-12-09 22:36
联系:

Re: 有沒有人能幫忙做一個啟動器

#4

帖子 bobobo80 » 2009-05-20 22:42

这个貌似比较简单,用GTK或Qt,画两个Button,然后跟不同的命令就行了。呵呵,脚本的化应该有更简单的方法。
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: 有沒有人能幫忙做一個啟動器

#5

帖子 xiooli » 2009-05-20 23:13

如果不嫌丑陋的话这里有一个tk写的:

代码: 全选

#!/usr/bin/wish -f
set txt1 "魔兽争霸3 -=全屏模式=-"
set txt2 "魔兽争霸3 -=窗口模式=-"
set cmd1 "cmd1 to exec"
set cmd2 "cmd2 to exec"
wm title . "魔兽争霸3"
button .btn1 -text "$txt1" -command "$cmd1"
button .btn2 -text "$txt2" -command "$cmd2"
pack .btn1 .btn2
将cmd? to exec 改成你想执行的命令即可。
效果如图:
附件
6.png
6.png (5.21 KiB) 查看 807 次
头像
非主流1987
帖子: 427
注册时间: 2008-05-09 23:50

Re: 有沒有人能幫忙做一個啟動器

#6

帖子 非主流1987 » 2009-05-20 23:35

xiooli 写了:如果不嫌丑陋的话这里有一个tk写的:

代码: 全选

#!/usr/bin/wish -f
set txt1 "魔兽争霸3 -=全屏模式=-"
set txt2 "魔兽争霸3 -=窗口模式=-"
set cmd1 "cmd1 to exec"
set cmd2 "cmd2 to exec"
wm title . "魔兽争霸3"
button .btn1 -text "$txt1" -command "$cmd1"
button .btn2 -text "$txt2" -command "$cmd2"
pack .btn1 .btn2
将cmd? to exec 改成你想执行的命令即可。
效果如图:
呵呵~~高手无处不在阿~~
头像
豬豬
帖子: 1216
注册时间: 2006-08-30 20:54
来自: 廣州

Re: 有沒有人能幫忙做一個啟動器

#7

帖子 豬豬 » 2009-05-21 10:03

嚴重多謝,這樣夠用了,可以省去我桌面不少圖標 :em11 :em11
Intel G1610
Samsung DDR1333 4G
SOYO SY-I6H-L 4.1
Maxtor 250GB+Seagate 500GB
Nvidia GeForce 8500GT
Samsung SyncMaster S22B360
Ubuntu 10.04 LTS
头像
豬豬
帖子: 1216
注册时间: 2006-08-30 20:54
来自: 廣州

Re: 有沒有人能幫忙做一個啟動器

#8

帖子 豬豬 » 2009-05-21 10:17

運行出錯了,報告如下

代码: 全选

invalid command name "./war3-w.sh"
invalid command name "./war3-w.sh"
    while executing
"./war3-w.sh"
    invoked from within
".btn2 invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke]"
    (procedure "tk::ButtonUp" line 22)
    invoked from within
"tk::ButtonUp .btn2"
    (command bound to event)
我修改後的腳本是

代码: 全选

#!/usr/bin/wish -f
set txt1 "魔獸爭霸3 -=全屏模式=-"
set txt2 "魔獸爭霸3 -=窗口模式=-"
set cmd1 "./war3-f.sh"
set cmd2 "./war3-w.sh"
wm title . "魔獸爭霸3"
button .btn1 -text "$txt1" -command "$cmd1"
button .btn2 -text "$txt2" -command "$cmd2"
pack .btn1 .btn2
我把set cmd2 改成 "wine War3.exe -opengl -window",也不行,不懂哦
Intel G1610
Samsung DDR1333 4G
SOYO SY-I6H-L 4.1
Maxtor 250GB+Seagate 500GB
Nvidia GeForce 8500GT
Samsung SyncMaster S22B360
Ubuntu 10.04 LTS
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: 有沒有人能幫忙做一個啟動器

#9

帖子 xiooli » 2009-05-21 11:04

你把war3-?.sh的路径写全试试
头像
豬豬
帖子: 1216
注册时间: 2006-08-30 20:54
来自: 廣州

Re: 有沒有人能幫忙做一個啟動器

#10

帖子 豬豬 » 2009-05-21 11:28

還是不行呢,基本一樣的提示

把war3-w.sh也貼上來
export LANG=zh_CN.gbk
cd ~/War3
wine War3.exe -opengl -window
Intel G1610
Samsung DDR1333 4G
SOYO SY-I6H-L 4.1
Maxtor 250GB+Seagate 500GB
Nvidia GeForce 8500GT
Samsung SyncMaster S22B360
Ubuntu 10.04 LTS
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: 有沒有人能幫忙做一個啟動器

#11

帖子 xiooli » 2009-05-21 11:35

豬豬 写了:還是不行呢,基本一樣的提示

把war3-w.sh也貼上來
export LANG=zh_CN.gbk
cd ~/War3
wine War3.exe -opengl -window
找到问题了:

代码: 全选

#!/usr/bin/wish -f
set txt1 "魔獸爭霸3 -=全屏模式=-"
set txt2 "魔獸爭霸3 -=窗口模式=-"
set cmd1 "/path-to/war3-f.sh" 
set cmd2 "/path-to/war3-w.sh"
wm title . "魔獸爭霸3"
button .btn1 -text "$txt1" -command  "exec $cmd1"
button .btn2 -text "$txt2" -command "exec $cmd2"
pack .btn1 .btn2
将欲执行的脚本路径写全。
头像
HuntXu
帖子: 5776
注册时间: 2007-09-29 3:09

Re: 有沒有人能幫忙做一個啟動器

#12

帖子 HuntXu » 2009-05-21 11:38

xiooli用zenity吧,好看点... :em02
HUNT Unfortunately No Talent...
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: 有沒有人能幫忙做一個啟動器

#13

帖子 xiooli » 2009-05-21 11:41

HuntXu 写了:xiooli用zenity吧,好看点... :em02
可是zenity怎么写按钮呢?难道用个list?
头像
豬豬
帖子: 1216
注册时间: 2006-08-30 20:54
来自: 廣州

Re: 有沒有人能幫忙做一個啟動器

#14

帖子 豬豬 » 2009-05-21 11:51

還是不行呢 :em21

代码: 全选

invalid command name "/home/piggy/War3/war3-w.sh"
invalid command name "/home/piggy/War3/war3-w.sh"
    while executing
"/home/piggy/War3/war3-w.sh"
    invoked from within
".btn2 invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke]"
    (procedure "tk::ButtonUp" line 22)
    invoked from within
"tk::ButtonUp .btn2"
    (command bound to event)
附件
sendpix0.jpg
上次由 豬豬 在 2009-05-21 11:55,总共编辑 1 次。
Intel G1610
Samsung DDR1333 4G
SOYO SY-I6H-L 4.1
Maxtor 250GB+Seagate 500GB
Nvidia GeForce 8500GT
Samsung SyncMaster S22B360
Ubuntu 10.04 LTS
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: 有沒有人能幫忙做一個啟動器

#15

帖子 xiooli » 2009-05-21 11:51

好吧,发一个zenity的:

代码: 全选

#!/bin/bash
choise="`zenity --list --title="魔獸爭霸3" --column="序号" --column="选择进入模式" 1 "魔獸爭霸3 -=全屏模式=-" 2 "魔獸爭霸3 -=窗口模式=-" 2>/dev/null`"
case "$choise" in
	1)
	bash /path-to/war3-f.sh
	;;
	2)
	bash /path-to/war3-w.sh
	;;
esac
效果:
附件
7.png
7.png (18.84 KiB) 查看 744 次
回复