临沂科技网站建设,中国商标设计网,正规投资软件app哪个好,绩溪住房建设网站博客地址
开发者的 Debian 12 KDE 配置优化指南
0x00 简介
本文仅适用于配置 Debian 12 Bookworm
文中包含 KDE Plasma X11 桌面配置
文中使用 debianuser 代替用户名#xff0c;执行命令或复制配置时请注意替换
文中涉及的带版本号的软件包/环境#xff0c;版本号使用…博客地址
开发者的 Debian 12 KDE 配置优化指南
0x00 简介
本文仅适用于配置 Debian 12 Bookworm
文中包含 KDE Plasma X11 桌面配置
文中使用 debianuser 代替用户名执行命令或复制配置时请注意替换
文中涉及的带版本号的软件包/环境版本号使用 xxx 代替请根据实际情况安装最新版本或自己需要的版本
本文编辑整理时间距离实践时间相隔过长编辑过程中可能出现不准确内容如果在您的时间过程中发现与本文不符的情况请尽量在评论区留言我将尽快确认更新
0x01 基础配置
该步骤中大部分操作需要重启所以不要根据配置完成后的应用运行状态来判断配置是否成功
在该步骤末尾会重启一次应用所有配置
使用英文重命名 /home 目录下文件夹
cd ~
mkdir Desktop Download Templates Public Documents Music Pictures Videos
rm -rf 公共 模板 视频 图片 文档 下载 音乐 桌面
xdg-user-dirs-update --set DESKTOP ~/Desktop
xdg-user-dirs-update --set DOWNLOAD ~/Download
xdg-user-dirs-update --set TEMPLATES ~/Templates
xdg-user-dirs-update --set PUBLICSHARE ~/Public
xdg-user-dirs-update --set DOCUMENTS ~/Documents
xdg-user-dirs-update --set MUSIC ~/Music
xdg-user-dirs-update --set PICTURES ~/Pictures
xdg-user-dirs-update --set VIDEOS ~/Videos将用户添加到 sudoers 中
该步骤需要先切换到 root 身份
Ctrl Alt F3 切换到纯命令行界面的新终端并以 root 身份登录进行操作
结束后使用 exit 退出终端按 Ctrl Alt F1/F2 切换回用户身份图形界面
根据桌面环境及发行版本不同快捷键可能有差异但大多都是 Ctrl Alt F1-F12 以下命令在 root 身份下执行 chmod w /etc/sudoers
cat /etc/sudoers EOF
debianuser ALL(ALL:ALL) ALL
EOF
chmod -w /etc/sudoers
exit以上命令在 root 身份下执行 更换软件源
sudo tee /etc/apt/sources.list -EOF
deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian stable main contrib non-free non-free-firmwaredeb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free non-free-firmwaredeb http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free non-free-firmware# deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
EOF
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade其他软件源
Docker CE
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod ar /etc/apt/keyrings/docker.gpg
sudo tee /etc/apt/sources.list.d/docker-ce.list -EOF
deb [archamd64 signed-by/etc/apt/keyrings/docker.gpg] https://mirrors.ustc.edu.cn/docker-ce/linux/debian bookworm stable
EOF
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin配置基础软件包
sudo apt install vim wget curl htop git proxychains4 screenfetch tmux bash-completion fcitx5-rime chromium fcitx5 zsh fonts-powerline fzf net-tools openssh-server firewalld bat卸载无用软件包
主要卸载一些多语言支持和游戏包可跳过
KDE
注意卸载包时请注意同时卸载了哪些依赖防止出现依赖问题导致卸载掉整个桌面环境
sudo apt remove --purge ibus* goldendict
sudo apt autoremove --purge无线网卡驱动
如果你的电脑存在无线网卡并且在安装好操作系统之后发现无线网卡无法使用请尝试如下步骤
sudo apt install firmware-iwlwifi
sudo modprobe -r iwlwifi
sudo modprobe iwlwifiNvidia 显卡驱动
如果你的电脑存在 Nvidia 显卡并且在安装好操作系统之后发现显卡无法使用请尝试如下步骤
sudo apt install nvidia-detect
sudo nvidia-detect该步骤会根据硬件检测应该安装哪些驱动请按照输出安装对应的驱动例如提示 nvidia-driver
sudo apt install nvidia-drivertmux 快捷键
sudo tee /etc/tmux.conf -EOF
set -g prefix C-a
unbind C-b
bind C-a send-prefix
EOF配置 ZSH
切换到 zsh
chsh -s /bin/zsh
# If you have a specific zshrc
sudo cp ~/.zshrc /root完成以上步骤后切换到 root 用户将自动为其配置 zsh zinit 及 .zshrc 中配置的插件
自行配置 p10k 主题前请先按照 0x05 其他优化配置 正确配置字体
重启
sudo reboot0x02 安装应用
下载 Google Chrome
下载 Microsoft Visual Studio Code
下载 JetBrains Toolbox App
下载 Go for Linux
下载 nvm
sudo apt install ./google-chrome-stable_current_amd64.deb
sudo apt install ./code_xxx_amd64.deb
sudo apt remove --purge firefox-esr*JetBrains Toolbox
用于管理 JetBrains IDE
tar zxvf jetbrains-toolbox-xxx.tar.gz
./jetbrains-toolbox-xxx/jetbrains-toolboxActivate by code
访问 jetbra.in/s网站使用 IPFS 存储跳转到 JETBRA.IN CHECKER | IPFS在列表中选择任意可用节点访问即可
下载页面顶部的 jetbra.zip按照 README 说明配置即可
Go nvm Java
建议将 go 和 nvm 分别安装到 /usr/local/go 和 /usr/local/nvm 下
为 java 创建 /usr/local/java 目录将各版本 jdk 统一解压到该目录下便于管理
mkdir $HOME/.local/go
mkdir $HOME/.local/nvm
tar zxvf Downloads/goxxxlinux-amd64.tar.gz -C $HOME/.local/go/ --strip-components1
chmod x nvm_install.sh
NVM_DIR$HOME/.local/nvm ./nvm_install.sh
tee $HOME/.profile -EOFsource /etc/profileexport NVM_NODEJS_ORG_MIRRORhttps://npmmirror.com/mirrors/nodeexport GOROOT$HOME/.local/goexport JAVA_HOME$HOME/.local/java/jdk-xxxexport PATH$PATH:$GOROOT/bin
export PATH$PATH:$JAVA_HOME/bin
EOF配置 Go ModulesGo 代理并切换 npm 源
go env -w GO111MODULEon
go env -w GOPROXYhttps://goproxy.cn,https://goproxy.io,direct
nvm install --lts
nvm alias default lts/*
npm config set registry https://registry.npmmirror.com/安装 VSCode 扩展
以下仅为推荐扩展请根据自己的技术栈及个人喜好自行选择
ms-vscode.cpptoolsms-azuretools.vscode-dockerdbaeumer.vscode-eslintgolang.goyzhang.markdown-all-in-oneshd101wyy.markdown-preview-enhancedDavidAnson.vscode-markdownlintms-python.vscode-pylancems-python.pythonVue.volar
0x03 KDE 桌面优化
系统设置
外观 全局主题 获取新的全局主题: Fluent kde theme 应用程序风格 配置 GNOME/GTK 应用程序风格 获取新 GNOME/GTK 应用程序风格: Fluent gtk themeGTK 应用程序风格Fluent Plasma 视觉风格: Fluent窗口装饰元素: Fluent图标: Fluent欢迎屏幕: Fluent 工作区行为 常规行为 单击文件、文件夹时: 选中 锁屏 自动锁定屏幕: 如果空闲 30 分钟锁屏多久后需要密码解锁: 0 秒 最近文件 记住打开过的文档: 不要记住 窗口管理 窗口行为 标题栏操作 标题栏和边框操作 中击: 无操作 无操作 任务切换器 获取新任务切换器: MediumDefault主窗口 可视化: MediumDefault 开机与关机 桌面会话 会话恢复 登录时启动之前打开的应用程序: 启动为空会话 搜索 Plasma 搜索 关闭 浏览器历史记录关闭 网络搜索关键词配置 KRunner 关闭 在桌面按下任意按键时激活关闭 记住过去的搜索关闭 重新打开时保留上次搜索关闭 活动感知 电源管理 节能 屏幕节能: 关闭前等待时间 30 分钟关闭 挂起会话合上笔记本盖时: 无操作
面板配置
面板高度: 46图标任务管理器 行为 分组: 不分组显示的任务: 打开 当前屏幕的任务 数字时钟 外观 打开 显示秒时间显示: 24 小时制
Konsole 配置
设置 显示工具栏 关闭 主工具栏关闭 会话工具栏 配置 Konsole 常规 关闭 记住窗口大小 配置方案: 新建 常规 Default打开 默认配置方案初始终端尺寸: 140 列 30 行 外观 配色方案和字体 获取新的: Nordic konsole 滚动 回滚: 无限制
0x05 其他优化配置
字体优先级
本文环境下广泛使用 Hack Nerd Font 显示图标使用 Sarasa Term SC 作为等宽字体
创建 /etc/fonts/local.conf 配置字体优先级如下
?xml version1.0?
!DOCTYPE fontconfig SYSTEM fonts.dtd
fontconfigaliasfamilyserif/familypreferfamilySarasa Term SC/familyfamilyHack Nerd Font/family/prefer/aliasaliasfamilysans-serif/familypreferfamilySarasa Term SC/familyfamilyHack Nerd Font/family/prefer/aliasaliasfamilymonospace/familypreferfamilySarasa Term SC/familyfamilyHack Nerd Font/family/prefer/alias
/fontconfigZSH 配置参考
.zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r ${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh ]]; thensource ${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh
fi# apt install fonts-powerline
# Download https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/Hack.zip
# Extract the files and copy all font files to user font folder like ~/.local/share/fonts
# fc-cache -f -v### Added by Zinits installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; thenprint -P %F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%fcommand mkdir -p $HOME/.local/share/zinit command chmod g-rwX $HOME/.local/share/zinitcommand git clone https://github.com/zdharma-continuum/zinit $HOME/.local/share/zinit/zinit.git \print -P %F{33} %F{34}Installation successful.%f%b || \print -P %F{160} The clone has failed.%f%b
fisource /etc/zsh/zprofile
source $HOME/.profile
source $HOME/.local/share/zinit/zinit.git/zinit.zsh
autoload -Uz _zinit
(( ${_comps} )) _comps[zinit]_zinit
### End of Zinits installer chunkHISTFILE$HOME/.zsh_history
HISTSIZE10000
SAVEHIST10000
setopt BANG_HIST # Treat the ! character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the :start:elapsed;command format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
setopt HIST_IGNORE_DUPS # Dont record an entry that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
setopt HIST_IGNORE_SPACE # Dont record an entry starting with a space.
setopt HIST_SAVE_NO_DUPS # Dont write duplicate entries in the history file.
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
setopt HIST_VERIFY # Dont execute immediately upon history expansion.
setopt HIST_BEEP # Beep when accessing nonexistent history.# apt install fzf
zinit ice depth1 lucid wait0 atload_zsh_autosuggest_start
zinit light zsh-users/zsh-autosuggestions
zinit ice depth1 lucid wait0
zinit light zsh-users/zsh-syntax-highlighting
zinit ice depth1
zinit light zsh-users/zsh-completions
zinit ice depth1
zinit light romkatv/powerlevel10k
zinit ice lucid wait0
zinit snippet OMZ::plugins/jsontools/jsontools.plugin.zsh
zinit ice lucid wait0
zinit snippet OMZ::plugins/fzf/fzf.plugin.zsh
zinit ice lucid wait0
zinit snippet OMZ::lib/completion.zshautoload -U compinit compinit# To customize prompt, run p10k configure or edit ~/.p10k.zsh.
if [ ${DISPLAY} ]; then[[ ! -f ~/.p10k.gui.zsh ]] || source ~/.p10k.gui.zsh
elseexport LANGen_US.UTF-8[[ ! -f ~/.p10k.terminal.zsh ]] || source ~/.p10k.terminal.zsh
fialias lsls --colorauto
alias grepgrep --colorauto
alias llls -lh
alias lals -A
alias lls -CF
# advcpmv Site: https://github.com/jarun/advcpmv
# advcpmv Step Start
# from source code
# wget http://ftp.gnu.org/gnu/coreutils/coreutils-9.4.tar.xz
# tar Jxvf coreutils-9.4.tar.xz
# cd coreutils-9.4/
# wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-0.9-9.4.patch
# patch -p1 -i advcpmv-0.9-9.4.patch
# ./configure
# make
# sudo chmod x ./src/cp ./src/mv
# sudo chown root. ./src/cp ./src/mv
# sudo mv ./src/cp /usr/local/bin/cpg
# sudo mv ./src/mv /usr/local/bin/mvg
# advcpmv Step Finish
alias cp/usr/local/bin/cpg -g
alias mv/usr/local/bin/mvg -g
# bat Site: https://github.com/sharkdp/bat
# bat Step Start
# from github
# Download release from https://github.com/sharkdp/bat/releases
# apt install ./bat-musl_x.xx.x_amd64.deb
# bat Step Finish
alias catbatcat --pagingnever -pPowerlevel10k 配置
Powerlevel10k 是 zsh 的主题在 .zshrc 中我们声明了在桌面环境和终端环境下使用不同的 p10k 配置即桌面环境使用图标更多更友好的终端主题配置而在终端环境下使用更保守的终端主题配置以保证兼容性执行 p10k configure 来生成配置文件