#temanote

エンジニア、SREです

Xmonadからi3へ移行した

タイル型といえばXmonadと思って使い続けてたけど、haskellわからないのであまり利点を活かしきれないのと、wayland移行を考えて後継が無いのでXmonadからi3(i3-gaps)へ移行しました

OS: ArchLinux
元環境: Xmonad / xmobar
新環境: i3-gaps(aur) / i3-status

移行手順

  • とりあえずi3を起動する
  • 手癖で操作してみて動かないものを設定して回る
  • 見た目気に入らない場所を直していく

見るドキュメントはもちろんi3 user's guide

i3wm.org

見るのは主に4. Configuring i36. List of commands

各設定メモ

👆がXmonad、👇がi3

レイアウト
内蔵レイアウトはあんまり強くなさそうなので、autotilingを起動させたらそれっぽくなったのでおまかせした

myLayout = onWorkspace "6" simplestFloat $
           toggleLayouts ( noBorders Full ) $
           gaps [(U,8), (D,8), (L,8), (R,8)] $
           spacing 3 $
           bsp ||| tall ||| grid
           where bsp  = emptyBSP
                 tall = ResizableTall 1 (2/50) (2/3) []
                 grid = Grid


# https://github.com/nwg-piotr/autotiling
# bsp tiling
exec_always --no-startup-id ~/.anyenv/envs/pyenv/shims/autotiling
# i3-gaps
gaps inner 10

ウィンドウ操作類
ワークスペース移動

((modm, xK_h), prevWS )
((modm, xK_l), nextWS )
bindsym $mod+l workspace next
bindsym $mod+h workspace prev

ウィンドウのワークスペース間移動

((modm .|. shiftMask  , xK_h), shiftToPrev )
((modm .|. shiftMask  , xK_l), shiftToNext )
bindsym $mod+Shift+l move container to workspace next
bindsym $mod+Shift+h move container to workspace prev

ウィンドウサイズ変更

((modm .|. controlMask, xK_l), sendMessage $ ExpandTowards R )
((modm .|. controlMask, xK_h), sendMessage $ ShrinkFrom R )
((modm .|. controlMask, xK_j), sendMessage $ ExpandTowards D )
((modm .|. controlMask, xK_k), sendMessage $ ShrinkFrom D )
bindsym $mod+Ctrl+l resize grow right 30 px
bindsym $mod+Ctrl+h resize shrink right 30 px

ステータスバー
dozen2からi3内蔵status barに

barLeft <- spawnPipe $ "dzen2 -x 0 -w 700 -ta l " ++ dzen_opts
right <- spawnPipe $ "conky -c ~/.xmonad/conky/conky_config | dzen2 -x 700 -ta r " ++ dzen_opts

bar {
    font pango:monospace 10
    position top
    output primary
    status_command i3status --config ~/.config/i3/i3status.conf
}

アプリランチャー(rofi)

((modm, xK_p), spawn "rofi -show run" )
((modm, xK_e), spawn "rofi -show emoji" )
bindsym $mod+p exec --no-startup-id rofi -show run
bindsym $mod+e exec --no-startup-id rofi -show emoji

スクショ(import ~/tmp.pngをshell scriptにしてます)

((modm .|. controlMask, xK_4), spawn "/home/temama/.config/nukegara_scripts/ss.sh")
# マウス使うやつは--releaseをつけると良いらしい
bindsym --release $mod+o exec "~/.config/nukegara_scripts/ss.sh"

i3の設定からちょっとずれたもの

フォーカス外れたウィンドウが透過していたので透明度合いを調整したい
👉コンポジットマネージャーにpicomでした

# picom.conf
opacity-rule = [
  "100: focused",
  "90: !focused"
];

納得行ってない設定

  • mod+Ctrl+Spaceでフルスクリーンと切り替えたいのに出来てない、多分autotiling側
  • ウィンドウの横拡大縮小、フォーカス当たってるウィンドウの右端を移動させる設定なので一番右のウィンドウがアクティブなときは動かない(これはxmonadでも微妙な設定してた)
  • mod+Returnでフォーカス当たっているウィンドウを一番左上のウィンドウとswapするのが出来てない
  • 隣のworkspaceにウィンドウを飛ばすとき、先のworkspaceにもともとウィンドウが何かないとアクティブにならずに飛ばない(1から2に飛ばすとき、2にウィンドウがなかったら飛ばない)