WAY の ubuntu18.04配置指南

关于ubuntu

Ubuntu是一个以桌面应用为主的Linux操作系统,其名称来自非洲南部祖鲁语或豪萨语的“ubuntu”一词,意思是“人性”“我的存在是因为大家的存在”,是非洲传统的一种价值观。Ubuntu基于Debian发行版和Gnome桌面环境,而从11.04版起,Ubuntu发行版放弃了Gnome桌面环境,改为Unity。从前人们认为Linux难以安装、难以使用,在Ubuntu出现后这些都成为了历史。Ubuntu也拥有庞大的社区力量,用户可以方便地从社区获得帮助。自Ubuntu 18.04 LTS起,Ubuntu发行版又重新开始使用GNOME3桌面环境

安装之后需要做的事情

换源

编辑 /etc/apt/sources.list 文件, 在文件前面加上阿里云镜像源

image-20201014232124793

# 打开 /etc/apt/sources.list
sudo vim /etc/apt/sources.list
# 阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse                              
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
##測試版源
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# 源碼
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
##測試版源
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

刷新

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential

禁用 nouveau 驱动

 # 打开 balcklist-nouveau.conf
 sudo vim /etc/modprobe.d/blacklist-nouveau.conf
# 文件中加入
 blacklist nouveau                                                           
 options nouveau modeset=0
# 添加完之后更新
sudo update-initramfs -u 

# 重启
sudo reboot

# 重启后输入下面命令应该没有输出
lsmod | grep nouveau

image-20201014234837284

安装 nvidia 驱动

# 查看驱动列表
ubuntu-drivers devices

image-20201014235042410

# 选择驱动进行安装
sudo apt install nvidia-driver-455

更换 intel 核显

更换核显后耗电量会降低一些

# 打开 nvidia 设置
nvidia-settings

PRIME Profiles -> Intel

# 重启
sudo reboot

image-20201014235851735

tweaks

sudo apt update
sudo apt install gnome-tweaks
sudo apt install chrome-gnome-shell
sudo apt install gnome-tweak-tool
sudo apt install gnome-shell-extensions

然后更换主题、shell、指针

这里下载主题

# 图标和指针放在这里
/usr/share/icons
# 主题和shell放在这里
/usr/share/themes

plank

plank 是一个简单易用的dock,可替代原生dock

# 删除 ubuntu-dock
sudo apt remove gnome-shell-extension-ubuntu-dock
# 安装 plank
sudo apt-get install plank
plank

在 tweaks 中把plank添加到开机自启

image-20201015002258866

在 dock 上按住ctrl,点击右键可进行设置

image-20201015002811530

plank 主题可以在这里下载

# plank主题放置路径
/usr/share/plank/themes/
# 或者
~/.local/share/plank/themes/

搜狗输入法

# 安装 fcitx 框架
sudo apt install fcitx

搜狗输入法官网下载 deb 安装包

# 进入相应目录
sudo dpkg -i sougou*

image-20201015003848958

  1. 选择fcitx

  2. 点击apply system-wide

Screenshot from 2020-10-15 00-39-46

选择configure current input method

image-20201015004255766

添加搜狗输入法

可能需要更改快捷键

按左 shift 切换输入法,右 shift 或者长按左 shift 切换中英文(搜狗输入法)

image-20201015004344849

chrome浏览器

官网下载 deb 安装包安装

qq

暂时只能用 linux qq

网易云

音乐的力量

微信

凉了

wps

# 卸载 libreoffice
sudo apt-get remove --purge libreoffice*

官网下载

下载缺失的字体文件 提取码: 7eeh

# 进入解压文件夹
sudo cp * /usr/share/fonts
sudo mkfontscale
sudo mkfontdir
sudo fc-cache

fira code

一款编程字体,配合 vscode 食用

VSCode

官网下载安装

VSCode 插件 & 配置

插件 :

  1. ARM (arm汇编语法高亮)

  2. Auto Close Tag

  3. Auto Rename Tag

  4. Ayu (主题)

  5. Bracket Pair Colorizer (括号染色)

  6. C/C++

  7. CMake

  8. Code Runner

  9. ESLint

  10. Go

  11. HTML CSS Support

  12. Jekyll Snippets

  13. Jekyll Syntax Support

  14. Language Support for Java(TM) by Red Hat

  15. Markdown Preview Enhanced

  16. markdownlint

  17. MASM

  18. minapp(微信小程序)

  19. One Dark Pro

  20. open in browser

  21. Prettier - Code formatter

  22. Project Manager

  23. Python

  24. Vetur

  25. vscode-pdf

我的配置

