8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MountainLionでBTデバイスのバッテリー状況を取得

8
Last updated at Posted at 2014-04-12

MountainLionでBTデバイスのバッテリー状況を取得

目的

  • システム環境設定で見るのが苦痛だった。
  • Geektool で表示させてしまえばいい

コマンド

Keybord

$ ioreg -n "AppleBluetoothHIDKeyboard" | grep -i "batterypercent" | tr '|' "\n" | tail -n1 | sed 's/.*= \([0-9]*\)$/\1%/'
61%

Trackpad

$ ioreg -n "BNBTrackpadDevice" | grep -i "batterypercent" | tr '|' "\n" | tail -n1 | sed 's/.*= \([0-9]*\)$/\1%/'
30%

Mouse

$ ioreg -n "BNBMouseDevice" | grep -i "batterypercent" | tr '|' "\n" | tail -n1 | sed 's/.*= \([0-9]*\)$/\1%/'
  • 持ってないので多分、大丈夫という感じ
8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?