리눅스

WSL 2를 위한 Windows Terminal에 ubuntu 테마 적용

머리올리자 2021. 1. 2. 20:45

Windows Terminal에서 설정 클릭

 

Settings.json 파일이 실행됨 

아래 스크롤 해보면 schemes 부분이 있음

Profiles 위에 theme 부분을 추가하고

 name이 ubuntu-20.04 부분에 아래 내용을 추가하고

scheme 부분에 아래 내용을 추가하고 저장하면 자동으로 변경됩니다.

 

변경 후 전체 Settings.json 코드는 아래와 같습니다.

// This file was initially generated by Windows Terminal 1.4.3243.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
  "$schema": "https://aka.ms/terminal-profiles-schema",

  "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",

  // You can add more global application settings here.
  // To learn more about global settings, visit https://aka.ms/terminal-global-settings

  // If enabled, selections are automatically copied to your clipboard.
  "copyOnSelect": false,

  // If enabled, formatted data is also copied to your clipboard
  "copyFormatting": false,

  // A profile specifies a command to execute paired with information about how it should look and feel.
  // Each one of them will appear in the 'New Tab' dropdown,
  //   and can be invoked from the commandline with `wt.exe -p xxx`
  // To learn more about profiles, visit https://aka.ms/terminal-profile-settings
  "theme" : "dark",
  "profiles": {
    "defaults": {
      // Put settings here that you want to apply to all profiles.
    },
    "list": [
      {
        // Make changes here to the powershell.exe profile.
        "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
        "name": "Windows PowerShell",
        "commandline": "powershell.exe",
        "hidden": false
      },
      {
        // Make changes here to the cmd.exe profile.
        "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "name": "Command Prompt",
        "commandline": "cmd.exe",
        "hidden": false
      },
      {
        "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
        "hidden": false,
        "name": "Ubuntu-20.04",
        "source": "Windows.Terminal.Wsl",
        "colorScheme": "Raspberry",
        "cursorColor": "#FFFFFF",
        "fontFace": "Cascadia Code",
        "padding": "5, 5, 5, 5",
        "suppressApplicationTitle": true,
        "tabTitle": "Ubuntu"
      },
      {
        "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
        "hidden": false,
        "name": "Azure Cloud Shell",
        "source": "Windows.Terminal.Azure"
      }
    ]
  },

  // Add custom color schemes to this array.
  // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
  "schemes": [
    {
      "name": "Raspberry",
      "background": "#3C0315",
      "black": "#282A2E",
      "blue": "#0170C5",
      "brightBlack": "#676E7A",
      "brightBlue": "#80c8ff",
      "brightCyan": "#8ABEB7",
      "brightGreen": "#B5D680",
      "brightPurple": "#AC79BB",
      "brightRed": "#BD6D85",
      "brightWhite": "#FFFFFD",
      "brightYellow": "#FFFD76",
      "cyan": "#3F8D83",
      "foreground": "#FFFFFD",
      "green": "#76AB23",
      "purple": "#7D498F",
      "red": "#BD0940",
      "white": "#FFFFFD",
      "yellow": "#E0DE48"
    }
  ],

  // Add custom actions and keybindings to this array.
  // To unbind a key combination from your defaults.json, set the command to "unbound".
  // To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
  "actions": [
    // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
    // These two lines additionally bind them to Ctrl+C and Ctrl+V.
    // To learn more about selection, visit https://aka.ms/terminal-selection
    {
      "command": {
        "action": "copy",
        "singleLine": false
      },
      "keys": "ctrl+c"
    },
    {
      "command": "paste",
      "keys": "ctrl+v"
    },

    // Press Ctrl+Shift+F to open the search box
    {
      "command": "find",
      "keys": "ctrl+shift+f"
    },

    // Press Alt+Shift+D to open a new pane.
    // - "split": "auto" makes this pane open in the direction that provides the most surface area.
    // - "splitMode": "duplicate" makes the new pane use the focused pane's profile.
    // To learn more about panes, visit https://aka.ms/terminal-panes
    {
      "command": {
        "action": "splitPane",
        "split": "auto",
        "splitMode": "duplicate"
      },
      "keys": "alt+shift+d"
    }
  ]
}

그런데 배경이 정말 우분투 터미널 배경이 아닌 것 같아서 찾아보니 RGB 값이 각각 (48, 10, 36) 라고 한다

codeyarns.com/tech/2013-01-21-default-background-color-of-terminal-in-ubuntu.html

 

Code Yarns – Default background color of Terminal in Ubuntu

Default background color of Terminal in Ubuntu 📅 2013-Jan-21 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ background, color, terminal, ubuntu ⬩ 📚 Archive Ubuntu uses a soothing purple color as the background for Terminal. You might wish to use this color

codeyarns.com

따라서 아래 사이트를 이용해서 RGB -> Hex 로 만들고

www.rgbtohex.net/

 

RGB to HEX

Join to access discussion forums and premium features of the site.

www.rgbtohex.net

schemes의 background에 기존 #3C0315를 #300A24로 변경해서 저장해보니 아래와 같이 비슷하게 나오는 것을 확인할 수 있다.

 

참고

 

docs.microsoft.com/ko-kr/windows/terminal/custom-terminal-gallery/raspberry-ubuntu

 

Windows Terminal Raspberry Ubuntu 구성

Raspberry Ubuntu의 테마입니다.

docs.microsoft.com