メインコンテンツへスキップ

EndeavourOS(i3wm)を始めました。

    経緯

    いまさらですがローカルのLLMとかの勉強をしないといけないと思い、学生時代以来のLinux Desktopを使用することにしました。
    候補になったのは以下の4つのディストリビューション。

    1. Ubuntu

    2. Pop!_OS

    3. Manajero Linux (gnome)

    4. MX Linux

    とりあえず、細かい設定をせずに入れてすぐ使える物がいいなと思いPop!_OSを試していたのですが、タイル型ウィンドウマネージャー(風)の挙動がすごくよかったので、勉強のためのLinuxからメインOSにまで昇格していました。

    ただ、細かいウィンドウの挙動とかが気になったので
    (Windowsの並び方とか、スタックの切り替えなど)本格的なタイル型ウインドウマネージャーに移行することに決めました。

    タイル型ウィンドウマネージャはいろいろありそうなのですが、とりあえず情報の多そうな以下の2つを候補に絞りました。

    • i3wm

    • sway

    細かい違いは多々とあるようなのですが大きな違いとしてWaylandで動くか、X11で動くかの違いみたいなのでとりあえず新しいManjaro Linux Swayをインストールしようとしてみたのですが。。。

    LiveUSBからプロプラエタリドライバー版で起動できず

    よくよく調べてみるとWayland自体が、nVidiaのドライバー環境では不安定との情報があったのでX11で動くi3wmを使うことにしました。

    どうせここまでするんだったら勉強がてら、より軽量そうなEndeavourOSを使ってみようということで早速インストール。

    インストール自体はかなり簡単で、Arch Linuxのインストール時に投げ出しそうになったパーティションもボタンぽちぽちだけで完了。 

    初期設定

    1.とりあえずシステムのアップデート

    sudo pacman -Syyu

    2. 日本語入力環境の設定

    sudo pacman -S fcitx5 fcitx5-mozc fcitx5-im fcitx5-configtool

    vimが入ってなかったので、Neovimを入れて環境変数を修正

    sudo pacman -S neovim
    nvim ~./.xprofile

    以下を追加して保存。

    #!/bin/bash
    
    export GTK_IM_MODULE=fcitx
    export QT_IM_MODULE=fcitx
    export XMODIFIERS=@im=fcitx
    fcitx5 &

    再起動して、Fcitx5が起動することを確認。
    おそらくCntl + Spaceで切り替えが可能。

    3. caps lockキーとEscのキーの入れ替え

    普段からcapsとescを入れ替えており設定が入ってないとvimの操作すらおぼつかないため、このタイミングでキーバインドを修正。

    nvim ~./.xprofile
    #!/bin/bash
    
    setxkbmap -option caps:swapescape #この行を追加
    
    export GTK_IM_MODULE=fcitx
    export QT_IM_MODULE=fcitx
    export XMODIFIERS=@im=fcitx
    fcitx5 &

    4. Flatpakのインストール

    アプリケーションはFlatpakのサンドボックス上で動かしたい欲があるため、Flatpakをインストー ル

    sudo pacman -S flatpak

    5. flatpakでブラウザをインストール

    自分はFirefoxとVivaldiとChromeを使い分けているので3つともインストールする
    その前にデフォルトでインストールされているfirefoxを削除

    sudo pacman -Rs firefox firefox-i18n-ja

    FlatpakでFirefox Vivaldi Chromeをインストール

    flatpak install org.mozilla.firefox com.google.Chrome com.vivaldi.Vivaldi

    Rofiに表示されなかったけど、再起動で表示される。
    なんでだろう。

    6. /i3/config を自分用に修正

    cp .config/i3/config .config/i3/config.sample
    nvim .config/i3/config

    マウスオーバーでフォーカスするウィンドウが変わるのが厄介なので以下を修正

    # なければ追加
    focus_follows_mouse no

    現在表示している画面にウィンドウを表示してほしいので以下を全部削除 (コメントアウト)

    # bind program to workspace and focus to them on startup:
    # assign [class="Xfce4-terminal"] $ws1
    # assign [class="(?i)firefox"] $ws2
    # assign [class="Thunar"] $ws3
    # assign [class="thunderbird"] $ws4
    # assign [class="TelegramDesktop"] $ws5
    
    # automatic set focus new window if it opens on another workspace than the current:
    # for_window [class=Xfce4-terminal] focus
    # for_window [class=(?i)firefox] focus
    # for_window [class=Thunar] focus
    # for_window [class=Thunderbird] focus
    # for_window [class=TelegramDesktop] focus
    

    合わせて仮想ディスプレイのアイコンを削除

    # Define names for default workspaces for which we configure key bindings later on.
    # We use variables to avoid repeating the names in multiple places.
    set $ws1 "1"
    set $ws2 "2"
    set $ws3 "3"
    set $ws4 "4"
    set $ws5 "5"
    set $ws6 "6"
    set $ws7 "7"
    set $ws8 "8"
    set $ws9 "9"
    set $ws10 "10"

    フォーカスの移動をmod + h,j,k,lに変更

    # change focus
    bindsym $mod+h focus left
    bindsym $mod+j focus down
    bindsym $mod+k focus up
    bindsym $mod+l focus right
    
    # move focused window
    bindsym $mod+Shift+h move left
    bindsym $mod+Shift+j move down
    bindsym $mod+Shift+k move up
    bindsym $mod+Shift+l move right
    

    以下のコマンドが重複していると思われるので適当なキーに変更

    # split in horizontal orientation
    #bindsym $mod+h split h
    bindsym $mod+b split h
    
    # bindsym $mod+l exec --no-startup-id ~/.config/i3/scripts/blur-lock
    bindsym $mod+conmma exec --no-startup-id ~/.config/i3/scripts/blur-lock

    スタートアップ時に立ち上がるEndeavourosのページを立ち上がらないようにコメントアウト

    # Autostart apps as you like
    # exec --no-startup-id sleep 2 && xfce4-terminal
    # exec --no-startup-id sleep 7 && firefox https://github.com/endeavouros-team/endeavouros-i3wm-setup/blob/main/force-knowledge.md
    

    アプリケーションショートカットをすべて削除 
    スクリーンショットはFlameshotをどっかで設定する。

    ## App shortcuts
    # bindsym $mod+w exec --no-startup-id /usr/bin/firefox
    # bindsym $mod+n exec --no-startup-id /usr/bin/thunar
    # bindsym Print exec --no-startup-id scrot ~/%Y-%m-%d-%T-screenshot.png && notify-send "Screenshot saved to ~/$(date +"%Y-%m-%d-%T")-screenshot.png"
    

     一旦はこれで簡単には動くはず。

    Barの設定やキーボード設定はまだ納得行っていない部分もあるのでのちのち記載します。


     
     

    燕子

     
     
    システムエンジニア / 停滞中 停滞を乗り越えるをためアウトプット

    あなたへのおすすめ