{"id":256739,"date":"2015-05-07T08:02:02","date_gmt":"2015-05-07T04:02:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=256739"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=256739","title":{"rendered":"thd \u0438\u043b\u0438 triggerhappy global hotkey daemon"},"content":{"rendered":"<p>     \t\u041e \u0447\u0435\u043c \u0442\u0443\u0442 \u0440\u0435\u0447\u044c? \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 USB \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430 headless \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0437\u0430 200 \u0440\u0443\u0431\u043b\u0435\u0439, \u0430 \u0442\u043e \u0438 \u0434\u0435\u0448\u0435\u0432\u043b\u0435.<a name=\"habracut\"><\/a><\/p>\n<p>  <b>\u0412\u0432\u043e\u0434\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c:<\/b> \u0414\u043e\u043c\u0430 \u0435\u0441\u0442\u044c \u00ab\u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439\u00bb \u0441\u0435\u0440\u0432\u0435\u0440. \u042d\u0442\u0430\u043a\u0430\u044f \u043a\u043e\u0440\u043e\u0431\u043e\u0447\u043a\u0430 Lenovo q190 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c DVD box. \u0415\u0449\u0451 \u0435\u0441\u0442\u044c \u041c\u0424\u0423 samsung SCX-4220. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u0430 ubuntu 14.04 LTS, \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 CUPS, \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u0442, \u043d\u043e \u0432\u043e\u0442 \u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c.<\/p>\n<p>  <b>\u041f\u0435\u0447\u0430\u043b\u044c:<\/b> \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u0441\u0443\u043d\u0433\u0435 \u043d\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u043e\u043f\u044c\u044e\u0442\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043a\u0430\u043d.<\/p>\n<p>  <b>\u0412\u043d\u0435\u0437\u0430\u043f\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/b>: \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u0435\u0441\u044f\u0446\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0443\u044e \u043d\u043e\u0432\u0443\u044e \u0431\u0430\u0442\u0430\u0440\u0435\u0439\u043a\u0443 \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043d\u0430 \u0432\u0438\u0442\u0440\u0438\u043d\u0435 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0448\u0442\u0443\u043a\u0443. <\/p>\n<p>  USB 7.1 channel sound. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/542\/c5e\/1d3\/542c5e1d3ca9fbc7388078e9197da99e.jpg\" alt=\"USB 7.1 channel sound\" width=\"300\"\/><\/p>\n<p>  \u0422\u0430\u043a\u0438\u0435 \u0437\u0432\u0443\u043a\u043e\u0432\u0443\u0448\u043a\u0438 \u043b\u0435\u0436\u0430\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435 \u043f\u043e 200 \u0440\u0443\u0431\u043b\u0435\u0439 \u043f\u0443\u0447\u043e\u043a. \u041e \u0434\u0443\u043c\u0430\u044e, \u0430 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043a\u0438\u0442\u0430\u0439\u0446\u044b + \u043a\u043d\u043e\u043f\u043a\u0438 \u0438 \u044d\u0442\u043e \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430? \u0414\u0430\u0439-\u0442\u0435 \u043a\u043e \u043c\u043d\u0435 \u043e\u0434\u043d\u0443?<\/p>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f: \u041a\u0443\u043f\u0438\u043b, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u043a headless q190 \u0438 \u0441\u0442\u0430\u043b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u044b\u0432\u043e\u0434<\/p>\n<p>  $ lsusb<br \/>  Bus 001 Device 005: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller<\/p>\n<p>  \u041f\u0435\u0447\u0430\u043b\u044c\u043d\u043e, \u0434\u0443\u043c\u0430\u044e, \u043d\u043e \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0435\u0449\u0451 \u0438 \u0432 dmesg \u043d\u0430\u0448\u043b\u043e\u0441\u044c?<\/p>\n<p>  hid-generic 0003:0D8C:013C.0002: input,hidraw0: USB HID v1.00 Device [C-Media Electronics Inc. USB PnP Sound Device] on usb-0000:00:1a.0-1.4\/input3<\/p>\n<p>  \u041e, \u0442\u043e \u0447\u0442\u043e \u0434\u043e\u043a\u0442\u043e\u0440 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043b. \u041e\u0442\u043b\u0438\u0447\u043d\u043e! <\/p>\n<p>  \u041a\u043d\u043e\u043f\u043a\u0438 \u0437\u0432\u0443\u043a\u043e\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u044b \u044d\u0442\u043e \u0442\u0430\u043a\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f USB \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430. \u0422\u043e \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>  <b>THD: <\/b><a href=\"https:\/\/github.com\/wertarbyte\/triggerhappy\">github.com\/wertarbyte\/triggerhappy<\/a><\/p>\n<p>  \u0412 \u0443\u0431\u0443\u043d\u0442\u0443 14.04 \u043e\u043d \u0435\u0441\u0442\u044c \u00ab\u0438\u0441\u043a\u0430\u0440\u043e\u043f\u043a\u0438\u00bb.<\/p>\n<p>  $ apt-get install thd<\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430:<br \/>  $ cat \/etc\/triggerhappy\/triggers.d\/brj.conf<br \/>  KEY_VOLUMEDOWN 1 \/home\/brj\/bin\/scanme.sh<br \/>  KEY_VOLUMEUP 1 \/home\/brj\/grab-torrent.sh<\/p>\n<p>  \u041f\u043e \u043a\u043b\u0430\u0432\u0438\u0448\u0435 vol down \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<br \/>  \u041f\u043e \u043a\u043b\u0430\u0432\u0438\u0448\u0435 vol up \u2014 \u0442\u043e\u0440\u0435\u043d\u0442\u0438\u043b\u043a\u0430 \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0432\u0435\u0436\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043a\u0430\u0447\u043a\u0443.<\/p>\n<p>  \u0421\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0439 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/p>\n<p>  #!\/bin\/sh<br \/>  outscan=\u00abscan-`date +\u00bb%Y-%m-%d-%H%M%S&quot;`&quot;<br \/>  scanimage &#8212;progress &#8212;mode Color &#8212;format=tiff &#8212;resolution 300 &gt; \/tmp\/image.tiff<br \/>  convert \/tmp\/image.tiff \/home\/brj\/Dropbox\/${outscan}.jpg<br \/>  rm \/tmp\/image.tiff<\/p>\n<p>  <b>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430:<\/b> \u043f\u0435\u0440\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0435\u0441\u0438\u043b \u0437\u0432\u0443\u043a\u0438 \u0438\u0437 super mario \u0438 mpg123, \u0447\u0442\u043e \u0431\u044b \u0437\u043d\u0430\u0442\u044c \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u043b\u0438 \u043d\u0435\u0442. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0431\u0440\u0430\u043b.<\/p>\n<p>  \u0413\u0434\u0435 \u0435\u0449\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c? \u0422\u0430\u043a\u0430\u044f \u0448\u0442\u0443\u043a\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043a\u043d\u043e\u043f\u043e\u043a. \u041c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043d\u0430 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0439 \u043a\u0430\u043d\u0430\u043b, \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430\/\u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044e \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0432\u0438\u043d\u0442, \u0432\u043e\u043e\u0431\u0449\u0435\u043c \u043d\u0430 \u0447\u0442\u043e \u0445\u0432\u0430\u0442\u0438\u0442 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438 \u0442\u043e \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u0423\u0441\u043f\u0435\u0445\u043e\u0432     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/257445\/\"> http:\/\/habrahabr.ru\/post\/257445\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u041e \u0447\u0435\u043c \u0442\u0443\u0442 \u0440\u0435\u0447\u044c? \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 USB \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430 headless \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0437\u0430 200 \u0440\u0443\u0431\u043b\u0435\u0439, \u0430 \u0442\u043e \u0438 \u0434\u0435\u0448\u0435\u0432\u043b\u0435.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-256739","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256739","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256739"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256739\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256739"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256739"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256739"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}