黃昕暐
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
      • Create new note
      • Create a note from template
        • Sharing URL Link copied
        • /edit
        • View mode
          • Edit mode
          • View mode
          • Book mode
          • Slide mode
          Edit mode View mode Book mode Slide mode
        • Customize slides
        • Note Permission
        • Read
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Write
          • Only me
          • Signed-in users
          • Everyone
          Only me Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

        Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

        Your note will be visible on your profile and discoverable by anyone.
        Your note is now live.
        This note is visible on your profile and discoverable online.
        Everyone on the web can find and read all notes of this public team.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        See published notes
        Unpublish note
        Please check the box to agree to the Community Guidelines.
        View profile
      • Commenting
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Suggest edit
        Permission
        Disabled Forbidden Owners Signed-in users Everyone
      • Enable
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
      • Emoji Reply
      • Enable
      • Versions and GitHub Sync
      • Note settings
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Save as template
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Engagement control Make a copy Transfer ownership Delete this note
    Import from
    Dropbox Google Drive Gist Clipboard
    Export to
    Dropbox Google Drive Gist
    Download
    Markdown HTML Raw HTML
    Back
    Sharing URL Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Customize slides
    Note Permission
    Read
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: Linux, 測試報告 robots: Debian, XFCE, Linux lang: zh-tw --- # 從 Debian XFCE 版本改造一個美麗的工作環境 [TOC] 本文件主要參考 [How to make debian 10 xfce nice and usable for a new user](https://www.youtube.com/watch?v=5-_iw7k5iaw) 再加上個人的偏好設計, 最終結果畫面如下: ![](https://i.imgur.com/fKmTAyZ.jpg) ![](https://i.imgur.com/v00SnqV.png) ## 安裝基本系統 下載 [Debian XFCE non-free 版本映像檔](https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/), Debian 的映像檔很找, 可直接用上面的連結。下載後請直接安裝好系統。 :::success 安裝後第一次開機好像會有登入錯誤的狀況, 再重開一次就可以了。 ::: ## 設定 Wi-Fi Debian 系統剛裝好時有些 Wi-Fi 網卡 (例如我用過得 Tenda W311U+) 無法正常連上無線網路, 必須依照這篇[論壇文章](http://forums.debian.net/viewtopic.php?f=7&t=133597) 關閉使用隨機 MAC 位址的功能。請修改 /etc/NetworkManager/NetworkManager.conf 檔, 加入以下這行: ```bash [device] wifi.scan-rand-mac-address=no ``` 存檔後重新啟動網路管理員: ```bash sudo service network-manager restart ``` 即可正常連接無線網路了。 :::info 以下步驟會需要用到 curl 與 git, 建議可以先安裝好: ```bash sudo apt install git curl ``` ::: ## 安裝字型 寫程式或是在終端機內下指令都需要一個好看的等寬字型, 建議可以到 [NerdFont](https://www.nerdfonts.com/font-downloads) 下載喜好的字型, 我自己喜歡 [JetBrainsMONO](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/JetBrainsMono.zip), 下載後請將自行檔案解開, 以下假設解開到你的家目錄下: ```bash sudo mv ~/*.ttf /usr/share/fonts fc-cache -f ``` 即可立即使用新的字型。 ## 安裝 fish shell 我習慣使用 [fish shell](https://fishshell.com/), 可以有許多方便的功能, 像是按 `tab` 可以出現指令的選項或是資料夾清單讓您選用等等: ```bash sudo apt install fish ``` 安裝好後可以將 fish 設定為預設的 shell: ```bash chsh -s /usr/bin/fish ``` 這個設定需要重新登入才會生效。 ### 安裝外掛 fish 有許多好用的外掛, 我通常會安裝 [oh my fish](https://github.com/oh-my-fish/oh-my-fish), 最簡單的安裝方法是透過 curl: ```bash curl -L https://get.oh-my.fish | fish ``` 安裝好後 shell 的提示符號就為變成如下的魚骨頭以及簡短的路徑表示法: ![](https://i.imgur.com/P36BmWf.png) 你還可以安裝不同的提示符號樣式, 我自己會裝這幾個: ```bash omf install batman agnorster ``` 安裝好即可使用以下指令切換樣式: ```bash omf theme batman ``` 蝙蝠俠樣式會用 ^^ 表示家目錄: ![](https://i.imgur.com/hwqQ5RZ.png) ```bash omf theme agnoster ``` agnorter 樣式會有很有型的箭頭顯示提示符號: ![](https://i.imgur.com/5BHeHm7.png) 如果發現提示符號怪怪的, 就是字型沒有支援一些特殊符號, 請參考[安裝字型](https://hackmd.io/8D5ok2h1RlKUsEpsfOu-rQ#%E5%AE%89%E8%A3%9D%E5%AD%97%E5%9E%8B)。 ### 調整指令列顏色 終端機的整體顏色可由終端機軟體的設定偏好更改, 但是 shell 指令列的顏色卻是由 shell 設定, 如果你看上面的圖, 會發現指令列大的字是暗藍色, 不易閱讀, 這可以透過修改 ~/.config/fish/fish_variables 檔達成: ``` SETUVAR fish_color_autosuggestion:555\x1ebrblack SETUVAR fish_color_cancel:\x2dr SETUVAR fish_color_command:ffffff .... ``` 就可以把指令列的顏色改為白色了: ![白色的指令列](https://imgur.com/IMRMh9wl.png) :::info 由於 fish 與 bash 的語法有差異, 如果想要共用 .profile 中的設定, 可以先安裝 bass 外掛, 它可以協助讓你在 fish 中執行 bash 指令: ```bash omf install bass ``` 然後建立 .comfig/fish/config.fish 檔, 在檔案中加入以下這行: ```bash bass . ~/.profile ``` 這樣 config.fish 檔就會幫你執行 .pofile 的內容。如果有一些環境變數需要設定, 就可以透過這種方式共用 .profile, 不用在 .profile 以及 config.fish 兩邊都寫入同樣的指令了。 ::: ## 調整外觀風格 將系統改成採用暗色系, 請從主功能表選取『**設定值/外觀/樣式**』: ![](https://i.imgur.com/KSK716A.png) 選用 **Adwaita-暗色系**。 ### 調整圖示風格 安裝好看具有時代感的圖示, 請下載 [Sardi](https://sourceforge.net/projects/sardi/) 圖示集, 下載之後解開進行安裝, 以下假設解開至`下載`: ```bash sudo mv ~/下載/* /usr/share/icons ``` :::info 你也可以複製到 ~/.local/share/icons, 只是這樣別的使用者就無法使用這些圖示集。 ::: 安裝好後就可以透過『**設定值/外觀/圖示**』選用喜歡的圖示集了: ![](https://i.imgur.com/QRs6YTv.png) 我自己選用了 **SardiFlat**。 ### 調整視窗外觀 修改視窗外觀, XFCE 預設的樣式太老派, 這裡我們安裝一個不同的視窗管理程式, 展現扁平風格的視窗: ```bash sudo apt install numix-gtk-theme ``` 安裝好即可透過『**設定值/視窗管理程式/風格**』選用: ![](https://i.imgur.com/rvN8W1O.png) 到這裡視窗外觀就會如上圖。 ### 修改工作列: 1. 預設有兩個工作列, 請透過『**設定值/面板**』先把面板 2 移除。 1. 在面板 1 個的項目中, 移除起動器和應用程式選單, 加入 Whisler ![](https://i.imgur.com/RBAApto.png) 把這項目移到工作列最左邊當成類似 Windows 的開始鈕。 1. 將面板 1 解除鎖定後移到螢幕底部。 1. 切換到**外觀**頁籤, 將**背景樣式**改為**填滿色彩**, 將 **Alpha** 調成自己喜歡的透明度, 呈現質感: ![](https://i.imgur.com/N6g0VDQ.png) 1. 更改桌面背景圖案, 請到 [unsplash](https://unsplash.com/t/wallpapers) 選用自己喜歡的圖片, 然後透過『**設定值/桌面/背景**』選用即可。 ## 安裝文字編輯器 ### geany 我通常會安裝 geany 編輯器, 這是精簡好用的文字編輯器: ```bash sudo apt install geany ``` 安裝好後可以幫它新增不同風格的語法顏色標示集, 可到 [Geany Theme] (https://www.geany.org/download/themes/) 下載喜愛的風格, 將下子的 .conf 檔複製到 /usr/share/geany/colorschemes/ 下, 就可以透過『**檢視/Change color scheme**』選用。 ### vim 如果可能的話, 建議也安裝 vim, 這個老牌的編輯器耗費資源少, 相當好用。 ```bash sudo apt install vim-gui-common ``` :::warning 請注意, 安裝時請不要安裝 vim, 而要選擇 vim-gui-common 或是 vim-gnome 等等, 這是因為 vim 套件安裝的 vim 並不支援 X-Window 的剪貼簿, 所以無法從 vim 裡面複製資料到系統的剪貼簿。另外, vim-gui-common 也會安裝 gvim 圖形化版本的 vim。 ::: #### 客製化狀態列 vim 雖然老, 但是也可以變得很漂亮, 請安裝 airline 外掛。首先安裝 Pathogan 外掛管理程式: ```bash mkdir -p ~/.vim/autoload ~/.vim/bundle && \ curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim ``` 編輯 .vimrc 啟動外掛: ``` execute pathogen#infect() syntax on filetype plugin indent on ``` 最後安裝 airline 外掛: ``` git clone https://github.com/vim-airline/vim-airline ~/.vim/bundle/vim-airline ``` 重新執行 vim 後, 就會有一個亮麗的狀態列: ![](https://i.imgur.com/03PM8kX.png) 接著執行以下指令更新說明: ``` Helptags ``` 即可使用 `:help airline` 指令查閱說明。 #### 設定 vim 顏色配置 gvim 的顏色配置放在 .vim/colors 裡, 可以到[官方的配色區](https://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search)下載喜愛的主題。配色可在 .vimrc 檔案中設定: ``` syntax on colorscheme molokai ``` 重新執行 vim 就可以看到顏色配置了: ![](https://i.imgur.com/lssro5l.png) :::info vim 的設定都會被 gvim 沿用, 有需要針對 gvim 的設定可以寫在 .gvimrc 中。 ::: #### 設定 gvim 字體 gvim 的字體可以在 .gvimrc 中設定: ``` set guifont=JetBrainsMono\ Nerd\ Font\ Mono\ 12 ``` ![](https://i.imgur.com/LurVt2j.png) :::info 請特別留意設定時的反斜線, 漏掉反斜線會被當成錯誤。 ::: :::info 為了讓設定檔集中管理, 建議 vim 或是 gvim 的設定檔可以改用 .vim 下的 vimrc 和 gvimrc, 這樣所有跟 vim 相關的設定、外掛等就全部都在 .vim 資料夾下, 可以整個資料夾複製到其他的環境下使用。 ::: ## 設定自動登入 安裝時雖然有勾選自動登入, 但是安裝後好像沒有生效, 這必須修改登入程式 lightdm 的設定檔: ```bash sudo geany /usr/share/lightdm/lightdm.conf.d/01_debian.conf ``` 將要自動登入的帳號填入即可: ```conf [SeatDefaults] autologin-user=這裡填入使用者帳號 autologin-user-timeout=0 ``` 重新開機就會生效了。 ## 變更登入畫面的背景圖 現在還不夠帥的就是登入畫面了, 雖然我們已經自動登入了, 但如果按了登出、或是太久沒用, 就一樣會進入登入畫面, 看到的還是很醜的 XFCE 預設畫面, 這要修改登入畫面程式的設定。你可以透過設定工具選用喜愛的圖檔: ``` sudo lightdm-settings ``` Debian 預設並沒有安裝上述工具, 請自行安裝 lightdm-gtk-greeter-settings 後執行即可設定。 :::warning 這個圖檔必須讓 others 有讀取 (r) 的權限, 而且所在的路徑其資料夾也必須要讓其他人可讀取 (r) 與進入 (x), 否則 lightdm-greeter 無法讀取圖檔, 登入畫面就會變成黑屏。 ::: :::warning 這個登入畫面的背景圖檔其實是透過 /usr/share/lightdm/lightdm-gtk-greeter.conf.d/01_debian.conf 檔案設定: ```conf Debian specific defaults # [greeter] background=/usr/share/images/desktop-base/login-background.svg theme-name=Adwaita xft-antialias=true xft-hintstyle=hintfull xft-rgba=rgb ``` 不過這裡要注意的是, 如果 background 的設定值就是一個圖檔的話, 那你就可以直接更改設定值為你要用的圖檔路徑。 如果這個設定值其實是一個符號連結, 例如: ```bash ll /usr/share/images/desktop-base/login-background.svg lrwxrwxrwx 1 root root 42 2月 8 22:34 /usr/share/images/desktop-base/login-background.svg -> /etc/alternatives/desktop-login-background ``` 那就表示這是使用 [Debian Alternative System](https://wiki.debian.org/DebianAlternatives) 機制。這個機制是為了讓程式可以透過相同的路徑名稱存取可能會變動的檔案, 例如對登入程式來說, 它永遠都是顯示 /usr/share/images/desktop-base/login-background.svg 當成背景圖案, 但實際上這個路徑是符號連結, 真正連到的檔案是 /etc/alternatives/desktop-login-background, 不過這也是個符號連結: ```bash ll /etc/alternatives/desktop-login-background lrwxrwxrwx 1 root root 36 2月 29 21:49 /etc/alternatives/desktop-login-background -> /usr/share/desktop-base/active-theme/login/background.svg ``` 所以真正顯示的圖檔是 /usr/share/desktop-base/active-theme/login/background.svg。系統提供有 update-alternatives 可以幫你建置這樣的連結關係, 每一組這樣的連結關係都有一個群組名稱, 像是登入畫面的背景圖案的群組名稱就是 desktop-login-background, 也就是在 /etc/alternatives 下的連結檔名。假設我要更換背景圖為 /usr/share/backgrounds/1920x1080.png, 就可以下達這樣的指令: ```bash sudo update-alternatives --install /usr/share/images/desktop-base/login-background.svg desktop-login-background /usr/share/backgrounds/1920x1080.png 120 ``` 這表示要新增一筆從 /usr/share/images/desktop-base/login-background.svg 連結到 /etc/alternatives/desktop-login-background 再連結到 desktop-login-background /usr/share/backgrounds/1920x1080.png 的可能選項, 最後的 120 是權重值, 如果權重值高於之前新增的選項, 就會自動變成預設的連結檔案。你也可以隨時透過指令選擇實際要連結的是那一個選項: ![](https://i.imgur.com/Sj0yIpu.png) 你可以看到之前總共新增過 10 個選項, 並依照權重值排序, 你可以輸入序號選用特定的選項。 ![](https://i.imgur.com/AhromBO.jpg) ::: ## 中文輸入法 Debian 預設會安裝 fcitx 輸入法套件, 但是 fcitx 的新酷音不知道為什麼在按下 cap lock 進入英文模式後, 按 `,` 還是會按出 `ㄝ`, 所以只好再裝 ibus 輸入法套件: ```bash sudo apt install ibus-ibus-chewing ``` 裝好之後就可以使用 im-config 選用, 重新登入即可。 :::warning 不過 ibus 的新酷音在輸入過程中要選候選字時, 游標不會左右移動, 一直都是在目前已輸入的尾端, 常常會讓我判斷錯誤, 也是一大困擾, 但至少整體使用方式和我在 Windows 下的自然輸入法幾乎相同。 :::

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully