Ubuntu20.04 个人配置和i3美化

2023-05-16

Ubuntu20.04 个人配置和i3美化

本文是基于个人习惯和审美,快速配置一个新ubuntu的步骤。脚本在资源里给出,但仍有部分配置文件需在脚本执行后手动修改,文中已用红色字体标出

更新apt源

  1. 备份原来的源
  2. 更换阿里源
# 备份
sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak
# 阿里源
sudo echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
" > /etc/apt/sources.list

更新apt

sudo apt update
sudo apt upgrade -y

这个时间比较长

安装vim

sudo apt install -y vim

安装mysql8.0

sudo apt install -y mysql-client-8.0

安装jdk8

sudo apt install -y openjdk-8-jdk

安装git

sudo apt install -y git

安装python3,python

sudo apt install -y python3
sudo apt install -y python

安装typora

sudo snap install typora

安装搜狗输入法

访问搜狗输入法 for linux并下载自己需要的版本(一般都是X86-64)

下载完成后得到一个deb包,双击他安装或者按如下命令安装(deb包名字可能不一样)

cd ~/Downloads/
sudo dpkg -i sogoupinyin_2.1.0.0082_amd64.deb

安装网页的提示操作即可

安装VSCode

sudo snap install code --classics

终端美化-安装zsh,oh-my-zsh

sudo apt install -y zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
chsh -s /bin/zsh
cd ~/.oh-my-zsh/plugins/
git clone https://github.com/zsh-users/zsh-autosuggestions
git clone https://github.com/wting/autojump.git ~/.oh-my-zsh/plugins/autojump
cd autojump
./install.py

autojump使用:在终端输入 j a,或者jump a,会自动进入与a最匹配的你最可能想要进的最近进入过的目录

zsh-autosuggestions使用:在终端输入命令时,可以看到灰色的自动补全语句,按up down键可切换,,键可直接自动补全

需手动修改配置文件,打开~/.zshrc,找到ZSH_THEME="robbyrussell",修改为ZSH_THEME="ys"

找到plugins,修改为

plugins=(
  git
  zsh-autosuggestions
  autojump
  extract
  vi-mode
  wd
)

