Kali-Linux-美化與優化


照理說,linux的桌面是不應當存在在這個世界上的,作為一個linux用戶,一味搗鼓桌面顯得hin~不專業。但是,虛擬機要用到,瀏覽器要用到……更何況,自己的老婆能不打扮一下么?
update:2019-01-23 07:59:12

效果預覽

V1.0版

截屏工具

項目地址:https://github.com/lupoDharkael/flameshot
安裝方式:sudo apt-get install flameshot
啟動方式:flameshot gui
animatedUsage.gif

圖標制作

有的手動編譯后,沒有生成圖標,啟動后也無法加入左側dash的收藏,啟動不方便。
另外,有的應用關聯設置,比如說想要雙擊打開JAR文件,環境應用沒有圖標的話,也不會出現在備選列表中。需要手動寫一個啟動方式,提高效率。
三種

  1. 命令行關聯,在/usr/bin/目錄下創建軟連接,
cd /usr/bin/
sudo ln -s /opt/xxx/jadx jadx

或者導入/etc/profile,環境變量配置方法后續補充。
2. 創建桌面或者程序圖標,/usr/share/applications/xxx.desktop
或者直接放到桌面上
cat Desktop/010editor-desktop.desktop :

[Desktop Entry]
Version=1.0
Type=Application
Name=010 Editor
Exec=/opt/010editor/010editor 
Icon=/opt/010editor/010_icon_128x128.png
  1. 在cairo-dock中設置啟動器,把啟動應用所需執行的命令寫進去,自己配個圖標即可。甚至是簡書url也可以。

字體配置

將windows系統中的字體文件C:\Windows\Fonts復制出來,臨時放在home目錄下。

