forked from x/icebergs
add lock
This commit is contained in:
parent
7bdc1bc380
commit
2d1c99af56
@ -185,3 +185,6 @@ end tell
|
|||||||
`, strings.Join(arg, "; ")))
|
`, strings.Join(arg, "; ")))
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
func OSAScript(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmd(SYSTEM, "osascript", "-e", arg)
|
||||||
|
}
|
||||||
|
@ -163,7 +163,7 @@ const RUNTIME = "runtime"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
RUNTIME: {Name: "runtime info=bootinfo,ifconfig,diskinfo,hostinfo,userinfo,procstat,procinfo,bootinfo,role,api,cli,cmd,mod,env,path,chain,routine auto upgrade restart reboot logs conf", Icon: "Infomation.png", Help: "运行环境", Actions: ice.MergeActions(ice.Actions{
|
RUNTIME: {Name: "runtime info=bootinfo,ifconfig,diskinfo,hostinfo,userinfo,procstat,procinfo,bootinfo,role,api,cli,cmd,mod,env,path,chain,routine auto upgrade restart reboot logs conf lock", Icon: "Infomation.png", Help: "运行环境", Actions: ice.MergeActions(ice.Actions{
|
||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
aaa.White(m, ice.LICENSE)
|
aaa.White(m, ice.LICENSE)
|
||||||
_runtime_init(m)
|
_runtime_init(m)
|
||||||
@ -269,6 +269,9 @@ func init() {
|
|||||||
"conf": {Help: "配置", Hand: func(m *ice.Message, arg ...string) {
|
"conf": {Help: "配置", Hand: func(m *ice.Message, arg ...string) {
|
||||||
OpenCmds(m, kit.Format("cd %s", kit.Path("")), "vim etc/init.shy")
|
OpenCmds(m, kit.Format("cd %s", kit.Path("")), "vim etc/init.shy")
|
||||||
}},
|
}},
|
||||||
|
"lock": {Help: "锁屏", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
OSAScript(m, `tell application "System Events" to keystroke "q" using {control down, command down}`)
|
||||||
|
}},
|
||||||
}, ctx.ConfAction("")), Hand: func(m *ice.Message, arg ...string) {
|
}, ctx.ConfAction("")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
kit.If(len(arg) > 0 && arg[0] == BOOTINFO, func() { arg = arg[1:] })
|
kit.If(len(arg) > 0 && arg[0] == BOOTINFO, func() { arg = arg[1:] })
|
||||||
m.Cmdy(ctx.CONFIG, RUNTIME, arg).StatusTime(mdb.TIME, ice.Info.Make.Time,
|
m.Cmdy(ctx.CONFIG, RUNTIME, arg).StatusTime(mdb.TIME, ice.Info.Make.Time,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user