热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

非常NB的一款快捷启动软件--Merry

Merry被设计为了能将日常重复性操作简化为一个快捷键或者命令。Merry采用完全开放的体系,可以使用Lua或者外部程序来扩展Merry的功能。另附一个自己扩展的LUA脚本:--启动Me

Merry 被设计为了能将日常重复性操作简化为一个快捷键或者命令。Merry 采用完全开放的体系, 可以使用 Lua 或者外部程序来扩展 Merry 的功能。


另附一个自己扩展的LUA脚本:

--启动Merry
addCommand{ key = 'A-R', func = toggleMerry }


--最大化/还原当前窗口
addCommand{ key = 'A-M', func = function()
local window = getForegroundWindow()
if isWindowMax(window) then
showWindow(window, 'restore')
else
showWindow(window, 'max')
end
end }


--关闭当前窗口
addCommand{ key = 'A-Q', func = function()
closeWindow(getForegroundWindow())
end }


--隐藏/显示当前窗口
local curHideWindow
addCommand{ key = 'A-H', func = function()
if not curHideWindow then
curHideWindow = getForegroundWindow()
showWindow(curHideWindow, 'hide')
else
showWindow(curHideWindow, 'normal')
curHideWindow = nil
end
end }


if WINDOWS then
for i = string.byte('a'), string.byte('z') do
local disk = string.char(i)
local isOk, errMsg = io.open(disk .. ':')
if isOk or errMsg:find('Permission denied') then
addCommand{ command = disk, func = function() shellExecute(disk .. ':', '', '', 'normal') end }
end
end


--打开我的电脑
addCommand{ command = 'computer', func = function() shellExecute('::{20D04FE0-3AEA-1069-A2D8-08002B30309D}', '', '', 'normal') end }


--打开merry根目录
addCommand{ command = 'merry', func = function() shellExecute('explorer', '.', '', 'normal') end }


--打开t00ls根目录
addCommand{ command = 'tools', func = function() shellExecute('explorer', TOOLS_PATH, '', 'normal') end }


--打开ha4k目录
addCommand{ command = 'hack', func = function() shellExecute('explorer', 'F:\\H4ck', '', 'normal') end }


--打开cmd
addCommand{ command = 'cmd', key = 'A-T', func = function(arg)
local window = getForegroundWindow()
local dir = getWindowText(window)
shellExecute('cmd', '', dir)
end }


-- 增加命令 say
-- 在 merry 的命令窗口输入的 say 命令的参数将以字符串的形式传递给 arg
addCommand{ command = 'say', func = function(arg)
message(arg)
end }


--调整音量(依赖nircmdc)
addCommand{ key = 'A-Up', func = function() shellExecute('nircmdc', 'changesysvolume 65535', '', 'hide') end }
addCommand{ key = 'A-Down', func = function() shellExecute('nircmdc', 'changesysvolume -65535', '', 'hide') end }
addCommand{ key = 'A-Left', func = function() shellExecute('nircmdc', 'changesysvolume -4000', '', 'hide') end }
addCommand{ key = 'A-Right', func = function() shellExecute('nircmdc', 'changesysvolume 4000', '', 'hide') end }


--应用软件
addCommand{ command = 'qq', func = function() shellExecute('QQScLauncher.exe', '', 'D:\\Program Files (x86)\\Tencent\\QQLite\\Bin', 'normal') end }
addCommand{ command = 'music', func = function() shellExecute('cloudmusic.exe', '', 'D:\\Program Files (x86)\\Netease\\CloudMusic', 'normal') end }
addCommand{ command = 'itools', func = function() shellExecute('iTools.exe', '', 'D:\\Program Files (x86)\\iTools', 'normal') end }
addCommand{ command = 'chrome', func = function() shellExecute('chrome.exe', '', 'C:\\Program Files (x86)\\Google\\Chrome\\Application', 'normal') end }
addCommand{ command = 'Everything', func = function(arg)
if arg == "" then
shellExecute('Everything.exe', '', 'C:\\Program Files\\Everything', 'normal')
else
shellExecute('Everything.exe', '-search ' .. arg, 'C:\\Program Files\\Everything', 'normal')
end
end }
addCommand{ command = 'notepad++', func = function() shellExecute('notepad++.exe', '-multiInst', 'F:\\notepaid++', 'normal') end }
addCommand{ command = 'PotPlayer', func = function(arg)
if arg == "" then
shellExecute('PotPlayerMini64.exe', '', 'F:\\PotPlayer', 'normal')
else
shellExecute('PotPlayerMini64.exe', arg, 'F:\\PotPlayer', 'normal')
end
end }


