{"id":3090,"date":"2021-03-15T23:11:35","date_gmt":"2021-03-15T14:11:35","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=3090"},"modified":"2021-03-15T23:15:34","modified_gmt":"2021-03-15T14:15:34","slug":"note-check-the-ac-power-connection-status-of-the-pc-and-when-the-ac-power-is-cut-off-display-the-time-and-suspend","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2021\/03\/15\/note-check-the-ac-power-connection-status-of-the-pc-and-when-the-ac-power-is-cut-off-display-the-time-and-suspend\/","title":{"rendered":"NotePC\u306eAC\u96fb\u6e90\u63a5\u7d9a\u72b6\u6cc1\u3092\u78ba\u8a8d\u3057\u3066AC\u96fb\u6e90\u304c\u5207\u65ad\u3055\u308c\u305f\u3089\u6642\u9593\u3092\u8868\u793a\u3057\u3066\u30b5\u30b9\u30da\u30f3\u30c9\u3059\u308b"},"content":{"rendered":"<p><a data-flickr-embed=\"true\" href=\"https:\/\/www.flickr.com\/photos\/matoken\/51031069573\/in\/datetaken\/\" title=\"IMG_20210313_181855\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/live.staticflickr.com\/65535\/51031069573_436439927e_w.jpg\" width=\"400\" height=\"300\" alt=\"IMG_20210313_181855\"\/><\/a><script async=\"\" src=\"\/\/embedr.flickr.com\/assets\/client-code.js\" charset=\"utf-8\"><\/script><\/p>\n<div class=\"paragraph\">\n<p>\u5927\u304d\u306a\u30d0\u30c3\u30c6\u30ea\u30fc\u3092\u88cf\u5c71\u3067\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\uff0e\u663c\u904e\u304e\u304b\u3089\u5915\u65b9\u307e\u3067\u4f7f\u3063\u3066\u76ee\u76db\u308a\u534a\u5206\u304f\u3089\u3044\uff0e\u5bb6\u306b\u5e30\u3063\u3066\u304b\u3089\u3082\u4f7f\u3044\u7d9a\u3051\u307e\u3057\u305f\u304c\u306a\u304b\u306a\u304b\u30d0\u30c3\u30c6\u30ea\u5207\u308c\u306b\u306a\u308a\u307e\u305b\u3093\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u5bdd\u308b\u524d\u306b\u96fb\u6c60\u304c\u6765\u3066\u308b\u611f\u3058\u304c\u3057\u307e\u305b\u3093\uff0e\u307e\u305f\u6e2c\u308a\u76f4\u3059\u306e\u306f\u9762\u5012\u306a\u306e\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306ascript\u3092\u66f8\u3044\u3066\u5bdd\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ while [[ `acpi -a | grep on-line` ]]; do sleep 10;done; echo \"AC Off-line! (`date +%T`)\" | pee cat \"xmessage -file - \"&amp; pushbullet ; systemctl suspend\nAC Off-line! (02:09:56)<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>acpi\u30b3\u30de\u30f3\u30c9\u3067\u96fb\u6e90\u306e\u72b6\u6cc1\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ acpi -a\nAdapter 0: on-line\n$ acpi -a\nAdapter 0: off-line<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>acpi\u30b3\u30de\u30f3\u30c9\u304c\u306a\u3044\u5834\u5408sys\u3092\u898b\u308b\u3068\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff0eacpid\u304c\u306a\u3044\u5834\u5408\u306f\u7121\u7406\u304b\u306a?<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ while [[ `cat \/sys\/class\/power_supply\/AC\/online` == 1 ]]; do sleep 10;done; echo \"AC Off-line! (`date +%T`)\" | pee cat \"xmessage -file - \"&amp; pushbullet ; systemctl suspend<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>10\u79d2\u6bce\u306b\u96fb\u6e90\u72b6\u6cc1\u3092\u78ba\u8a8d\u3057\u3066AC\u96fb\u6e90\u304cOff\u306b\u306a\u3063\u305f\u3089\u30b3\u30f3\u30bd\u30fc\u30eb\u3068X\u3068PushBullet\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3057\u3066\u30b5\u30b9\u30da\u30f3\u30c9\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3066\u3053\u3068\u3067PC\u306e\u52d5\u4f5c\u72b6\u6cc1\u306b\u3082\u3088\u308b\u3067\u3057\u3087\u3046\u304c\u4eca\u56de\u306f\u7d0412\u6642\u9593\u52d5\u4f5c\u3057\u307e\u3057\u305f\uff0e<\/p>\n<p>\u4eca\u56de\u30d0\u30c3\u30c6\u30ea\u30fc(3.7V DC)\u304b\u3089AC 100V\u306b\u5909\u63db\uff0c\u66f4\u306bDC(20V)\u5909\u63db\u3057\u3066\u3044\u308b\u306e\u3067\u5909\u63db\u52b9\u7387\u304c\u60aa\u305d\u3046\u3067\u3059\uff0eDC12V\u51fa\u529b\u3082\u51fa\u6765\u308b\u3088\u3046\u306a\u306e\u3067\u305d\u3053\u304b\u3089DC-DC\u5909\u63db\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3068\u52b9\u7387\u3088\u304f\u306a\u3063\u3066\u3055\u3089\u306b\u6642\u9593\u304c\u4f38\u3073\u305d\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u74b0\u5883<\/div>\n<div class=\"content\">\n<pre>$ sudo lshw -c system -sanitize | head\ncomputer\n    description: Notebook\n    product: 23533KJ (LENOVO_MT_2353)\n    vendor: LENOVO\n    version: ThinkPad T430s\n    serial: [REMOVED]\n    width: 64 bits\n    capabilities: smbios-2.7 dmi-2.7 smp vsyscall32\n    configuration: administrator_password=disabled chassis=notebook family=ThinkPad T430s power-on_password=disabled sku=LENOVO_MT_2353 uuid=[REM\nOVED]\n  *-pnp00:00\n$ dpkg-query -W acpi x11-utils\nacpi    1.7-1.1\nx11-utils       7.7+5\n$ lsb_release -dr\nDescription:    Debian GNU\/Linux bullseye\/sid\nRelease:        unstable\n$ uname -m\nx86_64<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u304d\u306a\u30d0\u30c3\u30c6\u30ea\u30fc\u3092\u88cf\u5c71\u3067\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\uff0e\u663c\u904e\u304e\u304b\u3089\u5915\u65b9\u307e\u3067\u4f7f\u3063\u3066\u76ee\u76db\u308a\u534a\u5206\u304f\u3089\u3044\uff0e\u5bb6\u306b\u5e30\u3063\u3066\u304b\u3089\u3082\u4f7f\u3044\u7d9a\u3051\u307e\u3057\u305f\u304c\u306a\u304b\u306a\u304b\u30d0\u30c3\u30c6\u30ea\u5207\u308c\u306b\u306a\u308a\u307e\u305b\u3093\uff0e \u5bdd\u308b\u524d\u306b\u96fb\u6c60\u304c\u6765\u3066\u308b\u611f\u3058\u304c\u3057\u307e\u305b\u3093\uff0e\u307e\u305f\u6e2c\u308a\u76f4\u3059\u306e\u306f\u9762\u5012\u306a\u306e\u3067\u4ee5\u4e0b\u306e\u3088 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,6,199],"tags":[617,618],"class_list":["post-3090","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-sid","tag-acpi","tag-battery"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=3090"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3090\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=3090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=3090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=3090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}