xiaomi pro 14 2021 联动 Ubuntu 22使用issue

写在前面,这篇帖子是我在使用ubuntu22.04遇到的一些问题和经验,本人开发小新一枚。

使用xiaomi pro 14 2021 && Ubuntu 22.0工作学习已经有一年时间了。虽然前几个月因为折腾一个合适自己的系统生态,导致重装过几次。但整体ubuntu带给我的感觉还是很优秀的。

基本上ubuntu的周边生态也比较完善,基本工作学习中需要用到的工具都有linux版或有不错的平替。并且很多网页工具都有PWA框架的支持,在ubuntu上也比较“原生态”。

这个笔记本来是自己记在yuque,自己留存的。最近有个学弟看上了我的系统,常常和他讨论ubuntu桌面的使用经验和遇到的问题。于是干脆就将这个笔记公开,万一有人需要呢。

(注意:本篇大部分内容都来自网络搜集,有的是原版,有的是二创。所以这篇帖子的版权链接就交给bing好了😊)

目前经过一年使用经验的xiaomi,已经有着不错的UI,触摸板手势,windows的一些使用习惯也可以无缝切换,还能保证不错的工作能力。

放张照片

(2023/11/10)

这篇笔记是很久之前就没有更新了,因为我的ubuntu桌面和周边已经趋于稳定。最近的一个大教训就是,如果已经用的很稳定了,就不要轻易更新系统。最近在ubuntu22.04LTS版本上更新了一下,结果无法识别我的显示器。。。

整个桌面的缩放比例真的一言难尽,怎么弄都没解决,都打算重装了。最后想着 “以毒攻毒”,再更新一把,就好了。。。😀

后续我会慢慢整理这个文章,去掉一些曾经的坑,补充一些新的内容,希望能让更多接触ubuntu系统的同学们从这个大合集中得到些许的帮助。

另外感谢,这个文章中出现的所有link(可能有些link漏掉了😢)

ubuntu常用软件

要下载什么软件推荐先到 https://snapcraft.io/store

snap商店

ubuntu .desktop sudo免密码运行

有些东西只能用root权限,比如如上这个idea的快捷方式,用普通用户就打不开,非要用root权限,所以就加sudo在Exec中,但前提是要sudo免密码运行

Ubuntu18.04 设置 sudo 免密码 不用输入密码的方法-CSDN博客

Ubuntu 通过修改.desktop文件 以root权限运行应用_滕青山ᅠ的博客-CSDN博客

命令行执行:

sudo visudo

%sudo ALL=(ALL:ALL) ALL下面添加一行

username  ALL=(ALL) NOPASSWD: ALL

之后按Ctrl+O,接着按回车确定保存文件。最后Ctrl+X退出编辑。

执行sudo ls可以看到已经不需要密码了。

接着修改桌面程序

Exec=sudo /home/akio/tools/Jetbrains/idea-IU-222.4345.14/bin/idea.sh

这样点击图标就能以root角色运行

ubuntu 安装firefox

Ubuntu上安装Firefox浏览器_ubuntu安装firefox-CSDN博客

[Desktop Entry]
Name=firefox
Name[zh_CN]=火狐浏览器
Comment=火狐浏览器
Exec=/opt/firefox/firefox
Icon=/opt/firefox/browser/chrome/icons/default/default128.png
Terminal=false
Type=Application
Categories=Application;
Encoding=UTF-8
StartupNotify=true
————————————————
版权声明:本文为CSDN博主「极乐谷2」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u012815136/article/details/121441988

ubuntu系统使用firefox无法观看b站/网易云

Ubuntu Firefox不能看视频·解决方法 - 知乎

sudo apt-get install ubuntu-restricted-extras基本上这条命令就ok

dpkg安装deb软件如何卸载

在Ubuntu中使用dpkg命令卸载软件的方法_Ubuntu/Debian_操作系统_脚本之家

dpkg -l 'touc*'查看安装了哪些libreoffice开头的应用

选择 dpkg -P来卸载软件。因为dpkg --remove只是删除安装的文件,但不删除配置文件。而dpkg --purge则安装文件和配置文件都删除。

双系统如何校准时间

双系统时间错乱解决办法-CSDN博客

ubuntu 微信docker

https://hub.docker.com/r/bestwu/wechat

docker pull bestwu/wechat

    docker run -d --name wechat --device /dev/snd \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v $HOME/WeChatFiles:/WeChatFiles \
    -e DISPLAY=unix$DISPLAY \
    -e XMODIFIERS=@im=fcitx \
    -e QT_IM_MODULE=fcitx \
    -e GTK_IM_MODULE=fcitx \
    -e AUDIO_GID=`getent group audio | cut -d: -f3` \
    -e GID=`id -g` \
    -e UID=`id -u` \
    bestwu/wechat

不过还是推荐优麒麟官网的

应用下载-优麒麟|Linux 开源操作系统

ubuntu启动utools出了问题

解决ubuntu 22.04安装utools报错的问题(旧版本依赖缺失所致)_libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb-CSDN博客

http://launchpadlibrarian.net/429731834/libssl1.1_1.1.1c-1ubuntu3_amd64.deb

ubuntu安装JDK

如何在Ubuntu系统下安装JDK_ubuntu安装jdk-CSDN博客

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk

那么ubuntu的jdk在哪呢?一般都在/usr/lib/jvm/java-11-openjdk-amd64

ubuntu如何切换JDK版本

采用update-alternatives命令进行版本切换

先使用sudo update-alternatives --config java看看有哪些可切换的项目

但是其中显然没有/usr/lib/jvm/java-8-openjdk-amd64/bin/java,当然其实也可以不加,如下步骤是为了演示如何添加

可以去目录/usr/lib/jvm下看看

然后使用sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-8-openjdk-amd64/bin/java 1070添加进去

然后直接使用sudo update-alternatives --config java选择自己需要的JDK。如果发现版本没变,看看root角色

当然还有其他的变更方式

sudo update-alternatives --auto java
sudo update-alternatives --auto javac
sudo update-alternatives --auto javap
sudo update-alternatives --auto javah
sudo update-alternatives --auto jconsole
sudo update-alternatives --auto jshell

ubuntu安装maven

Ubuntu下Maven安装和使用_ubuntu安装maven-CSDN博客

https://dlcdn.apache.org/maven/maven-3/3.6.3/

下载bin包,解压到地方后

推荐这个mavenhome的位置,如果是当服务器用,就放在/user/local

设置环境变量vim /etc/profile

export MAVEN3_HOME=/root/tools/apache-maven-3.6.3
PATH=$MAVEN3_HOME/bin:$PATH

一定是这种格式,写错了然后source就难搞了

然后保存source /etc/profile

mvn -v验证配置是否成功

找个位置创建一个文件夹 不要自己设置了,就用原生的,就改下aliyun镜像

然后设置conf/settings.xml文件

<localRepository>/home/akio/tools/apache-maven-3.6.3/maven_repository</localRepository>

然后设置国内镜像

<mirror>
  <id>alimaven</id>
  <name>aliyun maven</name>
  <url>https://maven.aliyun.com/repository/public</url>
  <mirrorOf>central</mirrorOf>        
</mirror>
————————————————
版权声明:本文为CSDN博主「ac_dao_di」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ac_dao_di/article/details/54233520

推荐复制一份这个setting.xml到.m2文件夹下, 可能是第一次装maven,没有执行过任何相关的maven命令,所以就自己mkdir一个.m2文件夹

因为基本default的寻找路径就是这个

然后注意idea中就这样设置

ubuntu触摸板手势(❤❤❤❤❤)

x11的窗口协议,触摸板手势太俗了,用这个可以丰富手势操作

wayland的窗口协议默认就支持很多手势,但是腾讯会议不支持wayland😥

可以参考这个,更详细 https://blog.csdn.net/Grantr/article/details/133457456

【精选】【Ubuntu使用手记】配置触控板手势_touchegg-CSDN博客

sudo add-apt-repository ppa:touchegg/stable
sudo apt update
sudo apt install touchegg

安装完成后使用touchegg命令启动应用,重启电脑后touchegg会自动启动。

创建默认配置文件

mkdir -p ~/.config/touchegg && cp -n /usr/share/touchegg/touchegg.conf ~/.config/touchegg/touchegg.conf

非wanlany

使用touchegg,以下是我的conf

需要注意的是,这里的<action type="SEND_KEYS">的手势,都是基于你的自定义快捷键

如此处我将shift+super+右设置为将窗口右移一个工作区,那么我可以进行如下配置

<gesture type="SWIPE" fingers="4" direction="LEFT">
	  <action type="SEND_KEYS">
	    <repeat>true</repeat>
	    <modifiers>Super_L</modifiers>
	    <keys>Shift_L+Left</keys>
	  </action>
	</gesture>

	<gesture type="SWIPE" fingers="4" direction="RIGHT">
	  <action type="SEND_KEYS">
	    <repeat>true</repeat>
	    <modifiers>Super_L</modifiers>
	    <keys>Shift_L+Right</keys>
	  </action>
	</gesture>
<touchégg>
  <settings>
    <property name="animation_delay">150</property>
    <property name="action_execute_threshold">20</property>
    <property name="color">auto</property>
    <property name="borderColor">auto</property>
  </settings>
  <application name="All">
    <gesture type="SWIPE" fingers="3" direction="UP">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L</modifiers>
        <keys>S</keys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="UP">
      <action type="SEND_KEYS">
        <repeat>false</repeat>
        <modifiers>Super_L</modifiers>
        <keys>A</keys>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="3" direction="DOWN">
      <action type="MINIMIZE_WINDOW">
        <animate>true</animate>
      </action>
    </gesture>
    <gesture type="SWIPE" fingers="4" direction="DOWN">
      <action type="CHANGE_DESKTOP">
        <direction>auto</direction>
        <animate>true</animate>
        <animationPosition>auto</animationPosition>
      </action>
    </gesture>
	<gesture type="SWIPE" fingers="4" direction="LEFT">
	  <action type="SEND_KEYS">
	    <repeat>true</repeat>
	    <modifiers>Alt_L</modifiers>
	    <keys>Shift_L+Tab</keys>
	    <decreaseKeys>Tab</decreaseKeys>
	  </action>
	</gesture>

	<gesture type="SWIPE" fingers="4" direction="RIGHT">
	  <action type="SEND_KEYS">
	    <repeat>true</repeat>
	    <modifiers>Alt_L</modifiers>
	    <keys>Tab</keys>
	    <decreaseKeys>Shift_L+Tab</decreaseKeys>
	  </action>
	</gesture>
    <gesture type="PINCH" fingers="4" direction="OUT">
      <action type="SHOW_DESKTOP">
        <animate>true</animate>
      </action>
    </gesture>
    <gesture type="TAP" fingers="2" direction="UNKNOWN">
      <action type="MOUSE_CLICK">
        <button>3</button>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="TAP" fingers="3" direction="UNKNOWN">
      <action type="MOUSE_CLICK">
        <button>2</button>
        <on>begin</on>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="3" direction="IN">
      <action type="CLOSE_WINDOW"></action>
    </gesture>
    <!--
	    <gesture type="SWIPE" fingers="3" direction="LEFT">
	      <action type="CHANGE_DESKTOP"></action>
	    </gesture>
	    <gesture type="SWIPE" fingers="3" direction="RIGHT">
	      <action type="CHANGE_DESKTOP"></action>
	    </gesture>
    -->
    <gesture type="SWIPE" fingers="3" direction="LEFT">
  	<action type="CHANGE_DESKTOP">
    	<direction>next</direction>
    	<animate>true</animate>
    	<animationPosition>right</animationPosition>
    	<color>3E9FED</color>
    	<borderColor>3E9FED</borderColor>
  	</action>
    </gesture>

	<gesture type="SWIPE" fingers="3" direction="RIGHT">
	  <action type="CHANGE_DESKTOP">
	    <direction>previous</direction>
	    <animate>true</animate>
	    <animationPosition>left</animationPosition>
	    <color>3E9FED</color>
	    <borderColor>3E9FED</borderColor>
	  </action>
	</gesture>
	
  </application>
  <application name="chromium-browser">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>
  <application name="firefox">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>
  <application name="google-chrome">
    <gesture type="PINCH" fingers="2" direction="IN">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Subtract</keys>
        <decreaseKeys>KP_Add</decreaseKeys>
      </action>
    </gesture>
    <gesture type="PINCH" fingers="2" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <modifiers>Control_L</modifiers>
        <keys>KP_Add</keys>
        <decreaseKeys>KP_Subtract</decreaseKeys>
      </action>
    </gesture>
  </application>
</touchégg>

ubuntu使用super+e打开文件夹

命令nautilus

ubuntu麦克风和音量过小

使用alsamixer调整

F6选择对应的声卡调整音量

如何提高Linux系统音量-百度经验

使用pavucontrol进行调整音量

安装apt install pulseaudio

apt install pavucontrol

安装完成后直接pavucontrol回车

ubuntu在命令行快速打开对应位置的文件管理器

nautilus ./

ubuntu 邮箱,这个真的绝(❤❤❤❤)

UI还挺好看,也可以登录office365邮箱

Install BlueMail - Email & Calendar on Linux | Snap Store

snap install bluemail

还有这个邮箱(是bluemail一个体系的)Install Blix on Linux | Snap Store ,也很绝

ubuntu outlook网页版脱壳(❤)

可以用网页版outlook(用Edge打开outlook,之后作为应用安装到电脑,就能获得媲美原生应用的体验)

这个Prospect mail体验并不是很好,而且我的桌面被这个卡死过几次。可能不是普遍情况

Install Prospect Mail on Linux | Snap Store

ubuntu 的mailspring邮箱(❤❤)

不知道是不是我不会登录,折腾了很久没登进去😓

snap install mailspring这个邮箱也可以

登陆qq的时候注意,此处的server要改一下,改成如下图

ubuntu的wps字体缺失

Ubuntu(64位)安装WPS并给出字体缺失问题的解决办法_巫山之云的博客-CSDN博客

出现提示的原因是因为WPS For Linux的字体版权问题,安装包内没有自带Windows的字体,用户只能在Linux系统中自己加载字体。

具体的解决步骤如下:

下载缺失的字体文件,下载地址:

链接: 百度网盘 请输入提取码

提取码: m5jw

下载后解压字体包,将解压后的文件直接复制到Linux系统中的/usr/share/fonts/wps-office文件夹中,没有fonts文件夹的就直接建立一个,然后把文件复制进去。

接着在终端中依次输入以下命令:

sudo cp mtextra.ttf  symbol.ttf  WEBDINGS.TTF  wingding.ttf  WINGDNG2.ttf  WINGDNG3.ttf  /usr/share/fonts
sudo mkfontscale  
sudo mkfontdir   
sudo fc-cache   

ubuntu下WPS占用高

最新版WPS CPU占比高- Community - Deepin Technology

可能是因为wps的云服务后台开启,如果不需要云服务,就可以关掉

sudo chmod 000 /opt/kingsoft/wps-office/office6/wpscloudsvr

ubuntu平替wps

下载ONLYOFFICE桌面编辑软件。完全免费 | ONLYOFFICE

Install onlyoffice-desktopeditors on Linux | Snap Store

sudo snap install onlyoffice-desktopeditors

ubuntu teams outlook

teams-for-linux download | SourceForge.net

ubuntu下状态监控

psensor这款软件

s-tui这款命令行监控

$ sudo apt install python-pip stress

$ sudo pip install s-tui(如果是Python 3.x,替换“pip”为“pip3”)

$ sudo s-tui

ubuntu创建交换分区

ubuntu 交换空间的设置应该考虑到是否开启休眠功能,因为笔记本休眠的时候,会将内存中的数据转移到交换空间

16.17.5. Recommended Partitioning Scheme Red Hat Enterprise Linux 6 | Red Hat Customer Portal

Ubuntu下调整SWAP交换空间-腾讯云开发者社区-腾讯云

SWAP 分区可以在系统运行内存不足时将一部分未使用的内存文件转存在此分区以减轻动态内存的压力,SWAP 分区以专用的 SWAP 格式存在于硬盘当中。下面将介绍在 Ubuntu 中如何调整 SWAP 分区的空间及 SWAP 分区的活跃度。

创建 SWAP 分区

检查是否已启用 SWAP 空间

sudo swapon --show #未启用SWAP分区的话,执行此命令将不会有任何输出

创建 SWAP 文件

在添加 SWAP 文件时,建议创建的文件大小为实际物理内存的 2-3 倍。

sudo fallocate -l 2G /swapfile #创建大小依据实际物理内存大小自行调整

或使用dd命令创建 sudo dd if=/dev/zero of=/swapfile bs=512M count=4

创建完成后,给与 SWAP 文件 600 权限

sudo chmod 600 /swapfile

标注 SWAP 区域

sudo mkswap /swapfile

激活 SWAP 分区

sudo swapon /swapfile

查看 SWAP 分区是否工作

sudo swapon --show sudo free -h

将创建的 SWAP 分区设置为永久分区,将 SWAP 路径写入到/etc/fstab文件中(一般来说自动就加好了)

/swapfile swap swap defaults 0 0

删除 SWAP 分区

停用 SWAP

sudo swapoff -v /swapfile

在/etc/fstab文件中删除 SWAP 路径。 删除 SWAP 分区文件

sudo rm /swapfile

Swappiness 用于定义 Linux 系统使用 SWAP 空间的频率。Swappiness 值可以从 0 至 100,较低的值会让内核尽可能少的使用 SWAP 空间,而较高的值将让 Linux Kernel 能够更加积极地使用 SWAP 分区。默认的 Swappiness 值为 60,这里可以根据实际需要自行调整。

调整 SWAP 分区活跃度(Swappiness)

查看当前系统设置的 Swappiness 值

cat /proc/sys/vm/swappiness

临时调整系统 Swappiness 值

sudo sysctl vm.swappiness=60 #这里的值可以设置在0-100,根据环境需求自行调整

设置永久性的 Swappiness 值

编辑/etc/sysctl.conf文件,在最后添加以下内容

vm.swappiness=10

ubuntu火焰截图使用问题

思路来源

Fails when fractional scaling <> 100% · Issue #564 · flameshot-org/flameshot · GitHub

Wrong GUI when using multi-monitor · Issue #1386 · flameshot-org/flameshot · GitHub

使用火焰截图的时候,因为我显示器设置的是150%的比例,所以使用火焰截图会闪来闪去,忽大忽小

这是因为比例缩放和QT造成的问题

解决办法

写一个脚本

添加执行权限sudo chmod 755 flameshot.sh

然后快捷键调用这个脚本

#!/bin/sh
export QT_AUTO_SCREEN_SCALE_FACTOR=2;
export QT_SCREEN_SCALE_FACTORS="1;1.50";
/usr/bin/flameshot gui

还可直接当作环境变量来执行

env QT_AUTO_SCREEN_SCALE_FACTOR=2;

ubuntu安装nvm

去github上下载nvm的release包,就装这个v0.39.2

Release v0.39.2 · nvm-sh/nvm · GitHub

阿里云盘也有的

# 解压
tar -zxvf nvm-0.39.1.tar.gz

# 进入目录
cd nvm-0.39.1

# 执行 install.sh
bash install.sh

# 输出
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

# 重启当前终端即使用
nvm -v

# 输出
0.39.1

ubuntu 迅雷

迅雷下载v1.0.0.1 for linux- Community - Deepin Technology

linux 迅雷使用基于 “Electron” 的软件框架,使界面响应将更加流畅,文字显示效果更加清晰细腻。

PS:此版本为基础适配版,仅支持账号登录、常规下载等基础功能,暂不提供会员账号标识、会员加速、内嵌浏览器拉起、内嵌播放器、自定义换肤、悬浮球、展示下载任务曲线详情等功能。

x86版本下载 http://archive.kylinos.cn/kylin/partner/pool/com.xunlei.download_1.0.0.1_amd64.deb

arm版本下载 http://archive.kylinos.cn/kylin/partner/pool/com.xunlei.download_1.0.0.1_arm64.deb

ubuntu 百度网盘

百度网盘 客户端下载

Ubuntu磁盘挂载

如何为 Ubuntu 扩容(添加新的硬盘空间)?_ubuntu扩展磁盘空间_X_Imagine的博客-CSDN博客

Ubuntu输入法Fcitx5

Ubuntu22.04安装Fcitx5中文输入法(详细) - 知乎

主题使用

https://www.cnblogs.com/maicss/p/15056420.html

打开~/.local/share/fcitx5/themes,将下载的包解压到此处重启输入法即可

打字的时候希望拼音在输入法上

关掉嵌入式预编辑就好啦,注意先要根据快捷键切换到禁止嵌入式预编辑,然后把他干掉

中文使用中文的标点符号

主要因为中文输入的标点符号是全角,这里勾选了,所以去掉即可

中文状态下输入【】

fcitx5中文输入法输入中文方括号“【】”问题_HKing147的博客-CSDN博客

编辑sudo vim /usr/share/fcitx5/punctuation/punc.mb.zh_CN

修改对应的位置

[ 【
] 】

编辑完成后重启fcitx5

中文状态下按两次;才能打出;

这是因为拼音的快速输入以;作为快捷键,快速输入一般都是用来输入表情包啥的

把这里的快捷键取消就好了

Fcitx5无法在vscode中唤起/vscode快速下载

无法在vscode中唤起输入法 · Issue #458 · fcitx/fcitx5 · GitHub

这个问题只在通过snap安装的vscode发生,解决方法,直接安装vscode官网的

还在因为vscode官方下载慢而头疼嘛,按这个步骤来直接起飞兄弟萌

首先进入vscode官方网站然后选择对应版本下载

然后进入浏览器下载页面

复制下载链接粘贴到地址栏

将地址中的/stable前换成vscode.cdn.azure.cn

即可实现超速下载

https://vscode.cdn.azure.cn/stable/441438abd1ac652551dbe4d408dfcec8a499b8bf/code_1.75.1-1675893397_amd64.deb

ubuntu视频软件

apt-get install smplayer

ubuntu视频剪辑软件

apt-get install shotcut

ubuntu下载OBS

sudo add-apt-repository ppa:obsproject/obs-studio

sudo apt install obs-studio

ubuntu磁盘管理工具

apt install gparted

ubuntu快捷键回到桌面

ubuntu快捷键回到桌面是super+ctrl+d,可以直接修改

ubuntu打开终端

alt+F2 输入gnome-terminal

ubuntu图形界面异常

今天ubuntu系统安装steam的时候,被卸载了gdm3, 这是个渲染桌面的插件就从图形界面中退出来了,变成了命令行

Ubuntu系统启动后直接进入tty1界面怎么办?我们要如何重新进入图形界面?_ubuntu2004 只进入tty-CSDN博客

建议是先安装gdm3

apt install gdm3

然后配置

dpkg-reconfigure gdm3

重启成功后的页面看有无需要,然后决定是否重新安装ubuntu-desktop

ubuntu系统状态栏显示检测

Ubuntu状态栏显示网速,内存利用率等信息——sysmonitor-CSDN博客

Indicator Sysmonitor in Launchpad

然后配合颜文字

现在我用的是

ubuntu展示天气

在Ubuntu 20.04的时钟菜单中显示当前天气 - Linux迷

Projects/GnomeShellIntegration/Installation - GNOME Wiki!

首先安装apt install gnome-weather,这个好像可以不要

然后安装apt install chrome-gnome-shell,天气装完之后就可以卸载掉了,但是再进入extensions.gnome.org就会显示install,而不是ON/OFF,所以不建议删

GNOME Shell integration – 下载 🦊 Firefox 扩展(zh-CN) 然后装个扩展

然后打开火狐输入extensions.gnome.org,搜索weather

ubuntu比较器

apt-get install meld

ubuntu脑图

Download - Xmind - Mind Mapping App

ubuntu 微软todo代替品kuro

Install Kuro on Linux | Snap Store

snap install kuro-desktop

其实就相当于网页版todo ,但是有了ferdium,这个完全可以不要

ubuntu disk scanner

Install Easy Disk Cleaner on Linux | Snap Store

ubuntu网页应用综合者ferdium(不好用,容易掉帐号outlook,todo)

Install ferdium on Linux | Snap Store

ubuntu 安装网易云音乐error

直接cd到/opt/netease/netease-cloud-music编辑netease-cloud-music.bash

多加一行cd /lib/x86_64-linux-gnu/

但是发现网易云打开后在高分辨率下非常小

需要cd到/usr/share/applications/编辑网易云的desktop,加--force-device-scale-factor=2.0

--high-dpi-support=1表示默认最大化

ubuntu下的SFTP工具

FileZilla或者SFTPClient

https://snapcraft.io/sftpclient

snap install sftpclient

ubuntu下密码管理工具

bitwarden

sudo snap install bitwarden

别用snap这个包,有很多问题,直接官网下载deb

ubuntu下sharepoint代替工具

Download ExpanDrive | ExpanDrive

ubuntu中curl下载sharepoint文件

Linux命令行下载OneDrive分享链接中的文件 - 高玩梁的博客

今天客户给我分享了个这样的链接

https://dx-my.sharepoint.com/:x:/p/akio/EThS_OOUJVORcp_NGNSy1w?e=t5

点击后是个sharepoint online

ubuntu wps 代替品 onlyoffice

下载 ONLYOFFICE Docs | ONLYOFFICE

ubuntu远程桌面windows或其他

需求:通过ubuntu远程桌面windows


方式一:使用rdestop

sudo apt install rdesktop

安装完毕后,直接使用

rdeskto ip地址 -f -z -a 16 -x lan

然后就会直接进入全屏远程桌面,直接输入用户名密码即可

注意ctrl+alt+enter可以调整全屏

但是使用这个有个前提

方式二:Remmina

apt-get install remmina remmina-plugin-* 安装

方式三:anydesktop

感谢您下载AnyDesk!

我没有尝试过这个

ubuntu系统调度优化

Ubuntu系统优化 - 知乎

如下一定不要在root用户下执行,而要在自己的用户akio下执行

ubuntu系统优化相关

10个简单步骤,优化加速Ubuntu系统性能 - 系统极客

Ubuntu 20.04 优化 - 大大的小蜗牛

ubuntu减少积极使用交换空间Swap占比

Linux 交换空间优化(swap 优化)(积极使用交换空间占比,可能会使程序运行缓慢!)_swap优化_Dontla的博客-CSDN博客

linux 2.6+的核心会使用硬盘的一部分做为SWAP分区,用来进行进程调度–进程是正在运行的程序–把当前不用的进程调成‘等待(standby)‘,甚至‘睡眠(sleep)’,一旦要用,再调成‘活动(active)’,睡眠的进程就躺到SWAP分区睡大觉,把内存空出来让给‘活动’的进程。

如果内存够大,应当告诉 linux 不必太多的使用 SWAP 分区, 可以通过修改 swappiness 的数值。swappiness=0的时候表示最大限度使用物理内存,然后才是 swap空间,swappiness=100的时候表示积极的使用swap分区,并且把内存上的数据及时的搬运到swap空间里面。

在ubuntu 里面,默认设置swappiness这个值等于60。

cat /proc/sys/vm/swappiness

sudo gedit /etc/sysctl.conf

文档最后一行加上vm.swappiness=10

然后重启

ubuntu docker以及docker-compose的安装

Install docker on Linux | Snap Store

snap install docker

Ubuntu 20.04 优化 - 大大的小蜗牛

sudo apt remove docker docker-engine docker.io containerd runc
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -   # root用户执行
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt install -y docker-ce docker-ce-cli containerd.io
docker version
sudo docker run hello-world

但是使用docker ps时候报错permission denied

sudo gpasswd -a [用户名] docker #将普通用户username加入到docker组
newgrp docker  #更新docker组

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

ubuntu 优化工具

【Linux】42.Ubuntu 18.04笔记本电脑关闭盖子无法唤醒问题解决_乌班图笔记本关闭盖子-CSDN博客

apt install gnome-tweaks

ubuntu默认dock的设置

安装Ubuntu 22.04 LTS后设置漂亮的DOCK_ubuntu美化dock-CSDN博客

#将dock移动到窗口底部位置,如果习惯左边也可以不执行该行命令
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position "BOTTOM"
#根据屏幕大小,给dock中的图标设置一个合适的大小值,习惯为64,48或32
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32
#居中显示
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
#移动鼠标到dock位置时自动显示
gsettings set org.gnome.shell.extensions.dash-to-dock autohide true
#全屏模式时自动隐藏Dock
gsettings set org.gnome.shell.extensions.dash-to-dock autohide-in-fullscreen true
#默认隐藏DOCK
gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed false
#隐藏延迟时间,通过该时间可以解决因DOCK隐藏导致菜单移动的问题,默认0.2
gsettings set org.gnome.shell.extensions.dash-to-dock hide-delay 10.0
#设置“应用”图标为左边,根据个人习惯,习惯右边的可以不用执行该行
gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true
#点击DOCK中的图标后缩小应用窗口 默认为'previews'
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

像顶部栏一样,当没有窗户最大化或与其齐平时,dock将呈现半透明状态,当窗户与其接触时,会变成坚固的灰色/黑色阴影。

由于Ubuntu Dock基于定制的“Dash to Dock”,因此有很多方法可以重新启用透明功能。

最简单的是通过命令行使用dconf,只需在选择的终端仿真器中单独输入以下命令集。

首先,要使Ubuntu Dock透明启用透明模式:

settings set org.gnome.shell.extensions.dash-to-dock transparency-mode 'FIXED'

然后,将透明度级别设置为80%(或你想要的任何其他值):

gsettings set org.gnome.shell.extensions.dash-to-dock background-opacity 0.2

值0.0是100%不透明(即实心),值为0.2等于80%,依此类推。

要恢复/撤消这些更改,只需运行以下命令:

gsettings reset org.gnome.shell.extensions.dash-to-dock background-opacity
————————————————
版权声明:本文为CSDN博主「mydirector」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/mydirector/article/details/123503017

sudo apt install chrome-gnome-shell

安装此扩展之后发现,就算删除,也会影响到原生的dock,所以可以影响后删除

Dash to Dock - GNOME Shell Extensions

千万别装,可能会有问题,如下可参考

https://bynss.com/linux/937033.htm

使用 ctrl+alt+t 键打开终端命令行应用程序并运行以下命令以在您的系统上安装最新版本的 Dconf 编辑器。

sudo apt install dconf-editor

安装成功后通过这个命令打开

dconf-editor

您也可以通过应用程序菜单打开它。

l

ubuntu设置topbar透明

reference: 如何将ubuntu中的顶部任务栏变成半透明_ubuntu22.04顶栏透明-CSDN博客

Ubuntu18.04解决gnome-tweak-tool安装后shell主题提示user-theme extension没有启用的问题_shell用户主题扩展未启用-CSDN博客

User Themes - GNOME Shell Extensions

调整的前提是你安装了apt-get install gnome-tweak-tool这个插件

注意,如果这个shell处于未启用状态,可以User Themes - GNOME Shell Extensions ,安装下,然后重新打开这个"优化"即可选择对应主题

然后我们就可以去修改这个对应主题的一些css样式

cd到/usr/share/gnome-shell/theme

找到你的主题,修改gnome-shell.css

修改这个background-color即可

然后重新应用shell主题

ubuntu一些美化操作

ubuntu美化1——主题、图标、dock-CSDN博客

ubuntu有意思的扩展

定期执行命令并输出到topbar上

Executor - GNOME Shell Extensions

一个todo

Todo.txt - GNOME Shell Extensions

topbar的图标显示

BaBar Task Bar - GNOME Shell Extensions

cpufreq (❤❤❤❤❤)

这个可以控制cpu的频率,因为我用的是xiaomi pro 14,一个超大问题,发热严重。。。

通过这个可以将cpu频率控制在1.2或1.3,基本上办公使用,重度开发都在40~50°

当然,看视频啥的要用点核显就会热起来了,降频也没啥用。不过我一般不用笔记本看视频啥的

可以直接控制cpu的运行模式

cpufreq - GNOME Shell Extensions

topbar上的task todo

TaskWhisperer - GNOME Shell Extensions

topbar上的任务栏,非常丝滑

Rocketbar - GNOME Shell Extensions

topbar上的,可以鼠标滑动的任务栏

Dash to Panel - GNOME Shell Extensions

ubuntu久坐提醒弹窗的制作

ubuntu实现定时弹窗-腾讯云开发者社区-腾讯云

简介

最近在头条上看到,长期久坐8小时以上会影响生育能力,突然有点慌,作为一个IT工作者,8小时....然后我这人没有喝水的习惯,经常专注电脑,就想着,有没有什么办法可以定时提醒你喝水,休息的。

方法

因为我用的是ubuntu,用到提醒功能就让我想起了notify-send命令。 notify-send是一个可以让你发送桌面通知的命令. 它的语法非常简单:

notify-send [其他选项...] 标题 [内容]

提醒解决了,那怎么实现定时功能呢。 通过我的查阅,我找到了crontab这个命令

在LINUX中,周期执行的任务一般由cron这个守护进程来处理[ps -ef|grep cron]。cron读取一个或多个配置文件,这些配置文件中包含了命令行及其调用时间。
cron的配置文件称为“crontab”,是“cron table”的简写。

实现方式

vi time.cron //创建一个cron脚本

输入

0 */1.5 * * * export DISPLAY=:0.0; notify-send ["该休息一下啦"] "喝水!伸懒腰!>动一动!"

不过好像上面这种方式我没实现

换种方式ubuntu定时执行任务_ubuntu 定时任务-CSDN博客

crontab -e

或者这种方式Linux之crontab -e定时任务_crontab e-CSDN博客

ubuntu 睡眠挂起后无法唤醒

Linux长时间睡眠无法唤醒,Ubuntu下笔记本“休眠到内存”后经常不能恢复,不能唤醒的解决方案...-CSDN博客

以下方法都试过,目前在这个电脑上不好用,但是看了上面这个帖子,决定使用pm-utils试试

sudo apt-get install pm-utils

https://www.cnblogs.com/cocode/p/14253404.html

#!/bin/sh
VERSION="$(sudo strings /sys/firmware/acpi/tables/DSDT | grep -i 'windows ' | sort | tail -1)"
echo 'Linux kernel command-line options required: acpi_osi=! "acpi_osi='$VERSION'"'
read -p "Do you want to add this setting (y/n) ? " answer
if [ x$answer != xY -a x$answer != xy ]; then
  exit 1
fi
echo "Existing Command Line: ` sed -n '/.*linux[[:space:]].*root=\(.*\)/{s//BOOT_IMAGE=\1/ p;q;}' /boot/grub/grub.cfg `"
if grep -m 1 'acpi_osi=Windows' -q /etc/default/grub; then
  echo "There is already an entry; please remove it from /etc/default/grub and redo 'sudo update-grub' then re-run this script"
  exit 2
fi
sudo sed -i "s/^\(GRUB_CMDLINE_LINUX=.*\)\"$/\1 acpi_osi=! \\\\\"acpi_osi=$VERSION\\\\\"\"/" /etc/default/grub
echo "Modified Command Line: ` sed -n '/.*linux[[:space:]].*root=\(.*\)/{s//BOOT_IMAGE=\1/ p;q;}' /boot/grub/grub.cfg `"
sudo update-grub

上述感觉没啥用

Ubuntu 18.04 休眠后无法唤醒的解决办法 - feipeng8848 - 博客园

这个是使用laptop-mode进行处理的

sudo apt-get install laptop-mode-tools

修改配置文件/etc/default/acpi-support,更改 ENABLE_LAPTOP_MODE=true

直接在终端中输入 sudo laptop_mode start 启动了laptop_mode之后,在ubuntu挂起后,基本上就不会遇到无法唤醒的情况了

注:有些用户在acpi-support中并未找到 ENABLE_LAPTOP_MODE=true 被注释的项.看文件最后一行的提示

提示我们在/etc/laptop-mode/laptop-mode.conf 中进行配置

找到次文件查找 ENABLE_LAPTOP_MODE_ON_BATTERY、ENABLE_LAPTOP_MODE_ON_AC、ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED

看注释大体明白什么意思 当用电池,外接电源,合上显示屏的时候是否启用 LAPTOP_MODE

全部设置为 1 就可以了。

好像tlp和laptop不能共存

上述作用都不大,影响睡眠的是交换分区

休眠的时候,系统会吧内存里的数据写到交换空间,然后关闭电源。
所以,理论上交换空间需要和内存一样大,避免在休眠的时候,内存中所拥有的数据容量超过交换空间的容量,导致休眠功能出错。

ubuntu不插电桌面动画整个掉帧

ubuntu电源管理tlp

TLP:一个可以延长 Linux 笔记本电池寿命的高级电源管理工具 - 知乎

sudo apt install tlp tlp-rdw
sudo tlp start

tlp

# 安装tlp, 我觉得改善了一点
sudo apt install tlp tlp-rdw
sudo tlp start

关于tlp的配置

sudo gedit /etc/default/tlp

Linux Mint TLP设置_linux mint 省电模式-CSDN博客

Linux Mint TLP设置-阿里云开发者社区

Linux电源优化利器——TLP的简单设置 - 飞蚊话

# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html

# Hint: some features are disabled by default, remove the leading # to enable
# them.

# Set to 0 to disable, 1 to enable TLP.
TLP_ENABLE=1

# Operation mode when no power supply can be detected: AC, BAT
# Concerns some desktop and embedded hardware only.
TLP_DEFAULT_MODE=AC

# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
# Non-zero value enables, zero disables laptop mode.
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=2

# Dirty page values (timeouts in secs).
# 开启
MAX_LOST_WORK_SECS_ON_AC=30
MAX_LOST_WORK_SECS_ON_BAT=90

# Hint: CPU parameters below are disabled by default, remove the leading #
# to enable them, otherwise kernel default values are used.

# Select a CPU frequency scaling governor:
#   ondemand, powersave, performance, conservative
# Intel Core i processor with intel_pstate driver:
#   powersave, performance
# Important:
#   You *must* disable your distribution's governor settings or conflicts will
#   occur. ondemand is sufficient for *almost all* workloads, you should know
#   what you're doing!
# 开启
CPU_SCALING_GOVERNOR_ON_AC=ondemand
CPU_SCALING_GOVERNOR_ON_BAT=powersave

# Set the min/max frequency available for the scaling governor.
# Possible values strongly depend on your CPU. For available frequencies see
# tlp-stat output, Section "+++ Processor".
#CPU_SCALING_MIN_FREQ_ON_AC=0
#CPU_SCALING_MAX_FREQ_ON_AC=0
#CPU_SCALING_MIN_FREQ_ON_BAT=0
#CPU_SCALING_MAX_FREQ_ON_BAT=0

# Set Intel P-state performance: 0..100 (%)
# Limit the max/min P-state to control the power dissipation of the CPU.
# Values are stated as a percentage of the available performance.
# Requires an Intel Core i processor with intel_pstate driver.

# 开启
CPU_MIN_PERF_ON_AC=0
CPU_MAX_PERF_ON_AC=100
CPU_MIN_PERF_ON_BAT=1
CPU_MAX_PERF_ON_BAT=30

# Set the CPU "turbo boost" feature: 0=disable, 1=allow
# Requires an Intel Core i processor.
# Important:
# - This may conflict with your distribution's governor settings
# - A value of 1 does *not* activate boosting, it just allows it

# 开启
CPU_BOOST_ON_AC=1
CPU_BOOST_ON_BAT=1

# Minimize number of used CPU cores/hyper-threads under light load conditions
SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1

# Kernel NMI Watchdog:
#   0=disable (default, saves power), 1=enable (for kernel debugging only)
NMI_WATCHDOG=0

# Change CPU voltages aka "undervolting" - Kernel with PHC patch required
# Frequency voltage pairs are written to:
#   /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
# CAUTION: only use this, if you thoroughly understand what you are doing!
#PHC_CONTROLS="F:V F:V F:V F:V"

# Set CPU performance versus energy savings policy:
#   performance, normal, powersave
# Requires kernel module msr and x86_energy_perf_policy from linux-tools
ENERGY_PERF_POLICY_ON_AC=normal
ENERGY_PERF_POLICY_ON_BAT=powersave

# Hard disk devices; separate multiple devices with spaces (default: sda).
# Devices can be specified by disk ID also (lookup with: tlp diskid).
DISK_DEVICES="sda sdb"

# Hard disk advanced power management level: 1..254, 255 (max saving, min, off)
# Levels 1..127 may spin down the disk; 255 allowable on most drives.
# Separate values for multiple devices with spaces.
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="128 128"

# Hard disk spin down timeout:
#   0:        spin down disabled
#   1..240:   timeouts from 5s to 20min (in units of 5s)
#   241..251: timeouts from 30min to 5.5 hours (in units of 30min)
# See 'man hdparm' for details.
#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"

# Select IO scheduler for the disk devices: noop, deadline, cfq (Default: cfq);
# Separate values for multiple devices with spaces.

# 开启
DISK_IOSCHED="deadline cfq"

# SATA aggressive link power management (ALPM):
#   min_power, medium_power, max_performance
SATA_LINKPWR_ON_AC=medium_power
SATA_LINKPWR_ON_BAT=min_power

# PCI Express Active State Power Management (PCIe ASPM):
#   default, performance, powersave
PCIE_ASPM_ON_AC=default
PCIE_ASPM_ON_BAT=powersave

# Radeon graphics clock speed (profile method): low, mid, high, auto, default;
# auto = mid on BAT, high on AC; default = use hardware defaults.
# (Kernel >= 2.6.35 only, open-source radeon driver explicitly)
RADEON_POWER_PROFILE_ON_AC=high
RADEON_POWER_PROFILE_ON_BAT=low

# Radeon dynamic power management method (DPM): battery, performance
# (Kernel >= 3.11 only, requires boot option radeon.dpm=1)
RADEON_DPM_STATE_ON_AC=performance
RADEON_DPM_STATE_ON_BAT=battery

# Radeon DPM performance level: auto, low, high; auto is recommended.
RADEON_DPM_PERF_LEVEL_ON_AC=auto
RADEON_DPM_PERF_LEVEL_ON_BAT=auto

# WiFi power saving mode: 1=disable, 5=enable; not supported by all adapters.
WIFI_PWR_ON_AC=1
WIFI_PWR_ON_BAT=5

# Disable wake on LAN: Y/N
WOL_DISABLE=Y

# Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
# A value of 0 disables, >=1 enables power save.
SOUND_POWER_SAVE_ON_AC=0
SOUND_POWER_SAVE_ON_BAT=1

# Disable controller too (HDA only): Y/N
SOUND_POWER_SAVE_CONTROLLER=Y

# Set to 1 to power off optical drive in UltraBay/MediaBay when running on
# battery. A value of 0 disables this feature (Default).
# Drive can be powered on again by releasing (and reinserting) the eject lever
# or by pressing the disc eject button on newer models.
# Note: an UltraBay/MediaBay hard disk is never powered off.
BAY_POWEROFF_ON_BAT=0
# Optical drive device to power off (default sr0).
BAY_DEVICE="sr0"

# Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable
RUNTIME_PM_ON_AC=on
RUNTIME_PM_ON_BAT=auto

# Runtime PM for *all* PCI(e) bus devices, except blacklisted ones:
#   0=disable, 1=enable
RUNTIME_PM_ALL=1

# Exclude PCI(e) device adresses the following list from Runtime PM
# (separate with spaces). Use lspci to get the adresses (1st column).
#RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"

# Exclude PCI(e) devices assigned to the listed drivers from Runtime PM
# (should prevent accidential power on of hybrid graphics' discrete part).
# Default is "radeon nouveau"; use "" to disable the feature completely.
# Separate multiple drivers with spaces.
RUNTIME_PM_DRIVER_BLACKLIST="radeon nouveau"

# Set to 0 to disable, 1 to enable USB autosuspend feature.
USB_AUTOSUSPEND=1

# Exclude listed devices from USB autosuspend (separate with spaces).
# Use lsusb to get the ids.
# Note: input devices (usbhid) are excluded automatically (see below)
#USB_BLACKLIST="1111:2222 3333:4444"

# WWAN devices are excluded from USB autosuspend:
# 0=do not exclude / 1=exclude
USB_BLACKLIST_WWAN=1

# Include listed devices into USB autosuspend even if already excluded
# by the driver or WWAN blacklists above (separate with spaces).
# Use lsusb to get the ids.
#USB_WHITELIST="1111:2222 3333:4444"

# Set to 1 to disable autosuspend before shutdown, 0 to do nothing
# (workaround for USB devices that cause shutdown problems).
#USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1

# Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
# on system startup: 0=disable, 1=enable.
# Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
#   are ignored when this is enabled!
RESTORE_DEVICE_STATE_ON_STARTUP=0

# Radio devices to disable on startup: bluetooth, wifi, wwan.
# Separate multiple devices with spaces.
#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"

# Radio devices to enable on startup: bluetooth, wifi, wwan.
# Separate multiple devices with spaces.
#DEVICES_TO_ENABLE_ON_STARTUP="wifi"

# Radio devices to disable on shutdown: bluetooth, wifi, wwan
# (workaround for devices that are blocking shutdown).
#DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"

# Radio devices to enable on shutdown: bluetooth, wifi, wwan
# (to prevent other operating systems from missing radios).
#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"

# Radio devices to enable on AC: bluetooth, wifi, wwan
#DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"

# Radio devices to disable on battery: bluetooth, wifi, wwan
#DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"

# Radio devices to disable on battery when not in use (not connected):
# bluetooth, wifi, wwan
#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"

# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
# required). Charging starts when the remaining capacity falls below the
# START_CHARGE_TRESH value and stops when exceeding the STOP_CHARGE_TRESH value.
# Main / Internal battery (values in %)
# 开启
START_CHARGE_THRESH_BAT0=40
STOP_CHARGE_THRESH_BAT0=93
# Ultrabay / Slice / Replaceable battery (values in %)
#START_CHARGE_THRESH_BAT1=40
#STOP_CHARGE_THRESH_BAT1=80

# ------------------------------------------------------------------------------
# tlp-rdw - Parameters for the radio device wizard
# Possible devices: bluetooth, wifi, wwan

# Hints:
# - Parameters are disabled by default, remove the leading # to enable them.
# - Separate multiple radio devices with spaces.

# Radio devices to disable on connect.
#DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"

# Radio devices to enable on disconnect.
#DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""

# Radio devices to enable/disable when docked.
#DEVICES_TO_ENABLE_ON_DOCK=""
#DEVICES_TO_DISABLE_ON_DOCK=""

# Radio devices to enable/disable when undocked.
#DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
#DEVICES_TO_DISABLE_ON_UNDOCK=""

tlp有GUI了GitHub - d4nj1/TLPUI: A GTK user interface for TLP written in Python

ubuntu如何右键创建其它类型的文件

Ubuntu 设置右键添加新文件_万俟淋曦的博客-CSDN博客_ubuntu右键新建文件

如上图,使用右键新建文档时没有其它可选项,比如我要创建个.md/.txt文档就不行

其实这个文档保存在用户目录下的模板中或者说是template文件夹下

我们只需要在这里弄一个新的模板就可以

ubuntu日历显示农历

让你的 gnome 桌面显示农历 - 无妄当自持

首先安装gir1.2-lunar-date-2.0

https://pkgs.org/download/gir1.2-lunar-date-2.0

然后去Lunar Calendar 农历 - GNOME Shell Extensions

ubuntu服务器运维

远程链接ubuntu服务器的root连接不上?

主机配置好之后root用户只能通过浏览器去登录,无法通过终端远程连接。但是可以ping通,折腾了一下之后发现是配置文件里面不允许,修改一下配置文件就可以了。(sshd的设置不允许root用户用密码远程登录)

先使用普通用户登陆进去,然后切换root角色

vim /etc/ssh/sshd_config

找到PermitRootLogin,设置为yes

保存退出

对应实际使用的操作系统,执行以下命令,重启 SSH 服务。或者直接服务器重启

  • CentOSsystemctl restart sshd.service
  • Ubuntuservice sshd restart

ubuntu关闭睿频

ubuntu通过关闭睿频来降低笔记本发热_ubuntu下如何关掉睿频-CSDN博客

以下操作在运行时需要sudo su,来给权限.

关闭睿频

echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo

打开睿频

echo 0> /sys/devices/system/cpu/intel_pstate/no_turbo

当然也可以通过控制cpu最大频率来仿真电脑自动进入睿频,例如使用95%的CPU

echo 95> /sys/devices/system/cpu/intel_pstate/no_turbo

查看CPU运行状态

watch -n 0 "cat /proc/cpuinfo | grep -i mhz"

但是上述好像都是针对intel的,而对于AMD

echo 1 > /sys/devices/system/cpu/cpufreq/boost

但是这个好像没用,重启之后就恢复为0

ubuntu如何修改默认关机时长

ubuntu关机重启等待90秒问题解决_defaulttimeoutstartsec_WangYC_99的博客-CSDN博客

可以看到,这边的关机都是系统默认60s后关机

然后一点击关机就立即关机呢

sudo gedit /etc/systemd/system.conf

然后解除DefaultTimeoutStopSec=1s这个注释并设置为1s

然后sudo systemctl daemon-reload使其重新生效

ubuntu界面卡死,键盘没有一点作用

绝望的2个小时,拯救Ubuntu18.04界面卡死_ubuntu卡死-其它代码类资源-CSDN文库

sysrq键就是Prent Screen键

ubuntu删除wine的残留

Ubuntu卸载wine并彻底清除相关文件_maowenbin的博客-CSDN博客

0、卸载wine 在SoftwareCenter中 或 sudo aptitude purge wine
1、删除~/.wine目录。
2、删除~/.local/share/applications下wine-extension-*命名的起动器。~/.local/share/applications/wine目录。
3、删除~/.local/share/applications/mimeinfo.cache文件里和wine相关的内容。删除~/.local/share/applications/mimeapps.list里和wine相关的内容。
4、删除~/.config/menus/applications-merged目录。
5、删除~/.config/menus目录下的相应文件
6、打开~/.config/menus/applications.menu文件,删除文件中与wine有关的内容
7、清空~/.local/share/mime/packages目录下x-wine-extension-*命名的所有文件。然后执行命令update-mime-database ~/.local/share/mime 更新文件类型数据库
8、删除以下三个文件:
  /usr/share/app-install/desktop/wine.desktop
  /usr/share/app-install/desktop/wineconfig.desktop
  /usr/share/app-install/desktop/winefish.desktop
9、删除下面三个目录下与wine和wine相关的内容:
  ~/.local/share/applications
  ~/.local/share/desktop-directories
  ~/.local/share/icons
10、ies4linux直接去家目录下把.ieslinux的目录直接删除就可以了
11、卸载残留不用得软件包,输入:sudo apt-get autoremove 即可彻底删除wine。
————————————————
版权声明:本文为CSDN博主「maowenbin」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/maowenbin/article/details/6587294

ubuntu修改开机logo

cd /usr/share/plymouth/用自己的图片替换ubuntu-logo.png即可,注意图片尺寸不能太大

linux查看笔记本电池情况

这里我使用的是安装系统自带的upower来进行查看

使用命令upower -i /org/freedesktop/UPower/devices/battery_BAT0即可打印输出电池情况

linux如何设置程序开机启动

我比较常用的,就是写一个shell脚本,然后将这个脚本放到/etc/profile.d/文件夹下,linux系统会默认加载其中的文件

例如,我想要utools开机启动,当然我也要用到1、/usr/bin/中的内容,看到utools的启动命令

写出如下的shell脚本

将其放到/etc/profile.d/文件夹下

linux 手动编译Realtak 8852AE无线网卡

Ubuntu linux 手动编译安装 Realtek 8852 无线网卡驱动 非常简单 添加Manjaro教程_CILENCE_AIR的博客-CSDN博客_ubuntu 10ec:8852网卡驱动

GitHub - lwfinger/rtw89: Driver for Realtek 8852AE, an 802.11ax device

linux AX200网卡蓝牙

驱动源地址:https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=6272383bd8d745ad52d56975dc45f6b00fafa041
驱动包:https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-6272383bd8d745ad52d56975dc45f6b00fafa041.tar.gz
蓝牙驱动文件:
ibt-20-0-3.sfi
ibt-20-1-3.sfi
ibt-20-1-4.sfi
网卡驱动文件:
iwlwifi-cc-a0-46.ucode(intel官方46版)
iwlwifi-cc-a0-48.ucode(通过上面地址下载下来的有46和48版本)
解压把这5个放入/lib/firmware文件夹

https://www.intel.cn/content/www/cn/zh/support/articles/000005511/wireless.html

以上应该都没啥用,我是使用

GitHub - HRex39/rtl8852be_bt: Realtek Linux Bluetooth Driver for RTL8852BE

这个开源,然后make ,然后sudo make install

可能安装成功后仍然经常开不了,关不了

Ubuntu20.04突然无法打开蓝牙_ubuntu20.04 bluetooth manager 打不开-CSDN博客

可以使用

sudo rmmod btusb
sleep 1
sudo modprobe btusb

Ubuntu20.04使用摸索(二)——蓝牙耳机连接_ubuntu连接蓝牙耳机-CSDN博客

ubuntu idea webstrom 桌面图标

[Desktop Entry]
Name=IntelliJ IDEA
Comment=IntelliJ IDEA
Exec=/home/lings/idea-IC-191.6707.61/bin/idea.sh
Icon=/home/lings/idea-IC-191.6707.61/bin/idea.png
Terminal=false
Type=Application
Categories=Utility;Application
[Desktop Entry]
Name=WebStorm
Comment=WebStorm
Exec=/home/akio/tools/WebStorm-223.8617.44/bin/webstorm.sh
Icon=/home/akio/tools/WebStorm-223.8617.44/bin/webstorm.png
Terminal=false
Type=Application

ubuntu 文件夹不能预览图片视频等

ubuntu 18.04视频文件无法在文件管理器中预览的解决办法_ubuntu18预览图看不了-CSDN博客

sudo apt install ffmpegthumbnailer

rm -r ~/.cache/thumbnails

ubuntu 没有桌面图标

GNOME 3没有桌面图标_gnome桌面图标_fungaren的博客-CSDN博客

sudo apt install gnome-shell-extension-desktop-icons-ng

然后在装拓展 Desktop Icons NG (DING)

ubuntu美化

rounded window corners

窗口圆角

Compiz alike magic lamp effect

收缩过渡动画

Burn My Windows

应用开启关闭特效

ubuntu下PDF工具

使用以下命令在系统中安装Xournal++:

在Ubuntu上:

$ sudo add-apt-repository

ppa:apandada1/xournalpp-stable

$ sudo apt update

$ sudo apt install xournalpp

ubuntu docker redislabs/redisinsight:latest

Install RedisInsight on Docker | Redis Documentation Center

redis可视化工具

gitkraken工具6.5.1本地免费版(❤)

实话说,感觉有点废,作为一个开发用习惯了idea IDE,Webstorm的小开,我认为JetBrains系列工具的自带的git工具真的好用,不接受反驳下😜。如果JetBrains单独将git工具提出了作为一个轻量的新工具,那将会是薄纱。

https://ihawo.liner.fun/usr/uploads/2020/09/3894812982.deb

GitKraken -- 超好用的 Git 可视化工具

GitKraken 6.5.1 - ihawo


 

linux smartgit破解(❤❤)

额~~~,万一有人喜欢用smartgit呢在😅

SmartGit Download archive

https://www.cnblogs.com/China-Dream/p/16004704.html

请安装18.2.9的tar.gz版本

README.md · pedoc/crackSmartGit - Gitee.com

pedoc/crackSmartGit下载发布破解,放到 ~/.config/smartgit目录下面

然后编辑~/.config/smartgit/smartgit.vmoptions

我这里配置 的是:-javaagent:/home/zdhsoft-linux/.config/smartgit/crackSmartGit.jar=19.1.4

然后,运行smartgit,在菜单->帮助->注册产品 选择这个目录下的licenes.txt文件, 完成注册。

pedoc/crackSmartGit有licenes下载

ubuntu开机黑屏命令行问题

开机Network Manager Wait Online启动失败- Community - Deepin Technology

sudo systemctl disable NetworkManager-wait-online.service
sudo systemctl mask NetworkManager-wait-online.service
直接禁止启动。

又或者是 cd /lib/systemd/system编辑 vim NetworkManager-wait-online.service

linux命令行美化

Linux终端环境配置 | GeekHour

3.1 安装依赖工具

首先我们需要安装一些必要的支持工具,
包括wget、git、curl和vim等等,

sudo apt install wget git curl vim -y

3.2 安装zsh

连接成功之后就可以开始配置终端环境了,
首先我们来把当前的shell切换成zsh,
ubuntu系统默认的shell是bash,
可以使用echo $SHELL命令来查看当前使用的shell,
zsh是bash的一个替代品,
它的功能更加强大和丰富,
可以使用cat /etc/shells来查看支持的shell

$ cat /etc/shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/usr/bin/zsh
/bin/zsh
/bin/ksh
/bin/rksh
/usr/bin/ksh
/usr/bin/rksh
/bin/csh
/bin/tcsh
/usr/bin/csh
/usr/bin/tcsh

如果结果中没有zsh的话就需要使用下面的命令来安装一下:

sudo apt install zsh -y

3.3 安装字体

终端的一些iconfont需要一些特殊字体才能完美显示,
推荐使用Nerd字体,官网:nerdfonts.com/
powerlevel10k主题推荐使用MesloLGS-Nerd字体,
一般在初次安装配置主题的时候会默认提示安装,
但是如果没有正常安装的话也可以使用下面的内容来手动安装一下:
MesloLGS字体ttf文件下载地址:

wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf &&
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf  &&
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf  &&
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf

或者Mac也可以使用Homebrew来安装

# Mac homebrew
brew tap homebrew/cask-fonts &&
brew install --cask font-<FONT NAME>-nerd-font

e.g.
brew tap homebrew/cask-fonts
brew install --cask font-code-new-roman-nerd-font

安装完成之后再系统设置或者各个软件比如终端或者VSCode上把字体设置为MesloLGS NF就可以了。

如果是没有安装KDE或者Gnome图形界面的Linux的话,可以使用下面的命令来设置一下:

# Linux安装字体
sudo cp ttf/*.ttf /usr/share/fonts/truetype/
# 安装fontconfig
sudo apt install fontconfig
# 刷新字体缓存
fc-cache -fv

3.4 安装Oh-My-Zsh

执行下面的语句就可以安装了。

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

慢或者失败的小伙伴可以换成国内源:

wget https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh

下载之后给install.sh添加执行权限:

chmod +x install.sh

然后还需要修改一下远程仓库地址:
使用vim打开install.sh文件(vim install.sh)后,找到以下部分:

# Default settings
ZSH=${ZSH:-~/.oh-my-zsh}
REPO=${REPO:-ohmyzsh/ohmyzsh}
REMOTE=${REMOTE:-https://github.com/${REPO}.git}
BRANCH=${BRANCH:-master}

将中间两行修改为下面这样,使用gitee镜像:

REPO=${REPO:-mirrors/ohmyzsh}
REMOTE=${REMOTE:-https://gitee.com/${REPO}.git}

然后保存退出::wq
再执行一下,一般就应该安装好了。

将系统默认shell切换为zsh

# 切换默认shell
chsh -s $(which zsh)

# 确认
echo $SHELL

3.5 安装Zsh主题和插件

# powerlevel10k主题
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
# zsh-autosuggestions自动提示插件
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# zsh-syntax-highlighting语法高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# 配置powerlevel10k
p10k configure

编辑~/.zshrc文件启用插件和主题

# 修改主题
ZSH_THEME="powerlevel10k/powerlevel10k"

# 启用插件
plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
)

zsh: command not found: npm

zsh - How can you export your .bashrc to .zshrc? - Stack Overflow
Bash切换Zsh后,bashrc文件失效的解决方案-腾讯云开发者社区-腾讯云

While lhunath's answer pushed me in the right direction, zsh does not seem to source .profile automatically. Lot's of good info on this topic can be found on this superuser post.

The adaption I'm using is putting common aliases and functions in .profile and manually sourcing them as follows:

In ~/.bashrc:

source ~/.profile

In ~/.zshrc:

[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'

emulate is a zsh builtin command. With single argument set up zsh options to emulate the specified shell as much as possible.

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值