GNU Screenを使ってみる
そのまま中断できるってのがいいね.作業中のままにできるし.これで例えばVMWareを再起動しても・・・・,って言うんならもっと良いんだがどうなんだろうか.とりあえず,設定記録.基本的にいろんなところのを引用してちょっと改良した感じ.もうちょっと煮詰めたいところではある.
## 一部キー割り当てを変更 escape ^z^z # 比較的無難(衝突自体は存在する) bind ^W windowlist -b # リストから選択してEnterで切替 bind ^Q quit # 確認の後、全て終了 ## Emacs風ウィンドウ管理 bind 1 only # C-x 1 bind 2 split # C-x 2 bind 0 remove # C-x 0 bind o focus # C-x o ## 一発切替(あまり使っていない) F1 〜 F12 #bindkey -k k1 select 0 #bindkey -k k2 select 1 #bindkey -k k3 select 2 #bindkey -k k4 select 3 #bindkey -k k5 select 4 #bindkey -k k6 select 5 #bindkey -k k7 select 6 #bindkey -k k8 select 7 #bindkey -k k9 select 8 #bindkey -k k; select 9 #bindkey -k F1 select 10 #bindkey -k F2 select 11 ## 新規ウィンドウに対しての後方スクロールの長さ Gentoo Linuxでは1000 defscrollback 1000 # default: 100 ## 起動時のメッセージを表示しない(Gentoo Linuxではoff) startup_message off ## シェルのウィンドウタイトル(好みで変更) ## ---- .bashrc ---- ## export PS1='\033k\033\\[\u@\h \W]\$ ' #shelltitle "$ |$SHELL" #shelltitle "$ |sh" #shelltitle "$ |shell" shelltitle "$ |bash" # Logging logfile "/home/ogawa/log/screen-%Y%m%d-%n.log" log on deflog on #Alias bind R colon "screen ssh ^b^b" bind P colon "^p" # Bell vbell off autodetach on bell " Bell in window %." activity "Activity in window %." ## 情報収集スクリプトからデータを読み込んで表示 # backtick [id] [lifespan] [autorefresh] [cmd] [args...] # 例(1分ごとに更新の場合の設定) #backtick 0 60 60 /home/xxx/bin/screen_cputemp.sh #backtick 1 60 60 /home/xxx/bin/screen_hddtemp.sh ## 状態表示のカスタマイズ # %0`, %1`, ...: backtickのidによる出力 # %{=b cw}: ANSIエスケープコードによる書式設定例(太字 シアンの背景に白文字) # %{=b c}のように片方の指定では前景色として指定される # blac[k] [r]ed [g]reen [y]ellow [b]lue [m]agenta [c]yan [w]hite # %{-}: 書式解除 # %a: am/pm # %A: AM/PM # %c: 24h表記の時・分 # %C: 12h表記の時・分 # %d: 月の中の日 # %h: X端末のウィンドウタイトル(シェルからの出力部分) # %H: ホスト名 # %l: system load # %m: 月(01-12) # %n: アクティブなウィンドウの番号 # %M: 月(1-12) # %s: 秒 # %t: タイトル # %-w: 現在アクティブなウィンドウ番号より小さいウィンドウの表示部分 # %+w: 現在アクティブなウィンドウ番号より大きいウィンドウの表示部分 # %w: 現在アクティブな番号/タイトルに「*」を付けた全ウィンドウリスト # %y: 西暦年(2桁) # %Y: 西暦年(4桁) ## 情報の表示 ## X上の端末エミュレータ向け ## splitするとcaptionが複数箇所になってしまうが、 ## 端末のウィンドウタイトルを変更できる hardstatus string "[ SCREEN %n: %t ] %h" # X端末のタイトルの最終的な出力 caption always "%{=b b}%-w%{=b rw}%n %t%{-}%+w %=%{=b g}%c:%s %Y/%m/%d" #caption always "%{=b b}[%0` %1`]%-w%{=b rw}%n %t%{-}%+w %=%{=b g}%c:%s %Y/%m/%d" # 温度表示のテスト ## ウィンドウタイトルの変更がされないが、一番下の行だけになる #hardstatus alwayslastline "%{=b b}%-w%{=b rw}%n %t%{-}%+w %=%{=b g}%c:%s %Y/%m/%d"