対象環境
- Thinkpad T510(中古),メモリ4Gが上限のタイプ。
- Debian x86_64 GNU/Linux MATE desktop
- 常時起動(Firefox、icedove、keepass2、emacs、terminal)
- 使用者:素人 遊びでDebian
- 結果
- Before: 起動直後 (MATE emacs firefox icedove mate-terminal lightdm)
free :: used 1183476 (swap 6760) - After: 起動直後 (i3 emacs firefox icedove urxvt lightdm)
free :: used 875524 (swap 0)
- Before: 起動直後 (MATE emacs firefox icedove mate-terminal lightdm)
軽量ブラウザは断念
- 軽量ブラウザを試す(hv3、dillo、xombrero、Links2、NetSurf、midori)が、
- 使用メモリは、起動時少ないが、使用に伴い増えるので Firefoxやchromeに替わるだけのメリットは小さい。
- Firefoxを手放せない。
i3というタイル型WMに移行
- 設定が面倒だが、結構、使いやすい。
- 200Mぐらいは節約できる。
~/.config/i3/config# i3 config file (v4)
set $mod Mod4
set $control ~/.config/i3/workspace_controller.py
# display
set $black #002B36
set $white #839496
set $gray #CCCCCC
set $darkgray #666666
set $green #799F26
set $blue #4D73AA
set $purple #8473A7
set $red #B58900
set $orange #E59847
set $cyan #2AA198
set $dark #00252E
font pango:DejaVu Sans, IPAGothic 12px
#
floating_modifier $mod
bindsym $mod+Return exec urxvt
bindsym $mod+Shift+q kill
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
#
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
# move focused window
bindsym $mod+Shift+j move left
bindsym $mod+Shift+k move down
bindsym $mod+Shift+l move up
bindsym $mod+Shift+semicolon move right
#
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
# split
bindsym $mod+h split h
bindsym $mod+v split v
# screen layout
bindsym $mod+f fullscreen toggle
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
# container
bindsym $mod+a focus parent
#bindsym $mod+d focus child
# workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
bindsym $mod+z workspace back_and_forth
# i3
bindsym $mod+Shift+c reload
bindsym $mod+Shift+r restart
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize
mode "resize" {
bindsym j resize shrink width 6 px or 6 ppt
bindsym k resize grow height 6 px or 6 ppt
bindsym l resize shrink height 6 px or 6 ppt
bindsym semicolon resize grow width 6 px or 6 ppt
bindsym Left resize shrink width 6 px or 6 ppt
bindsym Down resize grow height 6 px or 6 ppt
bindsym Up resize shrink height 6 px or 6 ppt
bindsym Right resize grow width 6 px or 6 ppt
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
# i3bar
bar {
status_command i3blocks -c ~/.config/i3/i3blocks-a.conf
font xft:Ricty Diminished for Powerline 14px
colors {
separator #268bd2
background #002b36
statusline #839496
focused_workspace #fdf6e3 #6c71c4 #fdf6e3
active_workspace #fdf6e3 #6c71c4 #fdf6e3
inactive_workspace #002b36 #586e75 #002b36
urgent_workspace #d33682 #d33682 #fdf6e3
}
}
# keybind
bindsym XF86AudioRaiseVolume exec mpc volume +5
bindsym XF86AudioLowerVolume exec mpc volume -5
bindsym XF86AudioNext exec mpc next
bindsym XF86AudioPrev exec mpc prev
bindsym XF86AudioPlay exec mpc play
bindsym XF86AudioStop exec mpc pause
bindsym XF86MonBrightnessUp exec xbacklight -inc 10
bindsym XF86MonBrightnessDown exec xbacklight -dec 10
bindsym Print exec scrot '%Y-%m-%d_%T_scrot.png' -e 'mv $f ~/Pictures/capture/'
# screen
exec --no-startup-id feh --randomize --bg-scale ~/Pictures/Wallpapers/*
exec --no-startup-id xset s 600
exec --no-startup-id xset dpms 0 0 600
exec --no-startup-id xautolock -time 12 -locker 'i3lock -i ~/.config/i3/triangle_shape.png'
# rofi bindings
bindsym $mod+d exec rofi -show run
bindsym F12 exec rofi -show window
# startup
exec --no-startup-id touchpad off
exec --no-startup-id fcitx-autostart
exec --no-startup-id i3-msg 'workspace 1; exec urxvt'
exec --no-startup-id i3-msg 'workspace 2; exec firefox'
exec --no-startup-id i3-msg 'workspace 3; exec emacs25'
exec --no-startup-id i3-msg 'workspace 4; exec icedove'
exec --no-startup-id devmon
exec --no-startup-id owncloud
exec --no-startup-id nm-applet
exec --no-startup-id redshift
#class border backgr. text indicator
client.focused $white $white $dark $dark
client.unfocused $dark $dark $white $white
client.focused_inactive $dark $dark $white $dark
client.urgent $orange $orange $dark $white
#
for_window [class="Icedove"] move container to workspace 4
for_window [class="Emacs"] move container to workspace 3
for_window [class="Firefox"] move container to workspace 2
for_window [class="josm"] move container to workspace 7
for_window [class="Google-chrome"] move container to workspace 8
for_window [class="(?i)gnome-calculator"] floating enable
for_window [class="mlterm"] floating enable
for_window [class="(?i)geeqie"] floating enable, resize set 840 480
for_window [class="(?i)Shutter"] floating enable, resize set 840 480
for_window [class="(?i)Fcitx-config"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [window_role="menu"] floating enable
for_window [window_role="Preferences"] floating enable
~/.config/i3/i3blocks.conf# i3blocks config file align=center color=#839496 command=/usr/share/i3blocks/$BLOCK_NAME markup=none [MPD] label=♪ command=~/.config/i3/i3blocks-mpd color=#88aa00 interval=15 [volume] label=VOL instance=Master interval=once signal=10 separator=true color=#a43300 [memory] label=MEM instance=mem;free interval=30 [disk] label=DF interval=30 [iface] color=#00FF00 interval=10 [wifi] interval=10 separator=false [bandwidth] interval=5 [cpu_usage] label=CPU interval=10 [battery] label=⚡ interval=30 [time] command=date '+%y/%m/%d(%a)%R' interval=30 [temperature] instance=Core interval=10
ターミナルを軽量化
- urxvt に替える。xtermも軽量だが、カスタム化が不便。
~/.Xdefault for urxvt!Xft settings----------------------- URxvt.depth: 32 URxvt.transparent: false URxvt.fading: 0 URxvt.loginShell: true URxvt.saveLines: 2560 URxvt.internalBorder: 6 URxvt.lineSpace: 1 URxvt*shading: 30 URxvt*inheritPixmap: True ! Cursor --------------------------- URxvt.cursorBlink: true URxvt.cursorColor: #657b83 URxvt.cursorUnderline: false ! Pointer -------------------------- URxvt.pointerBlank: true ! Fonts ---------------------------- URxvt.allow_bold: true URxvt*font: \ xft:MyricaM M:pixelsize=16, \ xft:Inconsolata\ for\ Powerline:pixelsize=16 URxvt*kanji_encoding: UTF-8 URxvt*fading: 70 ! Scrollbar ------------------------ URxvt.scrollStyle: rxvt URxvt.scrollBar: false ! do not scroll with output -------- URxvt*scrollTtyOutput: false ! scroll in relation to buffer (with mouse scroll or Shift+Page Up) URxvt*scrollWithBuffer: true ! scroll back to the bottom on keypress URxvt*scrollTtyKeypress: true URxvt.secondaryScreen: 1 URxvt.secondaryScroll: 0 URxvt.secondaryWheel: 1 ! borders -------------------------- URxvt*externalBorder: 1 URxvt*internalBorder: 1 URxvt*borderLess: 0 ! perl modules --------------------- URxvt.perl-ext-common: default,selection-to-clipboard,clipboard-osc,font-size,xim-onthespot URxvt.keysym.C-Up: font-size:increase URxvt.keysym.C-Down: font-size:decrease URxvt.keysym.C-equal: font-size:reset URxvt.inputMethod: fcitx URxvt.preeditType: OverTheSpot,None URxvt.url-launcher: /usr/bin/xdg-open URxvt.matcher.button: 1 ! color #include "~/.Xresources.d/felix"
~/.Xresources for xtermxterm*termName: xterm-256color
xterm*locale: true
xterm*selectToClipboard: true
xterm*saveLines: 4096
xterm*faceName: Inconsolata for Powerline:style=Book:antialias=true
xterm*faceNameDoublesize:MigMix 2M:antialias=true
xterm*faceSize: 12
xterm*faceSize1: 6
xterm*faceSize2: 8
xterm*faceSize3: 10
xterm*faceSize4: 14
xterm*faceSize5: 18
xterm*faceSize6: 24
xterm*highlightSelection: true
xterm*trimSelection: true
xterm*VT100.Translations: #override \
Shift <KeyPress> Insert: insert-selection(CLIPBOARD) \n\
Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\
Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\
Ctrl <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY)
!----------------------------------------------
xterm*boldColors: true
xterm*scaleHeight: 1.1
ファイルマネージャを CLI へ
- コンソールで使えるファイラーになる。
- vifm と ranger のふたつ。ranger を新たに使うようになる。
~/.config/ranger/rc.conf デフォからの変更は以下のみset preview_images true set colorscheme jungle set draw_borders true set line_numbers true
~/.config/ranger/rifle.conf インストしてないプログラムについての記載は削除して メニューをシンプルにし、画像ファイルについて、少し追加。
# Image Viewing: mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@" mime ^image/svg, has display, X, flag f = display -- "$@" mime ^image, has pqiv, X, flag f = pqiv -- "$@" mime ^image, has stripimg640.sh , terminal = stripimg640.sh "$1" mime ^image, has stripimg800.sh , terminal = stripimg800.sh "$1" mime ^image, has stripimg1024.sh , terminal = stripimg1024.sh "$1" mime ^image, has shutter, X, flag f = shutter -- "$@" mime ^image, has gthumb, X, flag f = gthumb -- "$@" mime ^image, has gimp, X, flag f = gimp -- "$@" ext xcf, X, flag f = gimp -- "$@"
~/.config/ranger/scope.shインストしてないプログラムについての記載は削除して 余分な負荷を減らす。ハイライトが不要なテキストは、単純なプレビューにする。
case "$extension" に 追加
txt|org|org_archive|md|mkd|rst|rest|config)
try lv "$path" && { dump | trim; exit 5; } || exit 1;;
ネットドライブのマウントを変更
- QNAPに CloudDriveSync を設定し、外部Cloudと同期し、これをT510にマウント
- マウントは、gvfs-mount smb://hogehoge... から、 fstab で cifs としてマウント。
- 外部クラウドのマウントをNASに委ね、DropBox と Google-Drive の専用設定を削除。
- 100Mほど開放。
メイラー、カレンダーはicedoveのまま
- これに変わるCLIが揃ってない。
- googleカレンダーが困った。
- Thunderbird に返り咲いた。
その他アプリを軽量なものに変更、は無理
- viking、shutter、JavawaRTWtool、JOSMとかに代替えがない
- 日本語入力を、例えば skk だけにするのは無理
- mpd + mpdクライアント はゆずれない。クライアントに大きな差はない
不要なデーモン
- やってない。素人には無理っぽい。
ゆっくりと育てれば、それで良し。
- T510での省メモリ化 (1) 軽量ブラウザはどう?
- T510での省メモリ化 (2) I3 WM を試す
- T510での省メモリ化 (3) URxvtとか
- T510での省メモリ化 (4) i3 WM を少し便利に (20170714更新)
- T510での省メモリ化 (5) QNAPへ一部移管で終了
- T510での省メモリ化 (20170320でのまとめ)
- T510での省メモリ化 (20170529追加設定) i3 WM と ranger
- 軽量ブラウザ luakit をサブで使う(20170804追加)
- khal + vdirsyncer + (Yahooカレンダー & owncloud)
- T510での省メモリ化 (20170621) i3bar など
- T510での省メモリ化 (20170624) i3 WM 10個を越える WS、compton の追加。
0 件のコメント:
コメントを投稿