Skip to main content

Desktop

Dotfiles

sudo pacman -S chezmoi

Set up new machine with single command:

chezmoi init --apply -v sabertazimi

Set up new machine from remote dotfiles:

chezmoi init sabertazimi
chezmoi diff
chezmoi apply -v
chezmoi update -v

Sync local dotfiles to remote repository:

chezmoi add ~/.zshrc
chezmoi cd
git add .
git commit
git push
exit

Edit dotfiles:

# Edit dotfile
chezmoi edit ~/.zshrc
# Apply to local machine
chezmoi diff
chezmoi apply -v
# Push to remote repository
chezmoi cd
git add .
git commit
git push
exit

Locale

Fonts

fontconfig:

mkdir -p ~/.local/share/fonts/
cp -fr code-fonts ~/.local/share/fonts/
fc-cache -fv
fc-list
fc-list : family | sort | uniq
fc-list :lang=zh | sort | uniq
fc-match sans-serif
fc-match "serif:lang=zh"
fc-match "monospace:lang=zh-cn"
fc-cat ~/.config/fontconfig/fonts.conf

Compositor

echo $WAYLAND_DISPLAY
glxgears
glxinfo | grep "direct rendering" # Yes: 3D 硬件加速正常

Niri

Hotkeys

~/.config/niri/dms/binds.kdl:

  • Super+Shift+/ for important hotkeys
  • Launcher: Super+d
  • Terminal: Super+t
  • Window:
    • Switch: Alt+Tab
    • Navigation: Super+h/j/k/l
    • Move: Super+Ctrl+h/j/k/l
  • Monitor:
    • Navigation: Super+Shift+h/j/k/l
    • Move: Super+Shift+Ctrl+h/j/k/l
  • Workspace:
    • Navigation: Super+u/i
    • Move: Super+Ctrl+u/i (column), Super+Shift+u/i (workspace)
  • Vertical:
    • Left: Super+[
    • Right: Super+]
    • Tab (stack): Super+w, Super+j/k
    • Consume: Super+,
    • Expel: Super+.
  • Floating:
    • Toggle: Super+v
    • Switch: Super+Shift+v
    • Move: Super+Ctrl+h/j/k/l, Super + click
  • Size:
    • Maximize: Super+f, Super+Shift+f
    • Preset: Super+r, Super+Shift+r, Super+Ctrl+r
    • Manual: Super+-/+, Super+Shift+-/+
  • Close: Super+q
  • Lock: Super+Alt+l

Outputs

niri msg outputs
output "HDMI-A-1" {
mode "1920x1080@60.000"
scale 1
position x=0 y=0
}

output "eDP-1" {
mode "2880x1800@90.007"
scale 1.75
position x=1920 y=0
}

Window Rules

niri msg windows
window-rule {
match app-id="^firefox$"
open-maximized true
}

DMS

Config DMS settings ~/.config/DankMaterialShell/settings.json and session ~/.local/state/DankMaterialShell/session.json.

GNOME

GTK

GTK/GNOME themes located in /usr/share/themes/ or ~/.themes/:

# Vimix Cursors Installation
git clone https://github.com/vinceliuice/Vimix-cursors
sudo ./Vimix-cursors/install.sh

# WhiteSur GNOME theme Installation
git clone https://github.com/vinceliuice/WhiteSur-gtk-theme
sudo ./WhiteSur-gtk-theme/install.sh -t all -i ubuntu
# Tweak for Firefox
sudo ./WhiteSur-gtk-theme/tweaks.sh -f
# Tweak for Snap Apps
sudo ./WhiteSur-gtk-theme/tweaks.sh -s
# Tweak for GDM
sudo ./WhiteSur-gtk-theme/tweaks.sh -g -i ubuntu
# Tweak Help Docs
sudo ./WhiteSur-gtk-theme/tweaks.sh -h

Repair for not detected HDMI problem:

sudo dpkg-reconfigure gdm3
sudo apt install --reinstall gdm3 lightdm ubuntu-desktop

Shell

GNOME shell extension:

  • Install GNOME shell extension for browser.
  • Install local binding app: sudo apt install chrome-gnome-shell.
  • Visit extensions.gnome.org to install extensions.

KDE

Set up:

sudo pacman -S plasma-meta plasma-workspace xdg-desktop-portal konsole dolphin
sudo pacman -S sof-firmware alsa-firmware alsa-ucm-conf # 声音固件
sudo pacman -S ntfs-3g # NTFS 硬盘
sudo pacman -S adobe-source-han-serif-cn-fonts wqy-zenhei # 中文字体
sudo pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji # 谷歌字体及表情
sudo pacman -S firefox chromium # 浏览器
sudo pacman -S ark # 压缩软件
sudo pacman -S packagekit-qt6 packagekit appstream-qt appstream # Discover 依赖
sudo pacman -S gwenview # 图片查看器

Flatpak

flatpak remote-add --if-not-exists flathub https://flathub.org

Applications

Desktop shortcut located in /usr/share/applications.

MIME

Set default MIME apps ~/.config/mimeapps.list:

xdg-mime default nvim.desktop application/javascript
xdg-mime default imv.desktop image/png
xdg-mime default mpv.desktop video/mp4
xdg-mime default org.gnome.Nautilus.desktop inode/directory
xdg-mime default wine.desktop application/vnd.microsoft.portable-executable

Query MIME types:

xdg-mime query default text/plain
xdg-mime query filetype ~/workspace/notes/src/components/notes-marquee.tsx

Icons

pkgstats show breeze-icons $(pacman -Ss icon-theme | awk 'NR%2==1' | awk -F '[/ ]' '$0 !~ /-git$/ {print $2}' | head -19)

Music Player

Video Player

Library

  • Dank: Desktop shell for Wayland compositors.
  • Noctalia: Sleek and minimal desktop shell for Wayland.
  • Caelestia: Desktop shell for Hyprland.
  • Illogical Impulse: Usability-first dotfiles for Hyprland.
  • HyDE: Hyprland desktop environment.

References