最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

ubuntu美化及解决使用zsh后无法运行ROS

互联网 admin 2浏览 0评论

ubuntu美化及解决使用zsh后无法运行ROS

文章目录

  • Ubuntu美化
    • 主题调整
    • 安装zsh
    • 安装on My Zsh
    • 安装PowerLine字体
    • 配置zsh主题
    • 配置插件
    • 配置颜色主题
  • 美化后问题解决
  • 效果展示
  • zsh主题的重新调整方法
  • 参考

Ubuntu美化


主要将zsh替换原先bash(zsh和bash一样是最流行的终端命令解释器)作为默认的Shell环境;另外安装gnome-tweaks配置系统主题、字体等设置。

主题调整

sudo apt install gnome-tweaks
  • 下载主题Mcata
    一款仿 macOS Catalina 的主题
  • 下载鼠标指针McMojave cursors

$ mkdir ~/.themes
$ mkdir ~/.icon

注意: 将下载好的主题和鼠标格式文件分别解压至 ~/.themes~/.icon目录下,然后就可以在gnome-tweaks工具中修改。
修改
对鼠标格式文件还需要运行以下命令:

cd ~/.icon/McMojave-cursors-master
sudo ./install.sh

然后即可在gnome-tweaks中修改鼠标格式

  • 安装图标Papirus(注意需要终端有代理,否则下载可能会异常中断)
$ sudo add-apt-repository ppa:papirus/papirus
$ sudo apt-get update
$ sudo apt-get install papirus-icon-theme

安装zsh

$ sudo apt install zsh
# 确认 zsh 成功安装
$ which zsh
# 设置为默认 Shell 此步可不执行,下面安装on my zsh后会提示更换默认shell为zsh
$ chsh -s /usr/bin/zsh

安装on My Zsh

#安装命令
$ sh -c "$(curl -fsSL .sh)"

注意:由于Wall的原因会导致curl命令执行出现以下报错

curl: (7) Failed to connect to raw.github.com port 443: Connection refused

解决方法:

  1. 终端走代理(对安装on my zsh 推荐使用export 命令链接代理)
  • ubuntu设置终端代理

  • Linux 让终端走代理的几种方法

  • Homebrew installation on Mac OS X Failed to connect to raw.githubusercontent.com port 443

  1. 修改host
  • 如何解决类似 curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused 的问题

安装PowerLine字体

下载Meslo LG M Regular Nerd Font Complete Mono到~/Downloads

sudo mkdir -p /usr/share/fonts/custom
cd ~/Downloads
sudo mv Meslo\ LG\ M\ Regular\ Nerd\ Font\ Complete\ Mono.ttf /usr/share/fonts/custom
sudo chmod 744 /usr/share/fonts/custom/Meslo\ LG\ M\ Regular\ Nerd\ Font\ Complete\ Mono.ttf 
cd /usr/share/fonts/custom/
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fv

安装完成后在gnome-tweaks中修改字体Fonts中的MonospaceMesloLGM Nerd Font Mono Regular

配置zsh主题

$ git clone --depth=1 .git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
$ sudo gedit ~/.zshrc

在~/.zshrc中修改ZSH_THEMEZSH_THEME="powerlevel10k/powerlevel10k"
重启zsh

$ exit

按照配置向导配置
如果想重新配置,使用如下命令

$ p10k configure

配置插件

添加自动补全和语法高亮的插件

$ git clone  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
$ git clone .git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

安装完成后打开~/.zshrc配置plugins=(git zsh-autosuggestions zsh-syntax-highlighting,重启终端

配置颜色主题

$ sudo apt-get install dconf-cli uuid-runtime
$ bash -c "$(wget -qO- )"

这里我选择的是03号Aci主题

  • Color Scheme for Gnome Terminal, Pantheon Terminal, Tilix, and XFCE4 Terminal

美化后问题解决

  • 运行roscore命令显示commond not found
    原因:此时终端解释器已经变更为zsh ,故之前在~/.bashrc中的设置需要重新在~/.zshrc中配置。
    原先在~/.bashrc中的配置:

    需在~/.zshrc中添加的配置

    对于此处修改的解释stackoverflow上有

    参考命令:
$ sudo gedit ~/.zshrc
$ #### after edit ~/.zshrc
$ source ~/.zshrc
  • 安装完zsh后打开新终端还需要输入命令zsh才能使用zsh
    安装On My Zsh

     sh -c "$(curl -fsSL .sh)"
    

    安装完成后重启电脑,再打开新终端就会默认使用zsh作为终端解释器,注意安装On My Zsh过程中会提示是否使用zsh作为默认解释器,要选择yes

  • 安装Powerlevel10k配置过程图标字符不能正常显示 ,例如第一个问题中钻石显示不正常,原因为没有使用Powerline 字体。使用gnome-tweaks修改使用MesloGM Nerd Font Mono字体格式。

效果展示

zsh主题的重新调整方法

Type p10k configure to access the builtin configuration wizard right from your terminal.

$ p10k configure

参考

  • ROS installation: no such file or directory
  • Ubuntu 美化与终端配置

ubuntu美化及解决使用zsh后无法运行ROS

文章目录

  • Ubuntu美化
    • 主题调整
    • 安装zsh
    • 安装on My Zsh
    • 安装PowerLine字体
    • 配置zsh主题
    • 配置插件
    • 配置颜色主题
  • 美化后问题解决
  • 效果展示
  • zsh主题的重新调整方法
  • 参考

Ubuntu美化


主要将zsh替换原先bash(zsh和bash一样是最流行的终端命令解释器)作为默认的Shell环境;另外安装gnome-tweaks配置系统主题、字体等设置。

主题调整

sudo apt install gnome-tweaks
  • 下载主题Mcata
    一款仿 macOS Catalina 的主题
  • 下载鼠标指针McMojave cursors

$ mkdir ~/.themes
$ mkdir ~/.icon

注意: 将下载好的主题和鼠标格式文件分别解压至 ~/.themes~/.icon目录下,然后就可以在gnome-tweaks工具中修改。
修改
对鼠标格式文件还需要运行以下命令:

cd ~/.icon/McMojave-cursors-master
sudo ./install.sh

然后即可在gnome-tweaks中修改鼠标格式

  • 安装图标Papirus(注意需要终端有代理,否则下载可能会异常中断)
$ sudo add-apt-repository ppa:papirus/papirus
$ sudo apt-get update
$ sudo apt-get install papirus-icon-theme

安装zsh

$ sudo apt install zsh
# 确认 zsh 成功安装
$ which zsh
# 设置为默认 Shell 此步可不执行,下面安装on my zsh后会提示更换默认shell为zsh
$ chsh -s /usr/bin/zsh

安装on My Zsh

#安装命令
$ sh -c "$(curl -fsSL .sh)"

注意:由于Wall的原因会导致curl命令执行出现以下报错

curl: (7) Failed to connect to raw.github.com port 443: Connection refused

解决方法:

  1. 终端走代理(对安装on my zsh 推荐使用export 命令链接代理)
  • ubuntu设置终端代理

  • Linux 让终端走代理的几种方法

  • Homebrew installation on Mac OS X Failed to connect to raw.githubusercontent.com port 443

  1. 修改host
  • 如何解决类似 curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused 的问题

安装PowerLine字体

下载Meslo LG M Regular Nerd Font Complete Mono到~/Downloads

sudo mkdir -p /usr/share/fonts/custom
cd ~/Downloads
sudo mv Meslo\ LG\ M\ Regular\ Nerd\ Font\ Complete\ Mono.ttf /usr/share/fonts/custom
sudo chmod 744 /usr/share/fonts/custom/Meslo\ LG\ M\ Regular\ Nerd\ Font\ Complete\ Mono.ttf 
cd /usr/share/fonts/custom/
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -fv

安装完成后在gnome-tweaks中修改字体Fonts中的MonospaceMesloLGM Nerd Font Mono Regular

配置zsh主题

$ git clone --depth=1 .git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
$ sudo gedit ~/.zshrc

在~/.zshrc中修改ZSH_THEMEZSH_THEME="powerlevel10k/powerlevel10k"
重启zsh

$ exit

按照配置向导配置
如果想重新配置,使用如下命令

$ p10k configure

配置插件

添加自动补全和语法高亮的插件

$ git clone  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
$ git clone .git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

安装完成后打开~/.zshrc配置plugins=(git zsh-autosuggestions zsh-syntax-highlighting,重启终端

配置颜色主题

$ sudo apt-get install dconf-cli uuid-runtime
$ bash -c "$(wget -qO- )"

这里我选择的是03号Aci主题

  • Color Scheme for Gnome Terminal, Pantheon Terminal, Tilix, and XFCE4 Terminal

美化后问题解决

  • 运行roscore命令显示commond not found
    原因:此时终端解释器已经变更为zsh ,故之前在~/.bashrc中的设置需要重新在~/.zshrc中配置。
    原先在~/.bashrc中的配置:

    需在~/.zshrc中添加的配置

    对于此处修改的解释stackoverflow上有

    参考命令:
$ sudo gedit ~/.zshrc
$ #### after edit ~/.zshrc
$ source ~/.zshrc
  • 安装完zsh后打开新终端还需要输入命令zsh才能使用zsh
    安装On My Zsh

     sh -c "$(curl -fsSL .sh)"
    

    安装完成后重启电脑,再打开新终端就会默认使用zsh作为终端解释器,注意安装On My Zsh过程中会提示是否使用zsh作为默认解释器,要选择yes

  • 安装Powerlevel10k配置过程图标字符不能正常显示 ,例如第一个问题中钻石显示不正常,原因为没有使用Powerline 字体。使用gnome-tweaks修改使用MesloGM Nerd Font Mono字体格式。

效果展示

zsh主题的重新调整方法

Type p10k configure to access the builtin configuration wizard right from your terminal.

$ p10k configure

参考

  • ROS installation: no such file or directory
  • Ubuntu 美化与终端配置
发布评论

评论列表 (0)

  1. 暂无评论