在末尾加上[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh

或者可以直接把下面我的.zshrc内容来替换你的.zshrc,内容有多但没有错

# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

export PATH=$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# 主题
#ZSH_THEME="agnoster"
ZSH_THEME="ys"
#ZSH_THEME="random" # (...please let it be pie... please be some pie..)

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
#DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
  git
  rake
  ruby
  bundler
  extract
  web-search
  vi-mode
  wd
  zsh-autosuggestions
  catimg
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
 alias ohmyzsh="mate ~/.oh-my-zsh"
 alias cls='clear'
 alias zshrc="vim ~/.zshrc"
 alias vi='gvim'
 alias ff='firefox'
 alias -s txt=vi
 alias -s cpp=vi
 alias -s pdf=evince
 alias -s md=typora
 alias -s c=vi
 alias -s gz='tar -xzvf'
 alias -s tgz='tar -xzvf'
 alias -s zip='unzip'
 alias -s bz2='tar -xjvf'
 alias -s h
 alias fy='sdcv -u 朗道英汉字典5.0'
 alias Fy='sdcv -u 朗道汉英字典5.0'
 alias unrar="rar"
 bindkey ',' autosuggest-accept
 # 后台运行程序 : nohup a.sh &
 #hash
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh

GTK_MODULES=unity-gtk-module

美化-安装终端仿真器tilix

下面那条命令用来替换默认终端

sudo apt install -y tilix
gsettings set org.gnome.desktop.default-applications.terminal exec 'tilix'

需手动配置

打开tilix后右键上面的那一栏找到preference,在appearance里找到Theme variant,设置为dark,同在这里找到Window style,设置为Disable CSD,hide toolbar

快速打开软件-rofi

sudo apt install -y rofi

终端中使用:rofi -show run

图片查看feh

sudo apt install -y feh

使用以下命令可以设置随机桌面图片

feh --randomize --bg-fill ~/picture # 后面为你放图片的路径,每运行一次随机替换一次

安装i3wm

sudo apt install -y i3
sudo apt install -y i3lock
sudo add-apt-repository ppa:regolith-linux/stable
sudo apt-get update
sudo apt-get install i3-gaps

重启后在登录前的右下角选择i3,进入后一路enter键,之后请找网络资源进行学习使用和配置,学好后可以不使用鼠标。

配置文件在~/.config/i3/config,以下为我的config

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#

# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod4

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 8

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8

# Before i3 v4.8, we used to recommend this one as the default:
# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap
# font, it doesn’t scale on retina/hidpi displays.

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

bindsym $mod+Alt+l exec i3lock-fancy

# start a terminal
bindsym $mod+Return exec tilix

# kill focused window
bindsym $mod+Shift+q kill

# start dmenu (a program launcher)
bindsym $mod+d exec "rofi -show run"
# There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed.
# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right



# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+b split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10

# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym h resize shrink width 10 px or 10 ppt
        bindsym j resize grow height 10 px or 10 ppt
        bindsym k resize shrink height 10 px or 10 ppt
        bindsym l resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#bar {
        #status_command i3status
#}
exec --no-startup-id compton -b
exec --no-startup-id feh --randomize --bg-scale ~/Pictures/

#********************************************i3-gaps*********************************
for_window [class="^.*"] border pixel 0
gaps inner 8
gaps outer 6
set $mode_gaps Gaps: (o) outer, (i) inner
set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
bindsym $mod+Shift+g mode "$mode_gaps"

mode "$mode_gaps" {
        bindsym o      mode "$mode_gaps_outer"
        bindsym i      mode "$mode_gaps_inner"
        bindsym Return mode "default"
        bindsym Escape mode "default"
}

mode "$mode_gaps_inner" {
        bindsym plus  gaps inner current plus 5
        bindsym minus gaps inner current minus 5
        bindsym 0     gaps inner current set 0

        bindsym Shift+plus  gaps inner all plus 5
        bindsym Shift+minus gaps inner all minus 5
        bindsym Shift+0     gaps inner all set 0

        bindsym Return mode "default"
        bindsym Escape mode "default"
}
mode "$mode_gaps_outer" {
        bindsym plus  gaps outer current plus 5
        bindsym minus gaps outer current minus 5
        bindsym 0     gaps outer current set 0

        bindsym Shift+plus  gaps outer all plus 5
        bindsym Shift+minus gaps outer all minus 5
        bindsym Shift+0     gaps outer all set 0

        bindsym Return mode "default"
        bindsym Escape mode "default"
}

【可选】安装keynav

sudo apt install -y keynav

设置快捷键后可用来通过键盘使用鼠标操作,在启动keynav后,使用c+;激活,移动方法同VIM

以下为.keynavrc,可不进行配置,使用默认的即可

clear
ctrl+semicolon start
Escape end
ctrl+bracketleft end
w warp
space warp,click 1,end
Return warp,click 1,end
semicolon warp,end

q record ~/.keynav_macros
shift+at playback
a history-back
t windowzoom
c cursorzoom 300 300

1 warp,click 1
2 warp,click 2
3 warp,click 3
4 warp,click 4
5 warp,click 5
6 warp,click 6
7 warp,click 7

h cut-left
j cut-down
k cut-up
l cut-right
y cut-left,cut-up
u cut-right,cut-up
b cut-left,cut-down
n cut-right,cut-down

ctrl+h move-left
ctrl+j move-down
ctrl+k move-up
ctrl+l move-right
ctrl+y move-left,move-up
ctrl+u move-right,move-up
ctrl+b move-left,move-down
ctrl+n move-right,move-down

shift+h move-left
shift+j move-down
shift+k move-up
shift+l move-right
shift+y move-left,move-up
shift+u move-right,move-up
shift+b move-left,move-down
shift+n move-right,move-down

i warp,click 5
o warp,click 4

d drag 1
shift+d drag 1 ctrl+shift

大功告成!

ppO8vU1.md.png

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Ubuntu20.04 个人配置和i3美化 的相关文章

随机推荐

  • windows10远程桌面登录ubuntu20.04

    一 ubuntu系统共享设置 设置远程共享密码 xff0c 密码要记住 xff0c 一会在windows远程登陆的时候 xff0c 第二步要输入密码 二 安装xrdp sudo apt get install xrdp 三 安装dconf
  • 配置ArchLinux系统

    配置ArchLinux系统环境 文章目录 配置ArchLinux系统环境配置 96 AUR 96 中国源桌面环境安装登录管理器安装字体与其他附加组件安装驱动安装中文输入法安装 xff1a 优化配置 96 TRM 96 磁盘优化 96 tlp
  • Linux字体推荐

    Linux字体推荐 以下是Linux推荐的字体在不同Linux发行版的不同包装名称 xff0c 每款都很精致 xff0c 请欣赏 xff01 ArchLinux字体软件包名称Debian字体软件包名称Fedora字体软件包名称Gentoo字
  • 安装配置fcitx输入法

    安装配置fcitx输入法 文章目录 安装配置 96 fcitx 96 输入法安装输入法引擎可用的 96 fcitx 96 输入法包括 xff1a 中文日文其语言 可用的 96 fcitx5 96 输入法包括 xff1a 中文日文其他语言 输
  • 使用adb安装或卸载卸载手机系统应用

    使用adb安装 卸载手机系统应用 准备工具 在浏览器下载并打开带有adb的工具 xff1b 手机打开 开发者选项 xff0c 在 开发者选项 中开启usb调试并连接电脑 xff0c 手机端选择 传输文件 xff1b 在手机端点击 一律允许计
  • OpenWRT好用的插件

    PPP xff08 连接Internet共享 xff09 xff1a 用于让路由器到外网的连接 xff1b 资源占用小 xff0c 官网有相应版本可供下载 xff0c 软件包名称为 ppp mod pppoe Adblock xff08 广
  • Gentoo Linux查看已安装软件包

    Gentoo Linux查看已安装软件包 对于Gentoo Linux xff0c 需要一个名为Equery的软件来查看已安装软件包的信息 Equery是一个用于简化常用 Portage 操作的工具 此外 xff0c 可以显示包依赖项 元数
  • 2016 Personal Training #4 Div.2 A B C G H

    xff21 URAL 2091 题意 xff1a 有四个类别 xff11 xff0e xff21 和 xff22 都包含 xff0c xff12 xff0e 只包含 xff21 不包含 xff22 xff0c xff13 xff0e 只包含
  • Gentoo Linux系统清理

    Gentoo Linux系统清理 一 清除源码包文件 清除已经下载的软件包 xff0c 步骤如下 xff1a 在这一步中 xff0c 所使用的工具是rm命令 xff0c 将会强制删除 使用前 xff0c 请仔细检查所要删除的目录是否正确 x
  • Gentoo Linux卸载无用内核

    Gentoo Linux卸载无用内核 移除内核源代码 在安装新的内核并正常工作之后 xff0c 旧的内核就可以移除了 emerge的 depclean 选项 xff08 缩写为 c xff09 可以用来移除所有旧的或者不用的软件版本 xff
  • flink学习(一)---Maven配置简单易学

    一 下载Maven 进入官网http maven apache org 点击Download 进入官网之后 xff1a 我演示的是windows的配置步骤 xff1a 1 将安装包放入C盘 xff0c 进行解压 xff0c 将maven文件
  • eclipse括号风格改为独占一行风格

    一 原Eclipse生成的花括号 情形 public class test public static void main String args System out println 34 Eclipse 的花括号 xff08 brace
  • SecureCRT按Ctrl+S后假死问题

    SecureCRT作为著名的SSH客户端 xff0c 经常用于登陆远程服务器 在上面编辑文本 xff0c 特别是用vi打开两个文本 xff0c 并且需要切换时 xff0c 很容易出现卡死的现象 xff0c 不能接受任何的键盘输入 很是郁闷
  • dll和lib(包括静态链接库和与dll同时生成的lib)

    1 xff1a 神马是Dll和Lib xff0c 神马是静态链接和动态链接 大家都懂的 xff0c DLL就是动态链接库 xff0c LIB是静态链接库 DLL其实就是EXE xff0c 只不过没main 动态链接是相对于静态链接而言的 所
  • Doxyfile的使用

    Doxygen是一个开源软件 xff0c 它类似javadoc xff0c 能够根据源代码和源代码中特定格式的注释 xff0c 生成文档和UML图 xff08 如果要生成UML图 xff0c 需要下载可选组件Graphviz xff09 的
  • 微软亚洲研究院(MSRA)面经

    我最早把简历投给MSRA是在美国交换的时候 xff0c 大概11月左右吧 不过估计是因为那时候我人也不在国内 xff0c 11月也是个收实习生的淡季 xff0c 没什么空位子 xff0c 所以在美国期间他们也并没有打国际长途联系我 后来1月
  • VIM自动缩进等格式设置方法

    xff08 1 xff09 VIM的环境是根据读取的配置文件来设定的 xff0c 配置文件的位置通常在目录 etc 下面 xff0c 有个名为vimrc的文件 xff0c 这是系统中公共的vim配置文件 xff0c 对所有用户都有效 而在每
  • Visual C++调试 ASSERT()和TRACE()工具

    Visual C 43 43 IDE提供了功能强大的调试器 xff0c 包括联编 xff08 build xff09 工具和调试 xff08 debug xff09 工具 xff0c Visual C 43 43 的调试工具栏如图2 20所
  • 2016 Team Training #21 Gym 100952 A D E F J

    A 水题 题意 xff1a 两个人的时间分别是时 xff0c 分 xff0c 秒输入 xff0c 也就是让我们输出谁时间最早呗 思路 xff1a 没有思路直接上 xff0c 看手速了 xff08 我敲代码速度慢 xff09 代码如下 xff
  • Ubuntu20.04 个人配置和i3美化

    Ubuntu20 04 个人配置和i3美化 本文是基于个人习惯和审美 xff0c 快速配置一个新ubuntu的步骤 脚本在资源里给出 xff0c 但仍有部分配置文件需在脚本执行后手动修改 文中已用红色字体标出 更新apt源 备份原来的源更换