大家好,我是 JackTian。
還記得前不久給大家推薦的《一款霸榜 GitHub 的開源 linux 資源監(jiān)視器!—— bashtop》嗎?它是一個(gè)用 Bash 編寫的 Linux 資源監(jiān)視器。
昨天剛好閑逛 GitHub,發(fā)現(xiàn)這個(gè)作者又開源了一款基于 Python 語言的 Linux / OSX / FreeBSD 資源監(jiān)視器 —— bpytop,其主要作用跟之前的 bashtop 大同小異,用于顯示處理器,內(nèi)存,磁盤,網(wǎng)絡(luò)和進(jìn)程的使用情況和狀態(tài)。
首先我們先來看看 bpytop 資源監(jiān)視器主界面。
特征
- 易使用,帶有游戲啟發(fā)的菜單系統(tǒng);
- 完全支持鼠標(biāo),所有帶有突出顯示鍵的按鈕均可單擊,并且鼠標(biāo)滾動(dòng)可在進(jìn)程列表和菜單框中使用;
- 快速反應(yīng)靈敏的 UI,帶有 UP,DOWN 鍵可自行過程選擇;
- 用于顯示所選進(jìn)程的詳細(xì)統(tǒng)計(jì)信息的功能;
- 具有過濾過程的能力,可輸入多個(gè)過濾器;
- 在排序選項(xiàng)之間輕松切換;
- 將 SIGTERM,SIGKILL,SIGINT 發(fā)送到選定的進(jìn)程;
- 用于更改所有配置文件選項(xiàng)的 UI 菜單;
- 網(wǎng)絡(luò)使用情況的自動(dòng)縮放圖;
- 如有新版本可用,可在菜單選項(xiàng)中進(jìn)行顯示;
- 顯示磁盤的當(dāng)前讀寫速度;
Bpytop 使用與 bashtop 相同的主題文件,因此為 bashtop 制作的任何主題都可以使用。
可根據(jù)自己的需求修改及設(shè)置 Main 配色,在自定義設(shè)置主題時(shí),重新生成一個(gè)名為.theme的主題文件并設(shè)置默認(rèn)變量賦值。
#Bashtop theme with default colors and black background
......
# Main background, empty for terminal default, need to be empty if you want transparent background
theme[main_bg]="#00"
# Main text color
theme[main_fg]="#cc"
# Title color for boxes
theme[title]="#ee"
# Higlight color for keyboard shortcuts
theme[hi_fg]="#90"
# Background color of selected item in processes box
theme[selected_bg]="#7e2626"
# Foreground color of selected item in processes box
theme[selected_fg]="#ee"
# Color of inactive/disabled text
theme[inactive_fg]="#40"
# Misc colors for processes box including mini cpu graphs, details memory graph and details status text
theme[proc_misc]="#0de756"
# Cpu box outline color
theme[cpu_box]="#3d7b46"
# Memory/disks box outline color
theme[mem_box]="#8a882e"
# Net up/down box outline color
theme[net_box]="#423ba5"
# Processes box outline color
theme[proc_box]="#923535"
# Box divider line and small boxes line color
theme[div_line]="#30"
# Temperature graph colors
theme[temp_start]="#4897d4"
theme[temp_mid]="#5474e8"
theme[temp_end]="#ff40b6"
# CPU graph colors
theme[cpu_start]="#50f095"
theme[cpu_mid]="#f2e266"
theme[cpu_end]="#fa1e1e"
# Mem/Disk free meter
theme[free_start]="#223014"
theme[free_mid]="#b5e685"
theme[free_end]="#dcff85"
# Mem/Disk cached meter
theme[cached_start]="#0b1a29"
theme[cached_mid]="#74e6fc"
theme[cached_end]="#26c5ff"
# Mem/Disk available meter
theme[available_start]="#292107"
theme[available_mid]="#ffd77a"
theme[available_end]="#ffb814"
# Mem/Disk used meter
theme[used_start]="#3b1f1c"
theme[used_mid]="#d9626d"
theme[used_end]="#ff4769"
# Download graph colors
theme[download_start]="#231a63"
theme[download_mid]="#4f43a3"
theme[download_end]="#b0a9de"
# Upload graph colors
theme[upload_start]="#510554"
theme[upload_mid]="#7d4180"
theme[upload_end]="#dcafde"
更多的主題配色,可通過 Bpytop 項(xiàng)目中的 themes 文件夾查看。
安裝
依賴項(xiàng)安裝 Linux,使用 python3 和 git 安裝
安裝 psutil python 模塊(可能需要sudo)
# python3 -m pip install psutil
依賴項(xiàng)安裝 OSX,用于顯示 CPU 溫度。
# brew install osx-cpu-temp
手動(dòng)安裝 Linux,OSX 和 FreeBSD
# git clone https://github.com/aristocratos/bpytop.git
# cd bpytop
# sudo make install
命令行選項(xiàng)
USAGE: bpytop [argument]
Arguments:
-m, --mini Start in minimal mode without memory and net boxes // 最小模式下啟動(dòng)
-v, --version Show version info and exit // 顯示版本信息并退出
-h, --help Show this help message and exit // 顯示此幫助信息并退出
--debug Start with loglevel set to DEBUG overriding value set in config
由此看來目前 bpytop 還處于開發(fā)階段,接下來,還有很多要去做新功能:
最后貼下該項(xiàng)目 GitHub 地址,大家感興趣的可前去圍觀:
https://github.com/aristocratos/bpytop