--系统软件
addCommand{ command = 'ie', func = function() shellExecute('iexplore.exe', '', 'C:\\Program Files\\Internet Explorer', 'normal') end }
addCommand{ command = 'calc', func = function() shellExecute('calc.exe', '', '%windir%\\system32', 'normal') end }
addCommand{ command = 'paint', func = function() shellExecute('mspaint.exe', '', '%windir%\\system32', 'normal') end }


--工具包
addCommand{ command = 'snapshot', key = 'A-C-S', func = function() shellExecute('SnapShot.exe', '', TOOLS_PATH .. '\\Merry\\plugins', 'normal') end }
addCommand{ command = 'stikynot', func = function() shellExecute('StikyNot.exe', '', TOOLS_PATH .. '\\Merry\\plugins', 'normal') end }
addCommand{ command = 'ipmsg', func = function() shellExecute('ipmsg.exe', '', TOOLS_PATH .. '\\Merry\\plugins', 'normal') end }
addCommand{ command = 'gif', func = function() shellExecute('GifCam.exe', '', TOOLS_PATH .. '\\Merry\\plugins', 'normal') end }
addCommand{ command = 'apimonitor', func = function() shellExecute('apimonitor-x64.exe', '', TOOLS_PATH .. '\\ApiMonitor\\API Monitor', 'normal') end }
addCommand{ command = 'baiduyun', func = function() shellExecute('BaiduYunGuanjia.exe', '', TOOLS_PATH .. '\\BaiduYun\\yun', 'normal') end }
addCommand{ command = 'compare', func = function() shellExecute('BCompare.exe', '', TOOLS_PATH .. '\\Beyond Compare 4', 'normal') end }
addCommand{ command = 'c32', func = function() shellExecute('C32Asm.exe', '', TOOLS_PATH .. '\\C32Asm', 'normal') end }
addCommand{ command = 'ccleaner', func = function() shellExecute('CCleaner64.exe', '', TOOLS_PATH .. '\\CCleaner', 'normal') end }
addCommand{ command = 'cmder', func = function() shellExecute('Cmder.exe', '', TOOLS_PATH .. '\\cmder', 'normal') end }
addCommand{ command = 'ditto', func = function() shellExecute('Ditto.exe', '', TOOLS_PATH .. '\\Ditto', 'normal') end }
addCommand{ command = 'fiddler', func = function() shellExecute('Fiddler.exe', '', TOOLS_PATH .. '\\Fiddler', 'normal') end }
addCommand{ command = 'fscapture', func = function() shellExecute('FSCapture.exe', '', TOOLS_PATH .. '\\FSCapture', 'normal') end }
addCommand{ command = 'hosts', func = function() shellExecute('explorer.exe', TOOLS_PATH .. '\\HostsTool', '', 'normal') end }
addCommand{ command = 'pass', func = function() shellExecute('KeePass.exe', '', TOOLS_PATH .. '\\KeePass', 'normal') end }
addCommand{ command = 'listary', func = function() shellExecute('Listary.exe', '', TOOLS_PATH .. '\\Listary', 'normal') end }
addCommand{ command = 'logview', func = function() shellExecute('LogView.exe', '', TOOLS_PATH .. '\\LogViewerPro', 'normal') end }
addCommand{ command = 'mdict', func = function() shellExecute('MDict.exe', '', TOOLS_PATH .. '\\MDict', 'normal') end }
addCommand{ command = 'mstsc', func = function() shellExecute('mstsc.exe', '', TOOLS_PATH .. '\\mstsc\\mstsccopy', 'normal') end }
addCommand{ command = 'pdf', func = function() shellExecute('SumatraPDF.exe', '', TOOLS_PATH .. '\\mstsc\\pdf', 'normal') end }
addCommand{ command = 'picpick', func = function() shellExecute('picpick.exe', '', TOOLS_PATH .. '\\PicPick', 'normal') end }
addCommand{ command = 'xxnet', func = function() shellExecute('start.bat', '', TOOLS_PATH .. '\\XX-Net', 'normal') end }
addCommand{ command = 'sublime_text', func = function() shellExecute('sublime_text.exe', '', TOOLS_PATH .. '\\SublimeText', 'normal') end }
addCommand{ command = 'proxifier', func = function() shellExecute('Proxifier.exe', '', TOOLS_PATH .. '\\Proxifier', 'normal') end }
addCommand{ command = 'kmplayer', func = function() shellExecute('KMPlayer.exe', '', TOOLS_PATH, 'normal') end }
addCommand{ command = 'virtuawin', func = function() shellExecute('VirtuaWin.exe', '', TOOLS_PATH .. '\\VirtuaWin', 'normal') end }
addCommand{ command = 'hash', func = function() shellExecute('Hash.exe', '', TOOLS_PATH .. '\\others\\hash', 'normal') end }
addCommand{ command = 'filetypesman', func = function() shellExecute('FileTypesMan.exe', '', TOOLS_PATH .. '\\others\\filetypesman-x64', 'normal') end }
addCommand{ command = 'pchunter', func = function() shellExecute('PCHunter64.exe', '', TOOLS_PATH .. '\\others\\PCHunter', 'normal') end }
addCommand{ command = 'winscp', func = function() shellExecute('WinSCP.exe', '', TOOLS_PATH .. '\\others\\WinScp', 'normal') end }
addCommand{ command = 'putty', func = function() shellExecute('putty.exe', '', TOOLS_PATH .. '\\others\\WinScp', 'normal') end }