sudo mkdir /usr/share/fonts/truetype/WindowsFonts/ 
sudo cp ~/Fonts/* /usr/share/fonts/truetype/WindowsFonts/
sudo fc-cache -f -v    #刷新緩存,使新字體生效

頂部插件

  1. 火狐瀏覽器訪問:https://extensions.gnome.org/
  2. 遇到提示Allow https://extensions.gnome.org/ to run "GNOME Shell Integration?",點擊Allow and remember開啟瀏覽器擴展支持。
  3. 接下來即可從網頁上直接安裝插件。
    推薦幾個:

gnome-shell隱藏標題欄http://www.linuxdiyf.com/viewarticle.php?id=270522

修復ls

vi ~/.bashrc,按x鍵,把那幾個注釋去掉
bashrc.png

GRUB優化

sudo vi /etc/default/grub,修改后執行 sudo update-grub生效

  • 多系統順序調整
    GRUB_DEFAULT=2,數字2是開機進入grub界面后的候選菜單順序,從0開始計數,到2的那一行,本機對應的是windows。
  • 等待時間修改
    GRUB_TIMEOUT=1,單位為秒。
  • nvme硬盤策略
    接上第二塊nvme硬盤后,linux啟動時硬件自檢,屏幕字幕飛滾,無法開機。拆掉新盤,重新啟動,在GRUB_CMDLINE_LINUX_DEFAULT="quiet"尾部添加幾個參數,可以順利啟動系統。
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=noaer"
  • grub緊急修復
    已單獨發文,戳這里

解決中文亂碼問題

  • zip等壓縮文件解壓后文件名亂碼問題
    sudo apt-get install unar
    unar xxx.zip
  • 文本編輯器添加gbk等中文編碼識別
    gsettings set org.gnome.gedit.preferences.encodings candidate-encodings "['GB18030','UTF-8','CURRENT','ISO-8859-15','UTF-16','gb2312']"
  • 文件路徑、文件名、zip解壓自動識別 // 工具名字忘記了,想起來再補
  • 解決Linux下音樂亂碼的問題:
    MP3文件亂碼的原因:
    這個問題出現在mp3文件里,由於大陸大多數MP3文件都是用GBK/GB18030編碼寫入標簽信息的,而大多數的linux播放器默認以utf-8編碼讀取,這就產生了亂碼。
    解決方法:
    使用Mutagen來修改Mp3文件的標簽信息,具體方法如下(只針對GBK/GB18030編碼的情況):
    安裝Mutagen(ubuntu下終端運行 sudo apt-get install python-mutagen)后,在終端執行:
    mid3iconv -e gbk *.mp3
    如果想轉換當前目錄下的所有 mp3 (包括子目錄):
    find . -iname "*.mp3" -execdir mid3iconv -e gbk {} ;
  • 安裝的時候采用英文版,可避免多數亂碼問題。另外一個原因是:終端里面中英結合的感覺,就像一碗拉面里面有幾根又粗又硬粘在一起的生面條一樣,不喜歡。

快捷鍵

點擊屏幕右上角菜單中的扳手圖標,Settings->Devices->Keyboard,打開如下界面配置自定義快捷鍵。

key.png

  • Ctrl+Alt+A 截屏
    gnome-screenshot -a
  • Ctrl+Alt+G 開啟gnome終端
    gnome-terminal
  • Ctrl+Alt+T 開啟terminator終端
    terminator
  • Super+E 打開根目錄
    nautilus /
  • Super+D 顯示桌面
    這個要手動修改
    默認的還有個Alt + F2,類似windows中的win+r,也可以在這里更改一下。

皮膚更改

  • 護眼模式
  • 主題顏色
  • 終端顏色字體透明度
  • rime導入搜狗詞庫
  • 搜狗輸入法皮膚
  • Smplayer皮膚
    下載:http://smplayer.sourceforge.net/en/downloads
    導入:sudo cp -r ~/Downloads/UNCOMPRESSED-FOLDER/themes/* /usr/share/smplayer/themes/
    啟用:Smplayer->Options->Preferences->Interface->GUI
    其實windows版的Smplayer多出來個皮膚,感覺那個比較好看,可以從theme目錄復制到Linux里面,通用。
    Smplayer

Conky配置

通過ConkyManager配置。找一個主題,解壓后把文件夾放到~/.conky/中。
這里用的是Sidebar-Conky主題,做了一點修改,下面看看~/.conky/Sidebar-Conky/Sidebar-Conky_Rc代碼。

############################################################################################
# Sidebar-Conky					 					   #
# by wim66 https://www.google.com/+WillemO						   #
# 26-5-15										   #
# "Inspired by" other people's code							   #
# Calendar, more great conky's http://erikdubois.be/category/conky			   #
# Jesse Avalos http://speedracker.deviantart.com/					   #
# Weather font by Kelly Kretchek https://plus.google.com/u/0/103934698784251707937/posts   #
# Wallpaper http://0rax0.deviantart.com/art/Linux-2014-Wallpaper-457151439		   #
# Use with Conky-Manager								   #
# http://www.teejeetech.in/p/conky-manager.html						   #
#											   #
############################################################################################

background yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
imlib_cache_size 0
#刷新頻率
update_interval 1
cpu_avg_samples 1
format_human_readable

alignment bottom_right
gap_x 11
gap_y -33
minimum_size 280 750
maximum_width 240

own_window yes
own_window_type desktop 	# options are: normal/override/dock/desktop/panel
own_window_class Conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_colour 000000
own_window_argb_visual yes
own_window_argb_value 0

border_inner_margin 2
border_outer_margin 2

default_bar_size 100 6
draw_shades no
default_shade_color 000000
draw_outline no
default_outline_color 000000
draw_borders no
draw_graph_borders yes
default_graph_size 40,220
show_graph_scale no
show_graph_range no

override_utf8_locale yes
use_xft yes
xftfont Adele:size=13,weight:normal
xftalpha 1
uppercase no
max_text_width 40

default_color ffffff
color1 ffffff
color2 FF5A45
color3 81CAE0
color4 FF5A45
color5 00FF00

TEXT
#$sysname
${voffset 10}${font Adele:size=15,weight:normal}${color1}${alignc}[[ $kernel ]] ${font}
#${goto 10}Desktop:${alignr 5}$XDG_CURRENT_DESKTOP
#${goto 10}Installation date:${alignr 5}${exec ls -ld /lost+found | cut -d' ' -f 6-7 --output-delimiter=' - '}
${goto 10}Uptime:${alignr 5}$uptime
#
# cpu load/temp/graph
${goto 10}${voffset 5}CPU1: ${cpu cpu1}%${alignr 10}${exec sensors|grep 'Core 0'|awk '{print $3}'}
${goto 10}${voffset -5}${color2}${cpugraph cpu1 40,220 66241C FF5A45}
${goto 10}${voffset 0}${color1}CPU2: ${cpu cpu2}%${alignr 10}${exec sensors|grep 'Core 1'|awk '{print $3}'}
${goto 10}${voffset -5}${color2}${cpugraph cpu2 40,220 66241C FF5A45}
#
# top processes
${voffset -5}${font Adele:size=15,weight:normal}${color1}${alignc}Top Processes ${font}
${voffset 4}${goto 10}${top name 1}${alignr 10}${top cpu 1}%
${goto 10}${voffset -2}${top name 2}${alignr 10}${top cpu 2}%
${goto 10}${voffset -2}${top name 3}${alignr 10}${top cpu 3}%
${goto 10}${voffset -2}${top name 4}${alignr 10}${top cpu 4}%
#
# top memory
${goto 10}${voffset 10}${font Adele:size=15,weight:normal}Memory${goto 85}${color2}$membar${alignr 10}${color1}$memperc%
${goto 10}${color1}${voffset -2}${font}${top_mem name 1}${alignr 10}${top mem 1}%
${goto 10}${voffset -2}${top_mem name 2}${alignr 10}${top mem 2}%
${goto 10}${voffset -2}${top_mem name 3}${alignr 10}${top mem 3}%
${goto 10}${voffset -2}${top_mem name 4}${alignr 10}${top mem 4}%
#
#network
${voffset 10}${font Adele:size=15,weight:normal}${color1}${alignc}Network
${goto 10}SSID:${alignr 10}${wireless_essid wlan0}
${goto 10}Signal:${goto 85}${color2}${wireless_link_bar wlan0}${color1}${alignr 10}${wireless_link_qual_perc wlan0}%
${goto 10}eth0: ${alignr 10}${addr eth0}
${voffset 5}${goto 10}${color1}Upspeed:${alignr 10}${upspeed wlan0}
${goto 10}${voffset 0}Total up:${alignr 10}${totalup wlan0}
${goto 10}${color2}${upspeedgraph wlan0 40,220 66241C FF5A45 100 -l}
${goto 10}${color1}Down:$color1${alignr 10}${downspeed wlan0}
${goto 10}Total down:${alignr 10}${totaldown wlan0}
${goto 10}${color2}${downspeedgraph wlan0 40,220 66241C FF5A45 100 -l}
#
# weather
#
#------> Check Qaisar Nawaz' blog on how to change the weather location code: http://myconkys.blogspot.com.au/2014/04/weather-location-settings.html <-----#
#
#${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=727232&u=c" -o ./weather/cache/weather.xml}\
#${font Adele:size=15,weight:normal}${goto 10}${color1}${voffset 0}${execi 300 grep "yweather:location" ./weather/cache/weather.xml | grep -o "city=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}, ${execi 300 grep "yweather:location" ./weather/cache/weather.xml | grep -o "country=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}
#
# weather discription
###${goto 10}${voffset 0}${color1}${font Adele:size=15,weight:normal}\
${execi 360 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}\
${font}
#
# temp
###${font LG Weather_Z:size=35}${goto 10}${voffset 0}${execi 300 grep "yweather:condition" ./weather/cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font GeosansLight:normal:size=12}Celsius}
# high/low
###${font}${goto 30}${voffset 5}${execi 300 grep "yweather:forecast" ./weather/cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°\
###${goto 85}${voffset 0}${execi 300 grep "yweather:forecast" ./weather/cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°
#
# weather icons
#
###${font Scalable weather v12.0:size=90,weight:normal}${color3}${voffset -90}${goto 150}${execi 300 sh weather/weather_font $(grep "yweather:condition" ./weather/cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*")}
#
###${image arrow-up.png -p 10,988 -s 15x15}
#
###${image arrow-down.png -p 65,988 -s 15x15}
#

#${goto 10}${exec whoami}:
#${exec ls ~/Desktop|awk -F '.' '{print $1}'}
#${exec date "+%H:%M:%S"}
${voffset -10}${font Adele:size=15,weight:normal}${color1}${alignc}Devices
#${color5}${exec adb devices}
#${voffset -10}${font Adele:size=15,weight:normal}${color1}${alignc}Devices List
${color5}${exec adb devices|grep -v devices}
#${goto 10}device ${color1}${alignr 10}${exec  adb devices|grep -v devices|awk -F " " '{print $1}'}

配置文件有其特定的語法,反復看幾遍就能理解了。有時間再在下面補充一下語法細節。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM