Skip to content

dongdongbh/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Dotfiles

This repository contains my personal dotfiles for Arch Linux, running the niri Wayland compositor. The configurations are managed using GNU Stow.

System Startup Procedure

The startup process for this Wayland-based system is:

BIOS/UEFI → Bootloader (e.g., GRUB) → systemd → Display Manager (SDDM) → Niri (Wayland Compositor) & Session Components


Software Stack

Here is a list of the primary tools used in this configuration:

Category Tool Description
Graphical Environment
Wayland Compositor Niri A scrollable-tiling Wayland compositor with a focus on a smooth, intuitive workflow.
Display Manager SDDM A modern, QML-based display manager.
Status Bar Waybar A highly customizable status bar for Wayland compositors like Niri and Sway.
Application Launcher Rofi A versatile application launcher and window switcher with Wayland support.
Notification Daemon Mako A lightweight and fast Wayland notification daemon.
Screen Management Kanshi A dynamic display configuration tool for Wayland, used to manage multi-monitor profiles automatically.
Wallpaper Utility swaybg A simple wallpaper utility for Wayland compositors.
Idle Management swayidle A daemon for managing idle states, used here with hyprlock.
Screen Locker Hyprlock A fast and feature-rich screen locker for Wayland.
Terminal & Shell
Terminal Emulator Alacritty A fast, GPU-accelerated terminal emulator.
Shell Zsh An extended Bourne shell with many improvements, configured with custom prompts and functions.
Terminal Multiplexer Tmux A terminal multiplexer for managing multiple terminal sessions in a single window.
Editor Neovim A hyperextensible, Vim-based text editor.
Fuzzy Finder fzf A general-purpose command-line fuzzy finder, integrated with Zsh for history and file searching.
System Utilities
Input Method Framework Fcitx5 & Rime The input method framework and engine used for Xiaohe Double Pinyin Chinese input.
Audio Server PipeWire & WirePlumber The modern audio and video server for Linux.
Screenshot Tools grim & slurp Core Wayland utilities for capturing the screen (grim) and selecting regions (slurp).
GUI Screenshot Flameshot A feature-rich graphical tool for taking and annotating screenshots, with Wayland support.
Clipboard Manager wl-clipboard Command-line copy and paste utilities for Wayland.
File Finder fd A simple, fast, and user-friendly alternative to find.
grep Alternative ripgrep A line-oriented search tool that recursively searches the current directory for a regex pattern.
cat Alternative bat A cat clone with syntax highlighting and Git integration.
File Management
TUI File Manager Yazi A fast, terminal-based file manager with image previews powered by ueberzugpp.
PDF Viewer Zathura A highly customizable and Vim-like document viewer with a poppler backend for PDFs.
Disk Usage Analyzers dust & duf Modern command-line tools for analyzing disk usage and free space.
Storage Device Manager udiskie A user-level daemon for automatically mounting removable media.

speed up your linux

using swap

It is better to have more ram memory.

Using more swap memory is not a good idea, because it will slow down your system. by change the swappiness, you can make the system use swap memory less often. The default swappiness is 60, you can change it to 10 by sudo sysctl vm.swappiness=25 Make this permanent by sudo echo vm.swappiness=25 >> /etc/sysctl.conf

speed up linux by tmpfs

Many Linux distro use tmpfs for /tmp, but debain/ubuntu currently don't. Enable tmpfs for /tmp by

echo "tmpfs /tmp tmpfs rw,noatime,nosuid,nodev" | sudo tee -a /etc/fstab
sudo reboot

By default, a tmpfs partition has its maximum size set to half your total RAM. You can change this by adding a size parameter to the fstab entry, e.g. tmpfs /tmp tmpfs rw,size=2G 0 0 Another method is enable it by systemd

sudo cp -v /usr/share/systemd/tmp.mount /etc/systemd/system/
sudo systemctl enable tmp.mount
sudo reboot
systemctl status tmp.mount

Note that you should do this only if your machine has enough ram available (generally at least 8GB) You can also change the size of the tmpfs partition by changing the value of the SizeMax parameter in /etc/systemd/system/tmp.mount

make program use tmpfs for /tmp

#!/bin/bash
mkdir /tmp/chrome-cache-alw
ln -sf /tmp/chrome-cache-alw ~/.cache/google-chrome

You can mount ~/.cache as tmpfs, but Some naughty programs store things there that they want later and assume it will be there after a reboot. Take you own risk.

/etc/fstab can be

tmpfs       /tmp                    tmpfs   rw,noatime,nosuid,nodev                         0   0
tmpfs       /var/cache/apt          tmpfs   noatime,mode=0755,uid=0,gid=0                   0   0
tmpfs       /home/dd/.cache         tmpfs   size=4g,noatime,mode=0700,uid=1000,gid=1000     0   0
tmpfs       /ram                    tmpfs   size=8g,noatime,mode=0700,uid=1000,gid=1000     0   0
  • mounting /var/cache/apt as tmpfs, the apt package manager will be downloading all archives to RAM, and extracting them from RAM to disk. This speeds up installations and upgrades.
  • mounting /ram as tmpfs, gives us a general folder to use as RAM disk, with a size of 8GB. This can be used to download files, archives to extract to disk, etc., where the speed of RAM is desirable.
  • the size=[x] option will specify how much RAM can be used for each mountpoint.
  • the mode=[xxxx] option will set the directory permissions (who can read, write, and execute)
  • using the noatimeoption will eliminate needless disk operations, improving all disk performance.

stow

stow create symbolic link to files or directories automatically. The symbol link use same name as the original files. For management of dotfiles, you should first move your dot file to the dofiles dir, then use stow to create a symbol link.

Here is an exampled:

cd ~
mkdir dotfiles
mkdir dotfiles/bash
mv ~/.bashrc ~/dotfiles/bash/
cd dotfiles
stow bash

The default target folder that stow creating symbol link is the parent dir of current dir. In the above example, it's the home dir. You can specify the target dir with stow -t. stow also create subdir automatically. e.g. let's say you original is

---home
-----|
-----|--.config
-----------|
-----------|----nvim
-----------|------|
-----------|------|---init.lua

You should have the following in dotfiles by mv ~/.config/nvim ~/dotfiles/nvim, which results in


---home
-----|
-----|--dotfiles
-----------|
-----------|---nvim
-----------------|--.config
-----------------------|
-----------------------|----nvim
-----------------------|------|
-----------------------|------|---init.lua

Then just stow nvim in ~/dotfiles.

For tmux, you should use tmux version newer than 3.1 to use config file located in .config/tmux/.

other way to manage dotfiles

use git bare repository .


Quick Start (Niri Branch)

  1. Install prerequisites

    sudo pacman -S --needed git stow
  2. Clone and enter the repo

    git clone https://github.com/dongdongbh/dotfiles ~/dotfiles
    cd ~/dotfiles
  3. Bootstrap everything

    ./install.sh

    The script uses set -euo pipefail, installs packages with pacman -S --needed, builds yay only when absent, and backs up an existing ~/.zshrc before stowing.

  4. Restow later

    make        # restow all packages
    make delete # remove symlinks

You can always link individual packages, e.g. stow zsh waybar.


Session Overview

  • Display manager / compositor: SDDM → Niri (Hyprland configs live on a separate branch; shared pieces remain under hypr-common/).
  • Waybar: ~/.local/bin/launch-waybar.sh picks the docked or undocked config based on niri msg outputs. Media, Bluetooth, and power modules are provided by scripts in scripts/.local/bin/.
  • Lock screen: Hyprlock starts alongside Niri and works for the Hyprland branch too.
  • Systemd user services: enable extras with systemctl --user enable --now swaybg.service, waybar.service, etc.

Shell Notes

  • Zsh is the default shell; plugins are stored in zsh/.config/zsh/plugins/.
  • Node tooling (NVM) is now lazy-loaded: the first call to node, npm, npx, corepack, or nvm sources the real installer, keeping startup fast (see the wrapper in zsh/.zshrc).
  • zsh_add_completion safely updates completions and prunes stale .zcompdump files.

Helpful Scripts

Script Purpose
scripts/.local/bin/system-bluetooth-bluetoothctl.sh Waybar module helper that prints connected-device aliases and toggles Bluetooth power/connection.
scripts/.local/bin/bluetooth-simple.sh Minimal status glyph for bars.
scripts/.local/bin/wayland-screenshot.sh Grim + slurp screenshot helper; copies to clipboard and notifies.
scripts/.local/bin/launch-waybar.sh Chooses config-docked.jsonc or config-undocked.jsonc automatically.
scripts/.local/bin/hotspot NetworkManager-friendly Wi-Fi hotspot controller.
scripts/.local/bin/present_mode.sh Syncs HDMI-1 resolution into the autorandr “present” profile, then loads it.

Legacy X11 tools remain for historical reference; Wayland-first replacements are preferred going forward.