LoginSignup
1
1

More than 5 years have passed since last update.

[備忘録]ArchLinuxのGnomeでs2diskしたときのメモ

Last updated at Posted at 2017-03-12

やりたかったこと

ArchlinuxをThinkpadHelix2(Versapro)にインストールしたが、Windowsと同じくスリープやハイバーネートなどの動作が宜しくない。pm-utilssystemdとの相性が良くないようなので*1 Uswsuspを使えるようにした。

やったこと

  • AURからuswsusp-gitをインストールする。現在(2017/03/12)ではcompressオプションを設定してしまうと、起動プロセスが途中で停止してしまうのでとりあえずこのオプションは外しておくのがオススメ。

  • 一通り適切な設定を行い# s2diskコマンドの動作を確認する。

  • systemdにデフォルトで用意されているsuspendの設定を編集する。まずはデフォルトの設定ファイルをコピーする。

sudo cp /usr/lib/systemd/system/systemd-suspend.service /etc/systemd/system

次に、デフォルトのサスペンドの代わりにUswsusps2diskを使用するようにする

/etc/systemd/system/systemd-suspend.service
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Suspend
Documentation=man:systemd-suspend.service(8)
DefaultDependencies=no
Requires=sleep.target
After=sleep.target

[Service]
Type=oneshot
# ExecStart=/usr/lib/systemd/systemd-sleep suspend
ExecStartPre=-/usr/bin/run-parts -v -a pre /usr/lib/systemd/system-sleep
ExecStart=/usr/bin/s2disk
ExecStartPost=-/usr/bin/run-parts -v --reverse -a post /usr/lib/systemd/system-sleep

  • 私はGnomeユーザーなのでtweakツールで蓋を閉じたときの動作を「なし」に設定し、設定パネルから電源ボタンを押したときの動作を「サスペンド」に設定した。

参考文献

*1 https://wiki.archlinuxjp.org/index.php/Pm-utils
https://wiki.archlinuxjp.org/index.php/Uswsusp
http://qiita.com/a_yasui/items/f2d8b57aa616e523ede4

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