非常NB的一款快捷启动软件--Merry
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') ]]
非常NB的一款快捷启动软件--Merry的更多相关文章
- LaunchFaster 启动器工具 - 类似 Rolan 和音速启动的图标式快捷启动软件
LaunchFaster 启动器是本人近期编写的一款windows平台上快速启动应用的开源工具软件. LaunchFaster 启动器是一款类似于 Rolan 和 音速启动 和 Lily 的图标形式的 ...
- 神逸之作:国产快速启动软件神品ALTRun
http://xbeta.info/altrun.htm 作者: ET民工和塞壬 日期: 2010-09-15 分类: windows 标签: quick-launch <神逸之作:国产快速启动 ...
- ubuntu14下创建软件的快捷启动方式
下载软件,使用softname/bin/softname.sh即可启动,但是很麻烦,每次都要打开terminal 为了方便,我们需要创建desktop文件指向这个启动软件的shell文件(以创建Pyc ...
- Linux添加快捷启动方式 (Ubuntu Debian CentOS)
ubuntu桌面快捷方式的创建 debian添加快捷启动方式 centos 6 桌面建立应用程序的快捷方式的方法 今天用着用着ubuntu,突然抽搐了,感觉特别别扭,特别不方便.新装的应用程序不好 ...
- ubuntu 14.04 Clion2016.2 安装激活与安装后添加快捷启动方式
参考链接:http://www.cnblogs.com/conw/p/5938113.html 下载clion for linux : http://www.jetbrains.com/clion/d ...
- GitHub 上最热的10款国产开源软件
衡量一个开源产品好不好,看看产品在 GitHub 的 Star 数量就知道了.由此可见,GitHub 已经沦落为开源产品的“大众点评”了.一个开源产品希望快速的被开发者知道.快速的获取反馈,放到 Gi ...
- 对标印度的PostMan,一款中国接口测试软件的崛起
对于我们开发者,Api接口调试一定不陌生.包括我在内,之前进行Api调试时,一直使用的是一款印度的软件Postman.记得刚入手的时候,由于该款软件缺乏中文版本,上手一直比较慢,而且还至少存在如下几个 ...
- 给windows右键添加快捷启动程序
给windows右键添加快捷启动程序 修改点击空白处的右键 运行--redegit 打开注册表 展开第一个H..C..R 找到 Direcory,展开 找到Background 展开 右键shell, ...
- Eclipse 在ubuntu桌面显示快捷启动以及解决Eclipse 在ubuntu中点击菜单栏不起作用的原因.
要在Eclipse中设置好之后,可以通过如下方式在周末显示快捷启动以及解决Eclipse在ubuntu高版本中点击菜单栏项不显示列表的问题 在usr/share/app-install/desktop ...
随机推荐
- ES6异步操作之Promise
一直以来觉得异步操作在我心头像一团迷雾,可是它重要到我们非学不可,那就把它的面纱解开吧. ES6 诞生以前,异步编程的方法,大概有下面四种. 回调函数 事件监听 发布/订阅 Promise 对象 异步 ...
- 【记录】.bin文件 到 .vdi文件的转换教程
.bin文件 到 .vdi文件的转换教程 1. 背景 想体验一下 Chrome OS 系统,于是准备在 虚拟机VirtualBox(Mac版) 中安装一下,网上教程非常少,找到如下教程 原贴地址:ht ...
- TCP状态机:当服务端主动发FIN进TIME_WAIT,客户端源端口复用会发生什么
0X01 正常情况下TCP连接会通过4次挥手进行拆链(也有通过RST拆除连接的可能,见为什么服务器突然回复RST--小心网络中的安全设备),下图TCP状态机展示了TCP连接的状态变化过程: 我们重点看 ...
- background,position,绝对定位中位置属性的定位规则,cursor
backgorund背景 background-color:red; 背景颜色 background-image:url(路径);背景图片 background-repeat:no-repeat;不重 ...
- 原生javascript 基础动画原理
一.实现原理: 1.开定时器前先清除定时器 2.设置定时器 3.当前元素的位置 + 每一步的长度 4.当元素当前位置超过目标点时,把当前位置==目标点 5.设置元素位置,开始运动 6.判断当前位置如果 ...
- 快速回顾MySQL:简单查询操作
利用空闲时间花几分钟回顾一下 7.1 检索数据 为了查询出数据库表中的行(数据),使用SELECE语句. 格式: # 第一种 SELECT * FROM <table_name>; # 第 ...
- Scala实践3
一.函数式对象 1.1 rational类的规格和创建 Rational类来源于有理数(rational number),来表示n(分子)/d(分母)的数字,同时对有理数的运算(加减乘除)建模,还具 ...
- lldb调试器知多少
lldb调试器简介 lldb 是一个有着 REPL 的特性和 C++ .Python 插件的开源调试器.lldb调试器的由来是伴随着Xcode的版本升级而来. Xcode4.3之前使用的默认调试器 ...
- 如何获取scrimba内部(内联框架)中网页地址?
看图: 将其在新窗口打开 方法一:按下F12 键 (打开 开发者工具) ,再照图中箭头用鼠标点击所示, 图中粗红下划线为该页面的URL 地址, 复制在新窗口打开即可 方法二:利用JS代码手动获取 ...
- python的list()函数
list()函数将其它序列转换为 列表 (就是js的数组). 该函数不会改变 其它序列 效果图一: 代码一: # 定义一个元组序列 tuple_one = (123,','abc') print( ...