{
    "workbench.colorTheme": "One Dark Pro",
    "python.linting.pylintArgs": ["--generate-members"],
    // "java.configuration.runtimes": [],
    "window.titleBarStyle": "native",
    "window.menuBarVisibility": "toggle",
    "code-runner.executorMap": {
        "javascript": "node",
        "java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
        "c": "cd $dir && gcc -std=c11 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
        "php": "php",
        "python": "python3 -u",
        "perl": "perl",
        "perl6": "perl6",
        "ruby": "ruby",
        "go": "go run",
        "lua": "lua",
        "groovy": "groovy",
        "powershell": "powershell -ExecutionPolicy ByPass -File",
        "bat": "cmd /c",
        "shellscript": "bash",
        "fsharp": "fsi",
        "csharp": "scriptcs",
        "vbscript": "cscript //Nologo",
        "typescript": "ts-node",
        "coffeescript": "coffee",
        "scala": "scala",
        "swift": "swift",
        "julia": "julia",
        "crystal": "crystal",
        "ocaml": "ocaml",
        "r": "Rscript",
        "applescript": "osascript",
        "clojure": "lein exec",
        "haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
        "rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
        "racket": "racket",
        "scheme": "csi -script",
        "ahk": "autohotkey",
        "autoit": "autoit3",
        "dart": "dart",
        "pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
        "d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
        "haskell": "runhaskell",
        "nim": "nim compile --verbosity:0 --hints:off --run",
        "lisp": "sbcl --script",
        "kit": "kitc --run",
        "v": "v run",
        "sass": "sass --style expanded",
        "scss": "scss --style expanded",
        "less": "cd $dir && lessc $fileName $fileNameWithoutExt.css"
    },
    "code-runner.runInTerminal": true,
    "code-runner.saveFileBeforeRun": true,
    "C_Cpp.clang_format_style": "{BasedOnStyle: Google, UseTab: Never, IndentWidth: 4, TabWidth: 4}",
    "editor.fontFamily": "Fira code",
    "editor.fontLigatures": true,
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "explorer.confirmDelete": false,
    "files.associations": {
        "*.cjson": "jsonc",
        "*.wxss": "css",
        "*.wxs": "javascript"
    },
    "emmet.includeLanguages": {
        "wxml": "html"
    },
    "minapp-vscode.disableAutoConfig": true,
    "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
    },
    "window.zoomLevel": 2
}

zsh & oh my zsh

  1. 安装切换 zsh
sudo apt install zsh
chsh -s /bin/zsh
  1. 安装 oh-my-zsh
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
## 如果不成功,请执行下面两条命令,成功了就不需要做下面两条
wget 47.93.11.51:88/install_zsh.sh
bash install_zsh.sh
  1. 安装zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  1. 使用命令vim .zshrc打开.zshrc文件,找到pluguns=()这一行,将zsh-syntax-highlighting添加进去
plugins=(git zsh-syntax-highlighting)
  1. 安装其他插件
mkdir ~/.oh-my-zsh/plugins/incr
wget http://mimosa-pudica.net/src/incr-0.2.zsh -O ~/.oh-my-zsh/plugins/incr/incr.plugin.zsh
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sudo apt install autojump
  1. 使用命令vim .zshrc,打开后在最后插入以下内容:
source ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
source /usr/share/autojump/autojump.sh
source ~/.oh-my-zsh/plugins/incr/incr*.zsh

image-20201015092644306

vimplus

git clone https://github.com/chxuan/vimplus.git ~/.vimplus
cd ~/.vimplus
./install.sh

Qv2ray

这个东西,github上搜一搜

触摸板手势 fusuma

  1. 安装 fusuma
# 将所在用户加入输入组
sudo gpasswd -a $USER input
# 依赖于ruby
sudo apt-get install ruby
sudo apt-get install libinput-tools
sudo apt-get install xdotool
sudo gem install fusuma
  1. 配置fusuma
vim ~/.config/fusuma/config.yml

修改配置文件,下面是我自己的配置

swipe:
  3: 
    left: 
      command: 'xdotool key alt+Right'
    right: 
      command: 'xdotool key alt+Left'
    up:
      command: 'xdotool key super+Tab'
    down: 
      command: 'xdotool key super+Shift+Tab'
  4:
    left: 
      command: 'xdotool key super+Left'
    right: 
      command: 'xdotool key super+Right'
    up: 
      command: 'xdotool key super+a'
    down: 
      command: 'xdotool key ctrl+super+d'
pinch:
  2:
    in:
      command: 'xdotool key ctrl+plus'
      threshold: 1
    out:
      command: 'xdotool key ctrl+minus'
      threshold: 1
 
threshold:
  swipe: 0.1
  pinch: 0.1
 
interval:
  swipe: 0,1
  pinch: 0.1

realsense

c++版本

python版本

opencv

c++版本

python版本

qt

多版本gcc

arm-none-eabi-gcc openocd stm32开发

Git & Git免密登录

sudo apt install git
# 生成秘钥对
ssh-keygen
cat ~/.ssh/id_rsa.pub
# 复制到github->settings->ssh keys

typora

typora是一个比较好用的 markdown 编辑器