顯示具有 Linux-Debian-Tools 工具 標籤的文章。 顯示所有文章
顯示具有 Linux-Debian-Tools 工具 標籤的文章。 顯示所有文章

2018年10月10日 星期三

Vim 打造成 Source Insight

環境: Debian
vim是套在Linux上非常好用的編輯軟體,但在trace code的能力上卻比不上source insight或eclipse等,但我們可以另外安裝套件,讓vim接近於source insight的使用方式,
以下使用了ctags + cscope + taglist + nerdtree + srcexpl + trinity來達成此目標


一、ctags
ctags可以在函式、變數之間自由進行切換,例如某主函式call了func(),ctags可以直接跳到func的函式裡面、也可使用在變數上 
◎ Install
sudo apt-get install exuberant-ctags
◎ Usage

進入程式目錄當中,若是多層的目錄則進到最上層的目錄,接著輸入 
ctags -R

接著必須讓vim知道tags需要到哪裡找到,先用vim打開vimrc,之後把下面第二段的資訊加進去

vim ~/.vimrc

set tags=./tags,./TAGS,tags;~,TAGS;~

用vim進到.c .h檔之後移到函式或變數上即可使用快捷鍵找到該函式或變數的定義,也可跳回到使用此函式的地方

"跳至該函式或變數定義
Ctrl + ]
"跳回使用此函式或變數處
Ctrl + t

二、cscope

cscope可以查詢函式或變數在哪些地方被使用過,或是函式當中使用了哪些函式

◎ Install

sudo apt-get install cscope

◎ Usage

進入程式目錄當中,若是多層的目錄則進到最上層的目錄,接著輸入

cscope -Rbqk

參數說明如下

1. R : 將目錄及子目錄底下的所有文件都建立索引
2. b : 僅建立關聯數據庫,不導入使用者介面
3. q : 建立cscope.in.out和cscope.po.out,可增快搜尋速度
4. k : 不搜尋預設會include進來的函式(/usr/include)

將以下設定加入vimrc

set cscopetag
set csto=0

if filereadable("cscope.out")
   cs add cscope.out   
elseif $CSCOPE_DB != ""
    cs add $CSCOPE_DB
endif
set cscopeverbose

nmap zs :cs find s =expand("")
nmap zg :cs find g =expand("")
nmap zc :cs find c =expand("")
nmap zt :cs find t =expand("")
nmap ze :cs find e =expand("")
nmap zf :cs find f =expand("")
nmap zi :cs find i ^=expand("")$
nmap zd :cs find d =expand("")

最後附上各指令的用途

1.:cs find s {name} : 找出C語言name的符號
2.:cs find g {name} : 找出name定義的地方
3.:cs find c {name} : 找出使用name的地方
4.:cs find t {name} : 找出name的字串
5.:cs find e {name} : 相當於egrep功能,但速度更佳
6.:cs find f {name} : 尋找檔案
7.:cs find i {name} : 尋找include此檔案的檔案
8.:cs find d {name} : 尋找name裡面使用到的函式

三、taglist

taglist可在切出一區塊,顯示此檔案裡的macro,global variable,函式等資訊,且會隨著瀏覽到哪個地方便以不同顏色標示

◎ Install

下載plugin file,下載地址如下,請自行選擇最新版本下載

http://sourceforge.net/projects/vim-taglist/files/vim-taglist

將plugin/taglist.vim複製到~/.vim/plugin/,doc/taglist.txt複製到~/.vim/doc

◎ Usage

可在~/.vimrc裡配置相關設定,其他配置選項請參考官網說明

nmap<F8>:TlistToggle
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
set ut=100

1.nmap : 將F8設為開啟taglist的快捷鍵
2.Tlist_Show_One_File : 只顯示當下瀏覽檔案的func,不顯示之前瀏覽的檔案
3.Tlist_Exit_OnlyWindow : 如果taglist區塊是最後一個,則退出vim
4.ut=100 : taglist會標示目前在操作哪個function or variable,但更新速度很慢,這裡把更新速度設成100ms

四、nerdtree

NERD tree可切出一區塊,顯示根目錄開始的檔案結構,且可由list直接跳到選取的檔

◎ Install

下載plugin file,下載地址如下,請自行選擇最新版本下載

http://www.vim.org/scripts/script.php?script_id=1658

將plugin/NERD_tree.vim複製到~/.vim/plugin/,doc/NERD_tree.txt複製到~/.vim/doc
剩下的資料夾autoload, lib, nerdtree_plugin, syntax全部複製到~/.vim底下

◎ Usage

可在~/.vimrc裡配置相關設定,其他配置選項請參考官網說明

nmap<F9>:NERDTreeFind
let NERDTreeWinPos=1

1.nmap: 將F9設為開啟nerdtree的快捷鍵
2.NERDTreeWinPos : 將nerdtree區塊放在右邊

五、SrcExpl(Source Explorer)

SrcExpl可以將當下function的定義顯示出來,或是將當下的變數宣告處顯示出來

◎ Install

git clone https://github.com/wesleyche/SrcExpl

將plugin/srcexpl.vim複製到~/.vim/plugin/,doc/srcexpl.txt複製到~/.vim/doc

◎ Usage

官方網站有詳細介紹在.vimrc可用的設定,這裡只列出我有用到的設定

nmap<F10>:SrcExplToggle
let g:SrcExpl_pluginList = [
        \ "__Tag_List__",
        \ "_NERD_tree_",
        \ "Source_Explorer"
        \ ]

1.nmap : 將F10設為開啟srcexpl的快捷鍵
2.若有安裝taglist or nerdtree則需輸入

六、 trinity

trinity用來整合taglist, nerdtree, srcexpl,使可以一鍵開啟三個plgin的功能

◎ Install

git clone https://github.com/wesleyche/Trinity

將plugin/trinity.vim複製到~/.vim/plugin/

◎ Usage

接著設定vimrc

nmap  :TrinityToggleAll

1.nmap:將F7設為一次打開taglist, nerdtree, srcexpl的快捷鍵





References:
1. http://yuanfarn.blogspot.com/2013/02/srcexpl-vim-source-explorer.html
2. https://stackoverflow.com/questions/3196760/how-to-use-cscope-with-paths-that-contain-spaces
3. http://rickey-nctu.blogspot.com/2009/02/vim-srcexpl.html

2018年4月28日 星期六

OpenShot 影像處理軟體


OpenShot 主要功能為影片的剪輯、修改,
最大的強項是「穩定、快速、直覺」,
可以直接匯入影片,並且穩穩的跑出影像和聲音,
完全不用調整任何設定!

※環境=> Debian、Ubuntu

一、安裝
sudo apt-get update && apt-get install openshot

二、執行
一般 user 下,直接執行 openshot,介面如下:





三、操作

第一步驟是「匯入檔案」,
接著,將影音檔拉到下方的影音軌。



可以點上面的「+ 加入影音軌」,可用於穿插字幕、聲音、動畫、其它影像…等,而按右鍵可以「移除影音軌」。


拉動紅色線,選好位置後可以「加入標記」,插入後,
可以方便做剪輯,於紅線上方點右鍵可以依紅線位置下
「全部剪輯切片」,之後可以針對需求做片段的特效,
或改部份片段影片的速度…等等。

基本上,使用都很方便直覺,基本的對於使用者來說已經相當夠用。

最後剪輯完記得「匯出視訊」,我設定匯出 .avi 如下圖:



Reference:

2015年6月6日 星期六

Wicd 網路管理程式(適用 Wireless)

一、 安裝
su
apt-get update
apt-get install wicd

二、 執行
wicd-client

三、 操作

 1. 開啟 WiFi,並搜尋可連線網路。

2. 若 WiFi 需要密碼,則選「特性」。

3. 設定密碼 ( 下次使用會記憶起來)

4. 點選「連線」,正常來講即可連上 WiFi

5. 使用完畢,可以直接「斷線」或「關閉 WiFi」。



Teamviewer 遠端連線程式

Teamviewer 遠端連線程式,可免去 VPN 直接控制,
Windows - Linux 都可以互相連線。
於 Debian Jessie 使用 Teamviewer 只能裝 i386 本版!


1. 下載
teamviewer_10.0.41499_i386.deb

2. 更新 ATP i386 套件庫
sudo dpkg --add-architecture i386
sudo apt-get update

3. 安裝
dpkg -i teamviewer_10.0.41499_i386.deb
apt-get -f install -y
dpkg -i teamviewer_10.0.41499_i386.deb

