暂时只支持 mac os ,可以筛选时间段,查看每天花在各种应用上的时间,花在浏览的网站上的时间,给应用加标签等等,说的不是很清楚,请看下面的图吧
安装:
pip install trackmac
使用方法及源码:
https://github.com/MacLeek/trackmac
1
jmy 2016-09-08 11:54:48 +08:00
Cool 开始使用。
|
2
metrue 2016-09-08 12:01:45 +08:00
喜欢这个小工具。
|
3
bugcode 2016-09-08 12:28:11 +08:00 via iPhone
great !
|
4
lujun9972 2016-09-08 13:23:49 +08:00 via Android
能问下实现的机理是什么吗?
|
5
itfanr 2016-09-08 13:34:38 +08:00
有意思
|
6
macleek OP @lujun9972 普通程序是使用的 appkit framework 里的函数来获取窗口标题, 浏览器里网址是通过 scripting bridge 调了一些 applescript 来获取的, https://github.com/MacLeek/trackmac/blob/master/trackmac/cocoa.py
|
7
zhanglintc 2016-09-08 18:27:31 +08:00
还是 Python 的, 看起来不错, 可以试试
|
8
xjp 2016-09-08 19:28:55 +08:00
很强
|
9
UnisandK 2016-09-08 19:42:05 +08:00
|
10
uuair 2016-09-08 22:55:00 +08:00
我想问个问题,是否需要 sudo pip install 这样安装??我使用 sudo 安装,但是运行 tm start 以后等一段时间, tm list 什么都没有。如果直接 pip install 则安装不上。。。。
|
11
itisthecon 2016-09-09 00:42:46 +08:00
cool! 顺便请教演示动画是怎么做的
|
13
slixurd 2016-09-09 01:45:41 +08:00
在 OSX 上跑着崩了几次,虽然都自动重启了。
大概就是这样: System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY VM Regions Near 0: --> __TEXT 000000010f4ea000-000000010f4ec000 [ 8K] r-x/rwx SM=COW /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python |
14
hqdmy 2016-09-09 09:15:28 +08:00
不错啊,试一试
|
15
hqdmy 2016-09-09 09:25:57 +08:00
tm list
Traceback (most recent call last): File "/usr/local/bin/tm", line 5, in <module> from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2793, in <module> working_set.require(__requires__) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 673, in require needed = self.resolve(parse_requirements(requirements)) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 576, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: click 不行啊 |
16
macleek OP @hqdmy 用的 apple 自带的 python 会有一些麻烦,这里你的问题可能是用 easey_install 安装的 pip ,试试 easy_install --upgrade pip
|
17
macleek OP @slixurd 我之前也遇到这个问题,是因为 ctypes 里强行转换一个空值到字符串,但后来修复了就没发现问题了,可否告知下如何复现这个问题呢?是不是用 safari 在浏览网页时出现的问题呢?
|
18
macleek OP @itisthecon 我是使用的 Quicktime Player 屏幕录像,然后参考网上的一个方法, ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif ,就能导出 gif 了
|
19
itisthecon 2016-09-09 09:42:31 +08:00
@macleek 多谢, 收藏了
|
20
TangMonk 2016-09-09 09:55:01 +08:00
厉害
|
21
TangMonk 2016-09-09 10:09:26 +08:00
这个可以关掉不?
|
22
Alicewish 2016-09-09 10:19:00 +08:00 via iPhone
@UnisandK RescueTime 订阅制好烦人,扣了我 N 个月直到卡刷爆…… Mac 上推荐下 Timing , 25 刀来着。
|
24
hilenlai 2016-09-09 10:27:30 +08:00
@macleek
``` Traceback (most recent call last): File "/usr/local/bin/tm", line 9, in <module> load_entry_point('trackmac==0.0.6', 'console_scripts', 'tm')() File "/Library/Python/2.7/site-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/Library/Python/2.7/site-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/Library/Python/2.7/site-packages/click/core.py", line 1060, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/Library/Python/2.7/site-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Library/Python/2.7/site-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/Library/Python/2.7/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/Library/Python/2.7/site-packages/trackmac/main.py", line 50, in setup trackmac.utils.create_database() File "/Library/Python/2.7/site-packages/trackmac/utils.py", line 86, in create_database trackmac.models.BlockedApplication], safe=True) File "/Library/Python/2.7/site-packages/peewee.py", line 3765, in create_tables create_model_tables(models, fail_silently=safe) File "/Library/Python/2.7/site-packages/peewee.py", line 5175, in create_model_tables m.create_table(**create_table_kwargs) File "/Library/Python/2.7/site-packages/peewee.py", line 4840, in create_table if fail_silently and cls.table_exists(): File "/Library/Python/2.7/site-packages/peewee.py", line 4836, in table_exists return cls._meta.db_table in cls._meta.database.get_tables(**kwargs) File "/Library/Python/2.7/site-packages/peewee.py", line 3893, in get_tables 'type = ? ORDER BY name;', ('table',)) File "/Library/Python/2.7/site-packages/peewee.py", line 3683, in execute_sql self.commit() File "/Library/Python/2.7/site-packages/peewee.py", line 3507, in __exit__ reraise(new_type, new_type(*exc_args), traceback) File "/Library/Python/2.7/site-packages/peewee.py", line 3674, in execute_sql cursor = self.get_cursor() File "/Library/Python/2.7/site-packages/peewee.py", line 3622, in get_cursor return self.get_conn().cursor() File "/Library/Python/2.7/site-packages/peewee.py", line 3615, in get_conn self.connect() File "/Library/Python/2.7/site-packages/peewee.py", line 3595, in connect self.initialize_connection(self._local.conn) File "/Library/Python/2.7/site-packages/peewee.py", line 3507, in __exit__ reraise(new_type, new_type(*exc_args), traceback) File "/Library/Python/2.7/site-packages/peewee.py", line 3593, in connect **self.connect_kwargs) File "/Library/Python/2.7/site-packages/peewee.py", line 3862, in _connect conn = sqlite3.connect(database, **kwargs) peewee.OperationalError: unable to open database file ``` 用的 Mac 自带的 Python ,这个问题怎么解决? |
25
macleek OP @TangMonk
这个确实很蛋疼,我也在想法解决, http://stackoverflow.com/questions/12333500/hide-python-rocket-dock-icon-when-using-scriptingbridge/21177802#21177802 ,这里有一个方法,不过要关掉 sip ,而且影响全局,还有一个方法是做成 app ,直接在 info.plist 里修改,但这样就没必要用 python 写了。。。 |