elseif MAC then
addCommand{ command = 'terminal', key = 'A-T', func = function() shellExecute('/Applications/Utilities/terminal.app') end }
end


--google搜索
addCommand{ command = 'google', func = function(arg) shellExecute('http://www.google.com.hk/search?q=' .. arg) end }

--百度搜索
addCommand{ command = 'baidu', func = function(arg) shellExecute('http://www.baidu.com/s?wd=' .. arg) end }


-- Events
local histroy = io.open(MERRY_ROOT_PATH .. 'histroy.lua', 'a')
addEventHandler('onUndefinedCommand', function(commandName, commandArg)
local commandNameArray = { commandName }
if MAC then
table.insert(commandNameArray, "/Applications/" .. commandName .. ".app")
table.insert(commandNameArray, "/Applications/Utilities/" .. commandName .. ".app")
end

for _, commandNameFull in ipairs(commandNameArray) do
if shellExecute(commandNameFull, commandArg) then
addCommand{ command = commandName, func = function() shellExecute(commandNameFull) end }
local strCommandName = string.gsub(commandName, '\\', '\\\\')
local strCommandNameFull = string.gsub(commandNameFull, '\\', '\\\\')
histroy:write(string.format("addCommand{ command = '%s', func = function() shellExecute('%s') end }\n",
strCommandName, strCommandNameFull))
histroy:flush()
break
end
end
end)


addEventHandler('onClose', function()
histroy:close()
showWindow(curHideWindow, 'normal')
end)


--[[
shellExecute

shellExecute(commandName, commandArg, workingDir, show)
用于执行一个 shell 命令
commandName 为 shell 命令名
commandArg 为 shell 命令需要的参数
workingDir 为 shell 命令的工作路径
show 表示显示的方式,包括 'normal'、'max'、'min'、'hide'(常规显示、最大化、最小化、隐藏)
函数返回 true / false 表示是否执行是否成功

范例,打开 cmd 窗口并且最大化
shellExecute('cmd', '', '', 'max')


]]



推荐阅读
  • GetWindowLong函数
    今天在看一个代码里头写了GetWindowLong(hwnd,0),我当时就有点费解,靠,上网搜索函数原型说明,死活找不到第 ... [详细]
  • 本文介绍了OC学习笔记中的@property和@synthesize,包括属性的定义和合成的使用方法。通过示例代码详细讲解了@property和@synthesize的作用和用法。 ... [详细]
  • 本文详细介绍了Java中vector的使用方法和相关知识,包括vector类的功能、构造方法和使用注意事项。通过使用vector类,可以方便地实现动态数组的功能,并且可以随意插入不同类型的对象,进行查找、插入和删除操作。这篇文章对于需要频繁进行查找、插入和删除操作的情况下,使用vector类是一个很好的选择。 ... [详细]
  • 本文介绍了在使用Python中的aiohttp模块模拟服务器时出现的连接失败问题,并提供了相应的解决方法。文章中详细说明了出错的代码以及相关的软件版本和环境信息,同时也提到了相关的警告信息和函数的替代方案。通过阅读本文,读者可以了解到如何解决Python连接服务器失败的问题,并对aiohttp模块有更深入的了解。 ... [详细]
  • ASP.NET2.0数据教程之十四:使用FormView的模板
    本文介绍了在ASP.NET 2.0中使用FormView控件来实现自定义的显示外观,与GridView和DetailsView不同,FormView使用模板来呈现,可以实现不规则的外观呈现。同时还介绍了TemplateField的用法和FormView与DetailsView的区别。 ... [详细]
  • Ubuntu安装常用软件详细步骤
    目录1.GoogleChrome浏览器2.搜狗拼音输入法3.Pycharm4.Clion5.其他软件1.GoogleChrome浏览器通过直接下载安装GoogleChro ... [详细]
  • Day2列表、字典、集合操作详解
    本文详细介绍了列表、字典、集合的操作方法,包括定义列表、访问列表元素、字符串操作、字典操作、集合操作、文件操作、字符编码与转码等内容。内容详实,适合初学者参考。 ... [详细]
  • 本文介绍了在Windows系统上使用C语言命令行参数启动程序并传递参数的方法,包括接收参数程序的代码和bat文件的编写方法,同时给出了程序运行的结果。 ... [详细]
  • Java学习笔记之使用反射+泛型构建通用DAO
    本文介绍了使用反射和泛型构建通用DAO的方法,通过减少代码冗余度来提高开发效率。通过示例说明了如何使用反射和泛型来实现对不同表的相同操作,从而避免重复编写相似的代码。该方法可以在Java学习中起到较大的帮助作用。 ... [详细]
  • 本文介绍了使用哈夫曼树实现文件压缩和解压的方法。首先对数据结构课程设计中的代码进行了分析,包括使用时间调用、常量定义和统计文件中各个字符时相关的结构体。然后讨论了哈夫曼树的实现原理和算法。最后介绍了文件压缩和解压的具体步骤,包括字符统计、构建哈夫曼树、生成编码表、编码和解码过程。通过实例演示了文件压缩和解压的效果。本文的内容对于理解哈夫曼树的实现原理和应用具有一定的参考价值。 ... [详细]
  • 本文介绍了一种轻巧方便的工具——集算器,通过使用集算器可以将文本日志变成结构化数据,然后可以使用SQL式查询。集算器利用集算语言的优点,将日志内容结构化为数据表结构,SPL支持直接对结构化的文件进行SQL查询,不再需要安装配置第三方数据库软件。本文还详细介绍了具体的实施过程。 ... [详细]
  • 如何在HTML中获取鼠标的当前位置
    本文介绍了在HTML中获取鼠标当前位置的三种方法,分别是相对于屏幕的位置、相对于窗口的位置以及考虑了页面滚动因素的位置。通过这些方法可以准确获取鼠标的坐标信息。 ... [详细]
  • 本文介绍了响应式页面的概念和实现方式,包括针对不同终端制作特定页面和制作一个页面适应不同终端的显示。分析了两种实现方式的优缺点,提出了选择方案的建议。同时,对于响应式页面的需求和背景进行了讨论,解释了为什么需要响应式页面。 ... [详细]
  • 本文介绍了pack布局管理器在Perl/Tk中的使用方法及注意事项。通过调用pack()方法,可以控制部件在显示窗口中的位置和大小。同时,本文还提到了在使用pack布局管理器时,应注意将部件分组以便在水平和垂直方向上进行堆放。此外,还介绍了使用Frame部件或Toplevel部件来组织部件在窗口内的方法。最后,本文强调了在使用pack布局管理器时,应避免在中间切换到grid布局管理器,以免造成混乱。 ... [详细]
  • Iamtryingtocreateanarrayofstructinstanceslikethis:我试图创建一个这样的struct实例数组:letinstallers: ... [详细]
author-avatar
超级放开祢旳掱
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有