4. 執行 (一般使用者)
teamviewer

5. 下次開機不要啟動
因為 teamviewerd.service 開著的話,關機會很慢,
故設定下次開機不自動啟動,需要使用在開!

關閉:
sudo systemctl disable teamviewerd
sudo systemctl stop teamviewerd
sudo systemctl status teamviewerd

下次開機要使用:
sudo systemctl start teamviewerd
teamviewer






Reference:
http://steronius.blogspot.tw/2014/08/install-teamviewer-9-in-64bit-debain.html

2015年4月23日 星期四

pdftk 合併多個pdf

pdftk是一套用以處理pdf的程式,


sudo apt-get -y install pdftk


例如:

pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf

就可以合併多個pdf。

2014年11月22日 星期六

gtk-recordmydesktop 錄影工具

一、安裝

apt-get install gtk-recordmydesktop recordmydesktop ffmpeg

二、操作

1. 開啟軟體

gtk-recordmydesktop

2. 出現操作介面,如圖


3. 按紅點,開始錄影錄音…


4. 完成錄影

Ctrl + Alt + S

5. 輸出到家目錄或指定目錄


6. 轉檔 .ogv -> .avi

ffmpeg -i out.ogv -vcodec mpeg4 -sameq -acodec libmp3lame out.avi

三、其他

1. 錄音

可以安裝 gnome-alsamixer ,
用來調整 Mic 的音量設定,

我的 Mic 是插主機後方,設定如下圖:

2. 播放

可以使用 mplayer 播 .ogv 格式之影片檔。

3.整理 Shell Script 快速轉檔

vi toAVI.sh
# !/bin/bash
# .ogv to .avi

if [ -z $1 ] || [ -z $1 ] ;then
        echo
        echo ====== Usage =========
        echo "toAVI.sh [input.ogv] [output.avi]" 
        exit 0
fi

ffmpeg -i $1 -vcodec mpeg4 -sameq -acodec libmp3lame $2








Reference:
http://blog.longwin.com.tw/2009/04/linux-record-recordmydesktop-2009/

http://www.cyberciti.biz/faq/linux-unix-bsd-appleosx-convert-ogv-to-avi-video-audio/

2014年10月30日 星期四

hdparm - Linux硬碟測試讀寫速度



sudo apt-get install hdparm

sudo hdparm -Tt /dev/sdX

sudo hdparm -t --direct /dev/sdX

Timing cached reads:   3164 MB in  2.00 seconds = 1582.31 MB/sec
Timing buffered disk reads: 238 MB in  3.01 seconds =  79.08 MB/sec

2014年10月23日 星期四

快速格式化工具



假設需要格式化的分割區為 /dev/sdb1,

  • HPFS/NTFS/exFAT

我們一般的 Linux 下格式化 NTFS 檔案系統格式,
常用的指令有:
mkfs -t ntfs /dev/sdb1
mkfs.ntfs /dev/sdb1

接下來推薦,NTFS 的快速格式化工具 ntfsprogs
sudo apt-get install ntfsprogs
mkntfs -f /dev/sdb1


  • EXT4

快速格式化要加 -T largefile 參數:
mkfs.ext4  -T largefile  /dev/sdb1










2014年10月22日 星期三

用 iconv 將檔案轉換格式


因為Big-5的檔案,看都會有亂碼,


所以就可以用

iconv

來將Big-5格式的檔案,


直接轉成UTF-8的格式。

(1) Big-5 To UTF-8

 

       
iconv -f big5 -t utf-8 big5.txt -o utf8.txt

(2) UTF-8 To Big-5

        
iconv -f utf-8 -t big5 utf8.txt -o big5.txt

2014年10月8日 星期三

圖片擷取工具 Shutter


介紹一個 ScreenShot 工具,名稱為  shutter 
它的優點為:安裝簡單、使用容易,可以快速擷取圖片,
並立即編輯圖片,還可以指定好輸出路徑、定時擷圖等功能。

其介面如下圖:

1. 安裝。

sudo apt-get update && apt-get -y install shutter


2. 執行,只要直接 terminal 上打套件名稱 shutter。

shuuter

3. 編輯 menu 及 toolbar ,讓擷圖更便利。

vi /etc/X11/icewm/menu
vi /etc/X11/icewm/menu

一樣加入下面這行:

prog "Screenshot" shutter.png shutter


## 注意,shutter.png 圖檔要自己做,並放到 IconPath 下。

4. 簡易操作說明:


選取上圖的「擷取選取區域」,接著按住左鍵
框選要擷的區塊,放開後還可以再移動區塊微調,
最後決定截圖按 Enter,取消截圖按 Esc。

其它功能,更是很直覺的操作方法,按了就開始工作!
最後,可以到「編輯」 -> 「偏好設定」->「主要」,
修改輸出的品質、影像格式、名稱、位置…等,
自行客自化,並且可以再上方儲存成一個樣式。

5. 立即編輯圖片工具

在介面的右上角有「編輯」,可以立即編輯圖片,
為圖片加入文字、框線…等修改,並另存新檔!


2014年7月24日 星期四

Conky 系統監測工具

Conky 是 Linux 上的免費 X-Window 監測工具,可以顯示各硬體監測數據。
------

1. 安裝conky
apt-get install conky conky-all


2. 安裝系統感測軟體
apt-get install curl lm-sensors hddtemp


3. conky 執行指令
conky -dq → turn on conky
pkill conky → turn off conky


4. conky設定檔
cp /etc/conky/conky.conf ~/.conkyrc
vi ~/.conkyrc


5. 開機啟動 conky:
vim ~/.xinitrc
sleep 2 && conky -qd


ps.指令位置要下在環境啟動之前,例如我的 Linux GUI 是使用 icewm,而我的 conky 啟動指令要放在 .xinitrc 文件中 exec icewm 這個指令之前。

我的conky 設定內容如下:

#Aligned position on screen(設定conky位置) 
alignment bottom_right

background no
border_width 1
#border_margin 4

cpu_avg_samples 2

default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
double_buffer yes

use_xft yes

#字型及大小
xftfont DejaVu Sans Mono:size=12
#xftfont Bitstream Vera Sans Mono:size=16
#font Sans:size=11

#視窗座標
gap_x 20
gap_y 150

minimum_size 5 5
maximum_width 300

net_avg_samples 2
no_buffers yes

out_to_console no
out_to_stderr no

extra_newline no

own_window no
own_window_transparent no
own_window_class Conky
own_window_type desktop

stippled_borders 0

#更新頻率(秒)
update_interval 1.0
uppercase no
use_spacer no

show_graph_scale no
show_graph_range no
#stippled_borders 10

total_run_time 0
###########################################
TEXT
# Kernel
#${color lightgrey}$sysname $kernel ${color}on ${color lightgrey}$machine
# Time
${color lightgrey}Time:${color 00ff00}${time %Y/%m/%d - %R:%S}
# separator
${color grey}$stippled_hr
# File system
${color lightgrey}File systems:
${color lightgrey}root: $color${fs_used /}${color lightgrey}/$color${fs_size /}
${color lightgrey}(free: $color${fs_free /}${color lightgrey} - $color${fs_free_perc /}%${color lightgrey})
#home: $color${fs_used /home/lin}/${fs_size /home/lin}
${color 7f8ed3}${fs_bar 12 /}
# Networking-eth0
${color lightgrey}Eth0:
${color lightgrey}Down:${color} ${downspeed eth0} ${offset 40}Up:${color} ${upspeed eth0}
${color black}${downspeedgraph eth0 35,140 ff0000 0000ff} ${color black}${upspeedgraph eth0 35,140 0000ff ff0000}
#${color 888888}${downspeedgraph eth0 35,130 ff0000 0000ff}       ${color 888888}${upspeedgraph eth0 35,130 0000ff ff0000}
#${color 888888}TOTAL: ${color CCCCCC}${totaldown eth0}  ${color 888888}TOTAL: ${color CCCCCC}${totalup eth0}
# separator
${color grey}$stippled_hr
# CPU
${color lightgrey}Total CPU:${color ddaa00} ${cpu}%
${color 7f8ed3}${cpubar 12}
${color lightgrey}CPU0:         CPU1:
${color 000000}${cpugraph cpu0 35,140 000000 7f8ed3}    ${color 000000}${cpugraph cpu1 35,140 000000 7f8ed3}
${color lightgrey}CPU2:         CPU3:
${color 000000}${cpugraph cpu2 35,140 000000 7f8ed3}    ${color 000000}${cpugraph cpu3 35,140 000000 7f8ed3}
# RAM
${color lightgrey}RAM: ${color}$mem/$memmax - ${color ddaa00}$memperc%
${color 7f8ed3}${membar 12}
# Swap
${color lightgrey}Swap: ${color}$swap/$swapmax - ${color ddaa00}$swapperc%
${color 7f8ed3}${swapbar 12}
# separator
${color grey}$stippled_hr
# process CPU usage
${color ffccaa}CPU usage         PID   CPU%
${color ddaa00} ${top name 1}${top pid 1}${top cpu 1}
${color lightgrey} ${top name 2}${top pid 2}${top cpu 2}
${color lightgrey} ${top name 3}${top pid 3}${top cpu 3}
${color lightgrey} ${top name 4}${top pid 4}${top cpu 4}

