1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

キーボードショートカットからスリープしたときだけ即解除される(Mac)

Posted at

備忘録なので簡単にメモ。

状況

PC(Mac mini)でシステム環境設定からスリープにショートカットを割り振った。
しかしスリープはするものの即座に解除される。
マウス操作でメニューバーからスリープしたときはそのようなことは起きない。

結論

AutomatorでKarabinerのプロファイルを切り替えてスリープするサービスを作成して対応した。

原因

Karabinerがスリープから起こしてたらしい。細かいことは不明。

設定手順

  • Karabiner Elementsから新しいプロファイルを作る。
    ( ここでは既存のプロファイルdefault、新しく作ったものをdisabledとする )
  • Automator → クイックアクションを選択 → 検索窓から「シェルスクリプトを実行」を選択 → 「ワークフローが受け取る現在の項目」を「入力なし」に設定 → 以下のスクリプトを設定
スリープ時
/Library/Application\ Support/org.pqrs/Karabiner-Elements/bin/karabiner_cli --select-profile 'disabled'
pmset sleepnow
スリープ解除時
/Library/Application\ Support/org.pqrs/Karabiner-Elements/bin/karabiner_cli --select-profile 'default'
  • システム環境設定 → キーボード → ショートカット → サービス → 一般 に作成したサービスがあるのでこれに好きなショートカットを割り振る

メモ

pmset -g log で電源関係?のログを見れる。今回はここからKarabinerが怪しいと判断した(GPTが)

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?