1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 09:34:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-04-21 08:00:00 +08:00
parent 73a0cd7bbc
commit 1095aee85c
3 changed files with 3 additions and 1 deletions

View File

@ -158,6 +158,7 @@ func init() {
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) { mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
if runtime.GOOS == DARWIN && tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) { if runtime.GOOS == DARWIN && tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) {
if arg[0] == mdb.FOREACH && arg[1] == "" { if arg[0] == mdb.FOREACH && arg[1] == "" {
return
list := map[string]bool{"Terminal.app": true, "Docker.app": true, "Google Chrome.app": true} list := map[string]bool{"Terminal.app": true, "Docker.app": true, "Google Chrome.app": true}
for _, p := range strings.Split(m.Cmdx("", nfs.SH, "-c", `ps aux|grep /Applications/|grep -v Cache|grep -v Helper|grep -v Widget|grep -v Extension|grep -v Chrome|grep -v com.app|grep -v grep|grep -o "[^/]*.app"|sort|uniq`), ice.NL) { for _, p := range strings.Split(m.Cmdx("", nfs.SH, "-c", `ps aux|grep /Applications/|grep -v Cache|grep -v Helper|grep -v Widget|grep -v Extension|grep -v Chrome|grep -v com.app|grep -v grep|grep -o "[^/]*.app"|sort|uniq`), ice.NL) {
list[p] = true list[p] = true

View File

@ -164,6 +164,7 @@ func init() {
}}, }},
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) { mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
if arg[0] == mdb.FOREACH && arg[1] == "" && m.Cmdx("host", "islocal", m.Option(ice.MSG_USERIP)) == ice.OK { if arg[0] == mdb.FOREACH && arg[1] == "" && m.Cmdx("host", "islocal", m.Option(ice.MSG_USERIP)) == ice.OK {
return
kit.For([]string{"Desktop", "Documents", "Downloads", "Pictures"}, func(p string) { kit.For([]string{"Desktop", "Documents", "Downloads", "Pictures"}, func(p string) {
p = kit.HomePath(p) p = kit.HomePath(p)
m.Cmd(DIR, PWD, mdb.NAME, mdb.TIME, kit.Dict(DIR_ROOT, p)).SortStrR(mdb.TIME).TablesLimit(5, func(value ice.Maps) { m.Cmd(DIR, PWD, mdb.NAME, mdb.TIME, kit.Dict(DIR_ROOT, p)).SortStrR(mdb.TIME).TablesLimit(5, func(value ice.Maps) {

View File

@ -84,7 +84,7 @@ func init() {
push := func(k, p string) { push := func(k, p string) {
kit.IfNoKey(list, kit.Select(k, k+ice.DF, k != "")+p, func(p string) { m.Push(nfs.PATH, p) }) kit.IfNoKey(list, kit.Select(k, k+ice.DF, k != "")+p, func(p string) { m.Push(nfs.PATH, p) })
} }
mdb.HashSelect(m.Spawn()).TablesLimit(10, func(value ice.Maps) { push("", value[nfs.PATH]) }) mdb.HashSelect(m.Spawn()).TablesLimit(30, func(value ice.Maps) { push("", value[nfs.PATH]) })
m.Cmd(mdb.SEARCH, mdb.FOREACH, "", ice.OptionFields("type,name,text")).Sort("type,name,text").Table(func(value ice.Maps) { m.Cmd(mdb.SEARCH, mdb.FOREACH, "", ice.OptionFields("type,name,text")).Sort("type,name,text").Table(func(value ice.Maps) {
switch value[mdb.TYPE] { switch value[mdb.TYPE] {
case nfs.FILE: case nfs.FILE: