0
0

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.

【defaults】スクリーンショットによりDesktopが汚れることを防ぐ設定[macOS]

Last updated at Posted at 2019-01-10

はじめに

スクリーンショットを撮ることでデスクトップが汚れてしまうことが嫌な方は、下記のように設定することでデスクトップが散らかるのを防ぐことができます。

設定の前にMacでのスクリーンショットに関して簡単に言及しておきます。

スクリーンショット

個人的にはスクリーンショットを撮る目的は次の2つであると考えています。

  1. 画面を断片的にシェアしたいとき(対コミュニケーション)
  2. 情報を保存しておきたいとき(対自己メモリ)

それぞれの目的別のショートカットキーは次のようになります。

ショートカットキー

  • 画面を断片的にシェアしたいとき(対コミュニケーション)
    • command + shift + control + 4
  • 情報を保存しておきたいとき(対自己メモリ)
    • command + shift + 3

controlを付与することで、clipboardに保存することができるので、シェア目的にスクリーンショットを撮るときには重宝します。また、3ではなく4を利用することでキャプチャ画面の保存を防ぐことができます。

設定の流れ

1. フォルダ作成

デスクトップにスクリーンショット画像を保存しておくためのフォルダを作成します。名前はなんでも構いません。

$ mkdir ~/Desktop/screencapture

2. 設定ファイルへの書き込み

mac内部の設定を変更するにはdefaultsコマンドを使用します。
defaultsplistと呼ばれるアプリやシステムの設定ファイルに、設定値を追加、変更、削除、検索することができるコマンドです。

defaults writeコマンドによって、設定値を追加・変更することができます。
ここでは設定項目としてlocationを指定しています。

$ defaults write com.apple.screencapture location ~/Desktop/screencapture

3. 設定を確認

defaults readコマンドによって、設定ファイルの内容を表示することができます。

問題なく設定されたか確認しましょう。
注:defaultsコマンドは /Library/Preferences以下のplistファイルを参照します。
そのため、コマンドを実行するカレントディレクトリはどこでも構いません。

$ defaults read com.apple.screencapture.plist
{
    location = "/Users/furukawatakuya/Desktop/screencapture/";
}

おわりに

ファイルシステムをハックすべく精進していきたいと思います。

こちらの記事が役に立ったという方はいいね、お願いします(^^)

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?