zoukankan      html  css  js  c++  java
  • 邪教日记之神兵篇: 一

    邪教日记之神兵篇: 一

    上篇讲到,我们历经磨难,终于入教了。入教之后干啥呢?当然是学武功一统江湖了-。-

    “武林至尊,宝刀屠龙;号令天下,莫敢不从。”

    想要一统江湖,当真需要一把神兵利器~

    这篇呢,咱就来打造一把神兵。

    ArchLinux-cn

    中国人嘛,用咱的仓库.

    PS: vim 配置从目录中找哦

    # 修改配置文件
    vim /etc/pacman.conf
    # 按大 G 键跳转到配置文件最后一行后按 O 键输入
    [archlinuxcn]
    SigLevel = Optional TrustedOnly
    Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
    # 保存退出
    
    # 更新系统哟
    sudo pacman -Syy
    # 写密钥
    sudo pacman -S archlinuxcn-keyring
    # 哦了
    

    神器 - YAY

    # 经过上面一通操作,可以装神器了
    sudo pacman -S yay
    

    桌面环境

    yay -S xorg-server xorg-xinit i3-gaps i3status i3lock-fancy polybar
    
    ##### 如果  有幸, 你出现了 Cannot find the strip binary required for object file stripping.
    ##### 那么 . 这样做
    pacman -Sy base-devel
    ##### 就解决了
    

    xinitrc

    # 开机启动 i3 怎么做
    cp /etc/X11/xinit/xinitrc ~/.xinitrc
    # 先删除空行
    sed -i -e '/^s*$/d' ~/.xinitrc
    

    插播一条新闻

    由于这里要频繁的使用命令行和 vim

    所以先把这两个搞搞.让自己也用着舒服点

    VIM 配置

    vim ~/.vimrc

    :set nu
    :noh
    set ignorecase
    set shortmess=atI
    syntax on
    autocmd InsertLeave * se nocul
    set ruler
    set showcmd
    set foldenable
    set foldmethod=manual
    set autowrite
    set cursorline
    set confirm
    set autoindent
    set cindent
    set tabstop=4
    set softtabstop=4
    set shiftwidth=4
    set noexpandtab
    set smarttab
    set hlsearch
    set incsearch
    set enc=utf-8
    set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
    set langmenu=zh_CN.UTF-8
    set showmatch
    set smartindent
    # 保存退出
    

    或者

    wget https://github.com/marquisXuan/configuration/blob/master/linux/.vimrc ~/.vimrc
    
    ZSH | oh-my-zsh
    # install 
    yay -S zsh
    
    # install oh-my-zsh
    sh -c "$(curl -fsSL http://git.oschina.net/yangchendong/oh-my-zsh/raw/master/tools/install.sh)"
    
    # 删除~/.zshrc文件中以#开头的注释行
    sed -i -e '/#/d' ~/.zshrc
    
    # 删除~/.zshrc文件中的空行
    sed -i -e '/^s*$/d' ~/.zshrc
    
    # download plugins
    git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
    
    # config plugins
    sed -i 's/fg=8/fg=6/g' ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
    
    # config zshrc
    vim ~/.zshrc
    
    ################# 修改对应内容 #################
    ZSH_THEME="agnoster"
    plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
    ################# 修改完毕 #################
    source ~/.zshrc
    # 看看效果. 没有安装 PowerLine 的可以先把 agnoster 改为 lambda 后面我会写怎么解决乱码的问题
    

    继续 xinitrc

     # copy 过来的 xinitrc 中有很多东西.我们都没有装.需要改下配置文件
    # 像 twm 啊 xclock 啊 xterm 啊等等.我都不用- -所以都删了
    # 上面安装了一个 i3-gaps 所以呢.咱们这么玩
    mkdir -p ~/.config/i3/log
    vim ~/.xinitrc
    ################# 文件内容 #################
    #!/bin/sh
    userresources=$HOME/.Xresources
    usermodmap=$HOME/.Xmodmap
    sysresources=/etc/X11/xinit/.Xresources
    sysmodmap=/etc/X11/xinit/.Xmodmap
    # merge in defaults and keymaps
    if [ -f $sysresources ]; then
        xrdb -merge $sysresources
    fi
    if [ -f $sysmodmap ]; then
        xmodmap $sysmodmap
    fi
    if [ -f "$userresources" ]; then
        xrdb -merge "$userresources"
    fi
    if [ -f "$usermodmap" ]; then
        xmodmap "$usermodmap"
    fi
    # start some nice programs
    if [ -d /etc/X11/xinit/xinitrc.d ] ; then
     for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
      [ -x "$f" ] && . "$f"
     done
     unset f
    fi
    # 在黑苹果中,这叫做啰嗦模式~.~
    exec i3 -V >> ~/.config/i3/log/i3log-$(date +'%F-%k-%M-%S') 2>&1
    ################# 文件内容结束 #################
    

    搞完之后 ,我们 reboot一下,在登陆后,我们执行 startx 大概其可以看到这样的画面

    PS: 此画面非虚拟机,而是我先装了一个 vnc 然后用来截图的~

    image-20200620095040161对没有看错,就是乱码加黑黑黑黑黑黑黑的一片.下面,教大家一步一步一步一步的打造一个好看的~实用的桌面

    i3

    乱码问题一
    # 安装一下中文字库
    yay -S adobe-source-han-sans-cn-fonts
    

    嗯 这下好看多了

    image-20200620095430766

    乱码问题二

    默认 i3 绑定了一个键位到 Alt 上.但是在没配置一些东西前,是不能用的,因为我们没有装默认的终端,而是装了一个 alacritty 的终端 ,简单的配置下

    vim ~/.config/i3/config
    
    # 1. 找到 set $mod Mod1 
    # Mod1 就是绑定的 Alt 键位
    # Mod4 就是 Win 键位,根据个人习惯自己改下哦~
    
    # 2. 找到 start a terminal 注释 bindsym $mod+Return exec i3-sensible-terminal 
    # 并添加
    bindsym $mod+Return exec alacritty
    # 保存退出
    # 按一下 alt + shift + r 后,按下 win + enter
    

    大概其就这样了,之所以这样,是因为~/.zshrc 中的 theme 用的是 agnoters 如果是 lambda 则不是这样的

    image-20200620100228011

    解决方案
    # 安装 powerline 字体
    cd /srv && sudo git clone https://github.com/powerline/fonts.git --depth=1
    # then 
    cd font && ./install
    

    嗯 .看看效果如何,是不是很好看?

    image-20200620114431373

    picom
    # 一个透明化的软件
    yay -S picom
    
    ROFI
    # 一个类似于 Windows中 listray,Mac 中 spotlight的软件
    yay -S rofi
    
    # 配置一下
    mkdir -p ~/.config/rofi
    rofi -dump-config > ~/.config/rofi/config.rasi
    
    # 同步让 i3 能用快捷键调用 
    vim ~/.config/i3/config
    # 搜索start dmenu 同样,注释,新增一行 其中Adapta-Nokto是主题
    bindsym $mod+d exec --no-startup-id rofi -show drun -theme Adapta-Nokto
    # 自己选择主题
    rofi-theme-selector
    # rofi 的配置文件随后附上
    

    大概其长这样

    image-20200620143314972干净利索.主题自己换哈.配置很多呢.

    命令行资源管理器
    yay -S ranger
    

    大概其长这样,还能预览图片哦

    image-20200620143711597

    i3Status

    屏幕下方的状态栏

    yay -S i3status
    # 还有个更好用的 poly
    yay -S polybar
    # 都是高度可定制化的状态栏
    # 后面附配置文件
    
    壁纸
    yay -S variety
    

    大概其是这样

    image-20200620144118024

    image-20200620144139080

    当然,我们不能这么启动,也是要加到 i3 的配置文件中的~

    Emmmmm ,要出去给娃检查了.先来一份~

  • 相关阅读:
    1014 Waiting in Line (30)(30 point(s))
    1013 Battle Over Cities (25)(25 point(s))
    1012 The Best Rank (25)(25 point(s))
    1011 World Cup Betting (20)(20 point(s))
    1010 Radix (25)(25 point(s))
    1009 Product of Polynomials (25)(25 point(s))
    1008 Elevator (20)(20 point(s))
    1007 Maximum Subsequence Sum (25)(25 point(s))
    1006 Sign In and Sign Out (25)(25 point(s))
    1005 Spell It Right (20)(20 point(s))
  • 原文地址:https://www.cnblogs.com/tdg-yyx/p/13168666.html
Copyright © 2011-2022 走看看