{"action":"created","issue":{"url":"https://api.github.com/repos/darknessomi/musicbox/issues/152","labels_url":"https://api.github.com/repos/darknessomi/musicbox/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/darknessomi/musicbox/issues/152/comments","events_url":"https://api.github.com/repos/darknessomi/musicbox/issues/152/events","html_url":"https://github.com/darknessomi/musicbox/issues/152","id":111398656,"number":152,"title":"通过桌面环境通知显示歌词","user":{"login":"chaserhkj","id":1768423,"avatar_url":"https://avatars.githubusercontent.com/u/1768423?v=3","gravatar_id":"","url":"https://api.github.com/users/chaserhkj","html_url":"https://github.com/chaserhkj","followers_url":"https://api.github.com/users/chaserhkj/followers","following_url":"https://api.github.com/users/chaserhkj/following{/other_user}","gists_url":"https://api.github.com/users/chaserhkj/gists{/gist_id}","starred_url":"https://api.github.com/users/chaserhkj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaserhkj/subscriptions","organizations_url":"https://api.github.com/users/chaserhkj/orgs","repos_url":"https://api.github.com/users/chaserhkj/repos","events_url":"https://api.github.com/users/chaserhkj/events{/privacy}","received_events_url":"https://api.github.com/users/chaserhkj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-14T13:30:51Z","updated_at":"2015-10-15T03:26:16Z","closed_at":null,"body":"在实现了全局快捷键绑定之后，经常还是吧musicbox放在后台听音乐然后在前台干别的事情的，但是这样做的时候有时想一起看一看歌词，就像传统的音乐软件有个悬浮窗歌词神马的……\r\n\r\n但是我们这个程序要是涉及到悬浮窗歌词的话就得做gui，这和轻量化的初衷有所违背，于是就想到了通过`notify-send`之类的指令直接显示歌词……\r\n\r\n现在试了一下直接在`Ui.build_process_bar`的更新歌词显示代码后面加了调用`notify-send`的代码……\r\n效果基本上是这样的……\r\n\r\n![screen](https://cloud.githubusercontent.com/assets/1768423/10484947/a7c3e7fc-72ba-11e5-9f41-13b4dea88fa7.png)\r\n\r\n\r\n但是发现这样做略蠢……因为这段代码会在每次进度条更新的时候就被调用一次，虽然`notify-send`被设计成了重复通知不会重复显示……但是歌词走太快了有时会显示好几个弹窗，就和上面截图显示的一样……然后走太慢了之后又这一句没有唱完通知窗口就timeout消失了……而且没有歌词时会不停弹窗“暂无歌词”……\r\n\r\n最理想的做法是用`notfiy-send`的`-t`选项控制通知的显示时间，来与歌词的显示时间同步，这样总只会有一个弹窗而且弹窗总是显示当前的这句歌词，但是这样的话可能原来的歌词显示部分的代码框架得整个改改……我觉得还是有点麻烦的……大家有什么想法，觉得这个功能值得加么？ = ="},"comment":{"url":"https://api.github.com/repos/darknessomi/musicbox/issues/comments/148271507","html_url":"https://github.com/darknessomi/musicbox/issues/152#issuecomment-148271507","issue_url":"https://api.github.com/repos/darknessomi/musicbox/issues/152","id":148271507,"user":{"login":"darknessomi","id":6939375,"avatar_url":"https://avatars.githubusercontent.com/u/6939375?v=3","gravatar_id":"","url":"https://api.github.com/users/darknessomi","html_url":"https://github.com/darknessomi","followers_url":"https://api.github.com/users/darknessomi/followers","following_url":"https://api.github.com/users/darknessomi/following{/other_user}","gists_url":"https://api.github.com/users/darknessomi/gists{/gist_id}","starred_url":"https://api.github.com/users/darknessomi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darknessomi/subscriptions","organizations_url":"https://api.github.com/users/darknessomi/orgs","repos_url":"https://api.github.com/users/darknessomi/repos","events_url":"https://api.github.com/users/darknessomi/events{/privacy}","received_events_url":"https://api.github.com/users/darknessomi/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T03:26:16Z","updated_at":"2015-10-15T03:26:16Z","body":"我舔着脸，发邮件去要了Orz"}}