# process RAM usage
${color ffccaa}Mem usage         PID   RAM%
${color ddaa00} ${top_mem name 1}${top_mem pid 1}${top mem 1}
${color lightgrey} ${top_mem name 2}${top_mem pid 2}${top mem 2}
${color lightgrey} ${top_mem name 3}${top_mem pid 3}${top mem 3}
${color lightgrey} ${top_mem name 4}${top_mem pid 4}${top mem 4}


第二版,新增CPU、GPU 溫度(排版修改)

但要偵測顯卡溫度前,要先安裝 Nvidia 顯卡驅動

一般 command 查看溫度的方法:
看CPU 溫度: sensors
看GPU 溫度: nvidia-settings -q gpucoretemp

善用 command 擷取,再加到 .conkyrc 內:
加入後的 conky 如下圖:

.conkyrc 設定如下:
# Conky, a system monitor, based on torsmo
#
# Any original torsmo code is licensed under the BSD license
#
# All code written since the fork of torsmo is licensed under the GPL
#
# Please see COPYING for details
#
# Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
# Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .
#
# Possible variables to be used:
#
#      Variable         Arguments                  Description                
#  acpiacadapter                     ACPI ac adapter state.                   
#  acpifan                           ACPI fan state                           
#  acpitemp                          ACPI temperature.                        
#  adt746xcpu                        CPU temperature from therm_adt746x       
#  adt746xfan                        Fan speed from therm_adt746x             
#  battery           (num)           Remaining capasity in ACPI or APM        
#                                    battery. ACPI battery number can be      
#                                    given as argument (default is BAT0).     
#  buffers                           Amount of memory buffered                
#  cached                            Amount of memory cached                  
#  color             (color)         Change drawing color to color            
#  cpu                               CPU usage in percents                    
#  cpubar            (height)        Bar that shows CPU usage, height is      
#                                    bar's height in pixels                   
#  downspeed         net             Download speed in kilobytes              
#  downspeedf        net             Download speed in kilobytes with one     
#                                    decimal                                  
#  exec              shell command   Executes a shell command and displays    
#                                    the output in torsmo. warning: this      
#                                    takes a lot more resources than other    
#                                    variables. I'd recommend coding wanted   
#                                    behaviour in C and posting a patch :-).  
#  execi             interval, shell Same as exec but with specific interval. 
#                    command         Interval can't be less than              
#                                    update_interval in configuration.        
#  fs_bar            (height), (fs)  Bar that shows how much space is used on 
#                                    a file system. height is the height in   
#                                    pixels. fs is any file on that file      
#                                    system.                                  
#  fs_free           (fs)            Free space on a file system available    
#                                    for users.                               
#  fs_free_perc      (fs)            Free percentage of space on a file       
#                                    system available for users.              
#  fs_size           (fs)            File system size                         
#  fs_used           (fs)            File system used space                   
#  hr                (height)        Horizontal line, height is the height in 
#                                    pixels                                   
#  i2c               (dev), type, n  I2C sensor from sysfs (Linux 2.6). dev   
#                                    may be omitted if you have only one I2C  
#                                    device. type is either in (or vol)       
#                                    meaning voltage, fan meaning fan or temp 
#                                    meaning temperature. n is number of the  
#                                    sensor. See /sys/bus/i2c/devices/ on     
#                                    your local computer.                     
#  kernel                            Kernel version                           
#  loadavg           (1), (2), (3)   System load average, 1 is for past 1     
#                                    minute, 2 for past 5 minutes and 3 for   
#                                    past 15 minutes.                         
#  machine                           Machine, i686 for example                
#  mails                             Mail count in mail spool. You can use    
#                                    program like fetchmail to get mails from 
#                                    some server using your favourite         
#                                    protocol. See also new_mails.            
#  mem                               Amount of memory in use                  
#  membar            (height)        Bar that shows amount of memory in use   
#  memmax                            Total amount of memory                   
#  memperc                           Percentage of memory in use              
#  new_mails                         Unread mail count in mail spool.         
#  nodename                          Hostname                                 
#  outlinecolor      (color)         Change outline color                     
#  pre_exec          shell command   Executes a shell command one time before 
#                                    torsmo displays anything and puts output 
#                                    as text.                                 
#  processes                         Total processes (sleeping and running)   
#  running_processes                 Running processes (not sleeping),        
#                                    requires Linux 2.6                       
#  shadecolor        (color)         Change shading color                     
#  stippled_hr       (space),        Stippled (dashed) horizontal line        
#                    (height)        
#  swapbar           (height)        Bar that shows amount of swap in use     
#  swap                              Amount of swap in use                    
#  swapmax                           Total amount of swap                     
#  swapperc                          Percentage of swap in use                
#  sysname                           System name, Linux for example           
#  time              (format)        Local time, see man strftime to get more 
#                                    information about format                 
#  totaldown         net             Total download, overflows at 4 GB on     
#                                    Linux with 32-bit arch and there doesn't 
#                                    seem to be a way to know how many times  
#                                    it has already done that before torsmo   
#                                    has started.                             
#  totalup           net             Total upload, this one too, may overflow 
#  updates                           Number of updates (for debugging)        
#  upspeed           net             Upload speed in kilobytes                
#  upspeedf          net             Upload speed in kilobytes with one       
#                                    decimal                                  
#  uptime                            Uptime                                   
#  uptime_short                      Uptime in a shorter format               
#
#  seti_prog                         Seti@home current progress
#  seti_progbar      (height)        Seti@home current progress bar
#  seti_credit                       Seti@hoome total user credit
#

