Skip to content

kuni3933/WindowsTerminalSettings

Repository files navigation

WindowsTerminalSettings

  • tadashi-aikawa/owl-playbook: Playbook both Linux and Windows for me
  • sheepla/dotfiles
  • をベースに個人的に改造したもの

    1.以下からMicrosoft.DesktopAppInstaller(winget)・フォントをインストール

    2.wingetでGit,pwsh,Windows Terminal Preview(WTP)のインストール・本リポジトリの配置

    Windows Powershell (admin New Session)

    winget install -e --id Git.Git --source winget
    winget install -e --id Microsoft.PowerShell --source winget
    winget install -e --id Microsoft.WindowsTerminal.Preview --source winget

    pwsh (admin New Session)

    cd $env:USERPROFILE
    git clone https://github.com/kuni3933/WindowsTerminalSettings --recursive

    3.パス設定

    Gitがインストールされたフォルダを、システム環境変数:GIT_INSTALL_ROOT として登録

    1. まずは以下のコマンドを実行してgit.exeの位置を確認.
      pwsh (admin New Session)

      cmd /c where git
    2. 出力された位置の2階層上に位置するGitフォルダを環境変数GIT_INSTALL_ROOTとして登録する.
      C:\Program Files\Git\cmd\git.exeと出力されたら以下の設定
      システム環境変数名:GIT_INSTALL_ROOT
      システム環境変数値:C:\Program Files\Git

    4.依存packageインストール

    pwsh (admin New Session)

    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
    cd $env:USERPROFILE/WindowsTerminalSettings
    windows/install.ps1
    ディレクトリ 概要
    1.PSGallery PSGalleryでインストールするもの
    2.winget wingetでインストールするもの
    3.scoop scoopでインストールするもの
    4.Chocolatey chocolateyでインストールするもの
    5.volta/npm volta/npmでインストールするもの
    6.go goでインストールするもの
    7.cargo rust/cargoでインストールするもの

    初インストールの場合は、install.ps1を実行後

    • Keypirinha
    • VScode
    • pwsh
    を一回起動して閉じたあとに再度windows/install.ps1を実行.

    5.windows/provision.batをコマンドラインから管理者権限で実行

    pwsh (admin New Session)

    cd $env:USERPROFILE/WindowsTerminalSettings
    sudo windows/provision.bat

    WSL2の手順

    本家Tadashi Aikawa氏の資料を要参照

    WSL2でつくる快適なUbuntu環境を実行していく

    1. 以下のコマンドでWSLを有効にする
      pwsh (admin New Session)

      sudo dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    2. VMを有効にする
      pwsh (admin New Session)

      sudo dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    3. x64 マシン用 WSL2 Linux カーネル更新プログラム パッケージから更新プログラムをダウンロードして実行
      参考 - 手順 4 - Linux カーネル更新プログラム パッケージをダウンロードする

    4. pwsh (admin New Session)

      sudo wsl --set-default-version 2

    Archの手順

    1. Setupo DistroD & Install Any Distribution
      nullpo-head/wsl-distrod

    2. Setup root password
      pwsh (admin New Session)

      sudo su -
      passwd
    3. User Add wheel group
      pwsh

      gpasswd -a {username} wheel

      ※{username} = UserName※

    4. 鍵の初期化
      pwsh

      pacman-key --init
    5. 鍵の更新
      pwsh

      pacman-key --populate archlinux
      pacman -Syy archlinux-keyring
    6. パッケージの更新・必要なPackageのインストール
      pwsh

      sudo pacman -Syyu --needed aria2 autoconf automake  base base-devel curl git gnupg make neovim ntp openssh sudo vi vim wget
    7. /etc/sudoersを編集してwheel ユーザグループに sudo 権限を付与する。
      pwsh

      nano /etc/sudoers

      キーバインド:M = meta key = Alt
      以下の行を探してアンコメント
      %wheel ALL=(ALL) ALL

    8. close nano
      以下のコマンドでnanoを閉じて保存終了
      ctrl + x
      y
      ENTER
      exit

    9. mirrorlstの確認と設定
      pwsh

      vim /etc/pacman.d/mirrorlist

      必要ならこちらも設定

    10. Setup wsl.conf with powershell
      pwsh (admin New Session)

      cd $env:USERPROFILE/WindowsTerminalSettings/windows/Distrod
      .\Distrod_provision.ps1
    11. setup
      WindowsTerminaからArch実行
      bash (Distrod)

      git clone [email protected]:kuni3933/WindowsTerminalSettings.git --recursive
      cd ~/WindowsTerminalSettings/mnt/linux/Arch
      ./setup.sh
    12. setup .bashrc
      必要な部分はマージしつつ起動直後の内容等は削除して$HOMEの.bashrcには
      . ~/.bashrc.org
      export PATH=$PATH:'/mnt/c/Users/{Windows_username}/AppData/Local/Programs/Microsoft VS Code/bin'
      のみが記述されている状態にする
      ({Windows_username} = Windows UserName)

    以下参考

    About

    My Windows dotfiles;

    Resources

    License

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published