忍者ブログ

雑記

パソコン関連のHP ruby,linux,FPGAやVHDLについてなど その他、雑記

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

debianをノートパソコンで使いやすくする

パソコン : Thinkpad X61s
OS   : debian squeeze

debianをノートパソコンでもっと使いやすくする。

具体的には
1.無線LANを自動で認識する。
2.ノートパソコンのふたを閉じると自動でサスペンドする。

1.無線LANを自動で認識する。

$ sudo gedit /etc/network/interfaces
----------
/etc/network/interfaces
----------
auto lo
iface lo inet loopback
----------

$ sudo apt-get install network-manager
$ sudo apt-get install wicd

$ sudo /etc/init.d/network-manager restart
$ sudo /etc/init.d/wicd restart

wicdのPreferences->Network Interfaces->Wireless interfaceにwlan0を記述。OK。
Refreshで無線LANを自動認識する。

参考
http://www.debian.org/doc/manuals/debian-reference/ch05.ja.html#_gui_network_configuration_tools



2.ノートパソコンのふたを閉じると自動でサスペンドする。
acpitool、acpidをインストールする。

サスペンド処理するシェルスクリプト(引用
sudo gedit /usr/local/sbin/suspend.sh
----------
/usr/local/sbin/suspend.sh
----------
#!/bin/sh

# discover video card's ID
ID=`lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`

# securely create a temporary file
TMP_FILE=`mktemp /var/tmp/video_state.XXXXXX`
trap 'rm -f $TMP_FILE' 0 1 15

# switch to virtual terminal 1 to avoid graphics
# corruption in X
chvt 1

# write all unwritten data (just in case)
sync

# dump current data from the video card to the
# temporary file
cat /proc/bus/pci/$ID > $TMP_FILE

# suspend
echo -n mem > /sys/power/state

# restore video card data from the temporary file
# on resume
cat $TMP_FILE > /proc/bus/pci/$ID

# switch back to virtual terminal 7 (running X)
chvt 7

# remove temporary file
rm -f $TMP_FILE
----------

$ sudo chmod +x /usr/local/sbin/suspend.sh
サスペンド状態から復帰するには、Fnキーまたは電源ボタンを押す。

sudo mv /etc/acpi /etc/acpi.orig
フォルダがなければ以下を実行。
sudo mkdir /etc/acpi/events
sudo mkdir /etc/acpi/actions

----------
/etc/acpi/events/lid
----------
# event=button[ /]lid.*
event=button[ /]lid LID close
action=/etc/acpi/actions/lid.sh
----------

----------
/etc/acpi/events/pwrbtn
----------
event=button[ /]power
action=/etc/acpi/actions/pwrbtn.sh
----------

----------
/etc/acpi/actions/lid.sh
----------
#!/bin/sh
/usr/local/sbin/suspend.sh

----------
/etc/acpi/actions/pwrbtn.sh
----------
#!/bin/sh
hibernate
----------

sudo chmod +x /etc/acpi/actions/*
sudo /etc/init.d/acpid restart
これでノートパソコンを閉じるとサスペンドされるはず。

参考
http://sourceforge.jp/magazine/06/06/08/0250241
http://blog.tekito.org/2011/08/20/acpid-%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E3%82%B5%E3%82%B9%E3%83%9A%E3%83%B3%E3%83%89/



zzz ~雑記~
鋼材(コイル・フープ・板)の加工・販売サイト「テツコ」 全国対応

拍手[0回]

PR

コメント

お名前
タイトル
文字色
メールアドレス
URL
コメント
パスワード Vodafone絵文字 i-mode絵文字 Ezweb絵文字

こちらもどうぞ

雑記
雑記

雑記内検索

キーワードを入れて検索してください。

カレンダー

03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

AD


フリーエリア

thank you for your click

最新CM

[05/05 Celgimer]
[05/05 cialis]
[05/05 cialis_samples]
[05/04 pharmacy]
[05/04 uk]

バーコード

プロフィール

HN:
No Name Ninja
性別:
男性

ブログ内検索

P R

コガネモチ


zzz ~雑記~