#Aligned position on screen(設定conky位置) 
#alignment top_right
alignment bottom_right
background no
border_width 1
#border_margin 4

cpu_avg_samples 2

default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
double_buffer yes

use_xft yes

#字型及大小
xftfont DejaVu Sans Mono:size=12
#xftfont Bitstream Vera Sans Mono:size=16
#font Sans:size=11

#視窗座標
gap_x 20
gap_y 150

minimum_size 5 5
maximum_width 300

net_avg_samples 2
no_buffers yes

out_to_console no
out_to_stderr no

extra_newline no

# 視窗背景 yes:黑底 ; no:透明
own_window yes
own_window_transparent no
own_window_class Conky
own_window_type desktop

stippled_borders 0

#更新頻率(秒)
update_interval 1.0
uppercase no
use_spacer no

show_graph_scale no
show_graph_range no
#stippled_borders 10

total_run_time 0
###########################################
TEXT
#
# Kernel
#${color lightgrey}$sysname $kernel ${color}on ${color lightgrey}$machine
#
# Time
${color lightgrey}Time:${color 00ff00}${time %Y/%m/%d - %R:%S}
#
# separator
${color grey}$stippled_hr
#
# Networking-eth0
${color lightgrey}Eth0:
${color lightgrey}Down:${color} ${downspeed eth0} ${offset 40}Up:${color} ${upspeed eth0}
${color black}${downspeedgraph eth0 35,140 ff0000 0000ff} ${color black}${upspeedgraph eth0 35,140 0000ff ff0000}
#${color 888888}${downspeedgraph eth0 35,130 ff0000 0000ff}       ${color 888888}${upspeedgraph eth0 35,130 0000ff ff0000}
#${color 888888}TOTAL: ${color CCCCCC}${totaldown eth0}  ${color 888888}TOTAL: ${color CCCCCC}${totalup eth0}
#
# separator
${color grey}$stippled_hr
#
# Total  CPU %
${color lightgrey}Total CPU:${color ddaa00} ${cpu}%
${color 7f8ed3}${cpubar 12}
#
# Tempratures 
${alignc}Temperatures
${color lightgrey}CPU: ${color ddaa00}${exec sensors atk0110-acpi-0|grep "CPU Temp"|cut -d '+' -f 2|cut -d ' ' -f 1}
${color lightgrey}GPU: ${color ddaa00}${exec nvidia-settings -q gpucoretemp -t | tail -n 1} °C
#
# separator
${color grey}$stippled_hr
#
# Per CPU %
#
# CPU 0 & CPU 1
${color lightgrey}CPU0 (${exec sensors coretemp-isa-0000|grep 0:|cut -d '+' -f 2|cut -d ' ' -f 1})              ${color lightgrey}CPU1 (${exec sensors coretemp-isa-0000|grep 1:|cut -d '+' -f 2|cut -d ' ' -f 1})
${color 000000}${cpugraph cpu0 35,140 000000 7f8ed3}    ${color 000000}${cpugraph cpu1 35,140 000000 7f8ed3}
#
# CPU 2 & CPU 3
${color lightgrey}CPU2 (${exec sensors coretemp-isa-0000|grep 2:|cut -d '+' -f 2|cut -d ' ' -f 1})              ${color lightgrey}CPU3 (${exec sensors coretemp-isa-0000|grep 3:|cut -d '+' -f 2|cut -d ' ' -f 1})
${color 000000}${cpugraph cpu2 35,140 000000 7f8ed3}    ${color 000000}${cpugraph cpu3 35,140 000000 7f8ed3}
##
## CPU 4 & CPU 5
#${color lightgrey}CPU4 (${exec sensors coretemp-isa-0000|grep 4:|cut -d '+' -f 2|cut -d ' ' -f 1})             ${color lightgrey}CPU5 (${exec sensors coretemp-isa-0000|grep 5:|cut -d '+' -f 2|cut -d ' ' -f 1})
#${color 000000}${cpugraph cpu4 35,140 000000 7f8ed3}   ${color 000000}${cpugraph cpu5 35,140 000000 7f8ed3}
##
## CPU 6 & CPU 7
#${color lightgrey}CPU6 (${exec sensors coretemp-isa-0000|grep 6:|cut -d '+' -f 2|cut -d ' ' -f 1})             ${color lightgrey}CPU7 (${exec sensors coretemp-isa-0000|grep 7:|cut -d '+' -f 2|cut -d ' ' -f 1})
#${color 000000}${cpugraph cpu6 35,140 000000 7f8ed3}   ${color 000000}${cpugraph cpu7 35,140 000000 7f8ed3}
#
# File system
${color lightgrey}File systems:
${color lightgrey}root: $color${fs_used /}${color lightgrey}/$color${fs_size /}
${color lightgrey}(free: $color${fs_free /}${color lightgrey} - $color${fs_free_perc /}%${color lightgrey})
#home: $color${fs_used /home/lin}/${fs_size /home/lin}
${color 7f8ed3}${fs_bar 12 /}
#
# RAM
${color lightgrey}RAM: ${color}$mem/$memmax - ${color ddaa00}$memperc%
${color 7f8ed3}${membar 12}
#
# Swap
${color lightgrey}Swap: ${color}$swap/$swapmax - ${color ddaa00}$swapperc%
${color 7f8ed3}${swapbar 12}
#
# separator
${color grey}$stippled_hr
#
# process CPU usage
${color ffccaa}CPU usage         PID   CPU%
${color ddaa00} ${top name 1}${top pid 1}${top cpu 1}
${color lightgrey} ${top name 2}${top pid 2}${top cpu 2}
${color lightgrey} ${top name 3}${top pid 3}${top cpu 3}
${color lightgrey} ${top name 4}${top pid 4}${top cpu 4}

#
# process RAM usage
${color ffccaa}Mem usage         PID   RAM%
${color ddaa00} ${top_mem name 1}${top_mem pid 1}${top mem 1}
${color lightgrey} ${top_mem name 2}${top_mem pid 2}${top mem 2}
${color lightgrey} ${top_mem name 3}${top_mem pid 3}${top mem 3}
${color lightgrey} ${top_mem name 4}${top_mem pid 4}${top mem 4}


補充:字型顏色可以參考十六進制色碼表
http://www.wibibi.com/info.php?tid=372