diff --git a/config/shell/.config/fish/post.d/alias.fish b/config/shell/.config/fish/post.d/alias.fish index aa24cf1..8f7282a 100644 --- a/config/shell/.config/fish/post.d/alias.fish +++ b/config/shell/.config/fish/post.d/alias.fish @@ -41,7 +41,7 @@ if type -q fzf # fyi: fuzzy yay install function fyi - set -l pkg (yay -Sl | awk '{print $2}' | fzf -m --preview 'yay -Si {}' $argv) + set -l pkg (yay -Sl | awk '{print $1"/"$2}' | fzf -m --preview 'yay -Si {}' $argv) if test -n "$pkg" yay -S $pkg end diff --git a/memo/dolphin-foreground.md b/memo/dolphin-foreground.md index d2752de..a95db27 100644 --- a/memo/dolphin-foreground.md +++ b/memo/dolphin-foreground.md @@ -1,4 +1,4 @@ -WM 下 Dolphin 的前景色可能会很奇怪,在 .config/dolphinrc 中添加以下内容可以解决: +不在 KDE 中运行 Dolphin 时前景色可能会很奇怪,在 .config/dolphinrc 中指定颜色主题可以解决: ```conf [UiSettigs] diff --git a/memo/fix-windows-time-skew.md b/memo/fix-windows-time-skew.md index bade694..ab1e1aa 100644 --- a/memo/fix-windows-time-skew.md +++ b/memo/fix-windows-time-skew.md @@ -1,4 +1,4 @@ -> from [linux-surface wiki](https://github.com/linux-surface/linux-surface/wiki/Installation-and-Setup) +> from [linux-surface wiki](https://github.com/linux-surface/linux-surface/wiki/Installation-and-Setup#setting-your-clock-to-localtime-to-fix-dual-boot-time-skew) ### Setting your clock to localtime to fix dual-boot time skew @@ -8,6 +8,7 @@ cause the time to skew. The easiest way to fix this is by configuring Linux to u ```bash sudo timedatectl set-local-rtc 1 ``` + ```bash sudo hwclock --systohc --localtime ``` diff --git a/memo/fontconfig.md b/memo/fontconfig.md new file mode 100644 index 0000000..4341f2f --- /dev/null +++ b/memo/fontconfig.md @@ -0,0 +1,103 @@ +感觉不适合放到 stow 包里,毕竟这取决于系统上安装了哪些字体。那就放 memo 里好了。 + +> path: `~/.config/fontconfig/fonts.conf`. + +```xml + + + + + + + + roman + + + + roman + + + + + matrix + + 1 + 0.2 + 0 + 1 + + + + + + oblique + + + + false + + + + + + + medium + + + + bold + + + + true + + + + bold + + + + + sans-serif + + Noto Sans + Noto Sans CJK SC + Noto Sans CJK JP + Noto Sans CJK KR + Maple Mono NF CN + + + + + serif + + Noto Serif + Noto Serif CJK SC + Noto Serif CJK JP + Noto Serif CJK KR + Maple Mono NF CN + + + + + monospace + + Maple Mono NF CN + Noto Sans Mono + Noto Sans Mono CJK SC + Noto Sans Mono CJK JP + Noto Sans Mono CJK KR + + + +``` diff --git a/memo/fzf-usage.txt b/memo/fzf-usage.txt deleted file mode 100644 index 7745e30..0000000 --- a/memo/fzf-usage.txt +++ /dev/null @@ -1,12 +0,0 @@ -# copy result to clipboard -fzf | {clipboard manager} # e.g. wl-copy / win32yank.exe -i - -# do not sort results -fzf +s - -# preview results in a preview window -fzf --preview 'cat {}' -fzf --preview 'bat --color=always {}' # for better syntax highlighting - -# select multiple items with tab -fzf -m diff --git a/memo/grub-install-id.md b/memo/grub-install-id.md new file mode 100644 index 0000000..3d675a9 --- /dev/null +++ b/memo/grub-install-id.md @@ -0,0 +1,5 @@ +在执行 grub-install 时,会有一个参数 `--bootloader-id=` 指定引导的名称,虽然都说随便写,但是同一个设备上的两个引导不能使用相同的名称,否则会冲突。 + +警钟长鸣。 + +(就这个问题居然让我排查了半下午,天) diff --git a/memo/powerprofile b/memo/powerprofile.txt similarity index 100% rename from memo/powerprofile rename to memo/powerprofile.txt diff --git a/memo/sddm-blank.md b/memo/sddm-blank.md new file mode 100644 index 0000000..9ae7c97 --- /dev/null +++ b/memo/sddm-blank.md @@ -0,0 +1,156 @@ +## What + +> kernel: `Linux 6.17.7-5-cachyos` +> nvidia-driver: `cachyos-v3/nvidia-open-dkms 580.105.08-3` +> sddm: `cachyos-v3/sddm 0.21.0-8` + +SDDM shows a blank screen (only with mouse cursor and tty cursor) after booting into graphical target, but starts normally after restarting the SDDM service. + +## Why + +SDDM starts before the NVIDIA driver is fully initialized, causing the greeter to fail to display properly. + +
+evidence + +- Logs after booting (many unrelated lines omitted): + +```log +...(maybe unrelated lines)... +systemd[1]: Started Simple Desktop Display Manager. +kernel: NVRM: testIfDsmSubFunctionEnabled: GPS ACPI DSM called before _acpiDsmSupportedFuncCacheInit subfunction = 11. +kernel: bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this. +sddm[878]: Initializing... +sddm[878]: Starting... +sddm[878]: Logind interface found +sddm[878]: Adding new display... +sddm[878]: Loaded empty theme configuration +sddm[878]: Xauthority path: "/run/sddm/xauth_yQfUmV" +sddm[878]: Using VT 2 +sddm[878]: Display server starting... +sddm[878]: Writing cookie to "/run/sddm/xauth_yQfUmV" +sddm[878]: Running: /usr/bin/X -nolisten tcp -background none -seat seat0 vt2 -auth /run/sddm/xauth_yQfUmV -noreset -displayfd 16 +systemd[1]: Starting Authorization Manager... +kernel: nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device DP-4 +kernel: nvidia-modeset: WARNING: GPU:0: Unable to read EDID for display device DP-4 +systemd[1]: Started Authorization Manager. +kernel: [drm] Initialized nvidia-drm 0.0.0 for 0000:01:00.0 on minor 0 +systemd[1]: Started Power Profiles daemon. +systemd[1]: Reached target Graphical Interface. +kernel: nvidia 0000:01:00.0: [drm] Cannot find any crtc or sizes +systemd[1]: Startup finished in 5.795s (firmware) + 7.387s (loader) + 1.169s (kernel) + 2.477s (initrd) + 3.421s (userspace) = 20.251s. +systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:nvidia_0... +systemd[1]: Finished Load/Save Screen Backlight Brightness of backlight:nvidia_0. +sddm[878]: Setting default cursor +sddm[878]: Running display setup script "/usr/share/sddm/scripts/Xsetup" +sddm[878]: Display server started. +sddm[878]: Socket server starting... +sddm[878]: Socket server started. +sddm[878]: Loading theme configuration from "/usr/share/sddm/themes/sugar-candy/theme.conf" +sddm[878]: Greeter starting... +sddm-helper[1006]: [PAM] Starting... +sddm-helper[1006]: [PAM] Authenticating... +sddm-helper[1006]: [PAM] returning. +sddm-helper[1006]: pam_unix(sddm-greeter:session): session opened for user sddm(uid=950) by (uid=0) +systemd[1]: Created slice User Slice of UID 950. +systemd[1]: Starting User Runtime Directory /run/user/950... +systemd-logind[773]: New session 'c1' of user 'sddm' with class 'greeter' and type 'x11'. +systemd[1]: Finished User Runtime Directory /run/user/950. +systemd[1]: Starting User Manager for UID 950... +(systemd)[1015]: pam_warn(systemd-user:setcred): function=[pam_sm_setcred] flags=0x8002 service=[systemd-user] terminal=[] user=[sddm] ruser=[] rhost=[] +(systemd)[1015]: pam_unix(systemd-user:session): session opened for user sddm(uid=950) by sddm(uid=0) +systemd-logind[773]: New session '1' of user 'sddm' with class 'manager-early' and type 'unspecified'. +systemd[1015]: Queued start job for default target Main User Target. +systemd[1015]: Created slice User Application Slice. +systemd[1015]: Startup finished in 139ms. +systemd[1]: Started User Manager for UID 950. +systemd[1]: Started Session c1 of User sddm. +sddm-helper[1006]: Writing cookie to "/tmp/xauth_FfqCDd" +sddm-helper[1006]: Starting X11 session: "" "/usr/bin/sddm-greeter --socket /tmp/sddm-:0-HQDlHk --theme /usr/share/sddm/themes/sugar-candy" +sddm[878]: Greeter session started successfully +...(maybe unrelated lines)... +``` + +Although the greeter session started successfully, it is not able to display anything due to `nvidia 0000:01:00.0: [drm] Cannot find any crtc or sizes`, resulting in a blank screen. + +- Logs after restarting sddm.service: + +```log +...(maybe unrelated lines)... +systemd[1]: Started Simple Desktop Display Manager. +sudo[1123]: pam_unix(sudo:session): session closed for user root +sddm[1150]: Initializing... +sddm[1150]: Starting... +sddm[1150]: Logind interface found +sddm[1150]: Adding new display... +sddm[1150]: Loaded empty theme configuration +sddm[1150]: Xauthority path: "/run/sddm/xauth_XyLFOm" +sddm[1150]: Using VT 1 +sddm[1150]: Display server starting... +sddm[1150]: Writing cookie to "/run/sddm/xauth_XyLFOm" +sddm[1150]: Running: /usr/bin/X -nolisten tcp -background none -seat seat0 vt1 -auth /run/sddm/xauth_XyLFOm -noreset -displayfd 16 +sddm[1150]: Setting default cursor +sddm[1150]: Running display setup script "/usr/share/sddm/scripts/Xsetup" +sddm[1150]: Display server started. +sddm[1150]: Socket server starting... +sddm[1150]: Socket server started. +sddm[1150]: Loading theme configuration from "/usr/share/sddm/themes/sugar-candy/theme.conf" +sddm[1150]: Greeter starting... +sddm-helper[1217]: [PAM] Starting... +sddm-helper[1217]: [PAM] Authenticating... +sddm-helper[1217]: [PAM] returning. +sddm-helper[1217]: pam_unix(sddm-greeter:session): session opened for user sddm(uid=950) by (uid=0) +systemd-logind[773]: New session 'c2' of user 'sddm' with class 'greeter' and type 'x11'. +systemd[1]: Started Session c2 of User sddm. +sddm-helper[1217]: Writing cookie to "/tmp/xauth_Qghqzs" +sddm-helper[1217]: Starting X11 session: "" "/usr/bin/sddm-greeter --socket /tmp/sddm-:0-YHEwdP --theme /usr/share/sddm/themes/sugar-candy" +sddm[1150]: Greeter session started successfully +...(maybe unrelated lines)... +``` + +
+ +## How + +The key is to avoid the timing race between nvidia init and sddm start. There are multiple ways to achieve this, two for example: + +### Early KMS: + +As described in [Hyprland WIKI](https://wiki.hypr.land/Nvidia/#early-kms-modeset-and-fbdev), this ensures that the NVIDIA driver is loaded in the initramfs and is ready before SDDM starts. + +1. enable `modset` in kernel parameters (e.g. in `/etc/default/grub`): + +``` +GRUB_CMDLINE_LINUX_DEFAULT="... nvidia-drm.modeset=1 ..." +``` + +and update grub: + +```sh +sudo grub-mkconfig -o /boot/grub/grub.cfg +``` + +2. specify early loaded modules in `/etc/mkinitcpio.conf`: + +``` +MODULES=(... nvidia nvidia_modeset nvidia_uvm nvidia_drm ...) +``` + +and regenerate initramfs: + +```sh +sudo mkinitcpio -P +``` + +3. reboot + +### Delay starting SDDM: + +`sudo systemctl edit sddm.service` + +```ini +[Service] +ExecStartPre=/bin/sleep 2 +``` + +should also do the trick, but less elegant. diff --git a/memo/plasma-wrong-ntfmgr.md b/memo/wrong-ntfmgr.md similarity index 68% rename from memo/plasma-wrong-ntfmgr.md rename to memo/wrong-ntfmgr.md index fb13f46..b114559 100644 --- a/memo/plasma-wrong-ntfmgr.md +++ b/memo/wrong-ntfmgr.md @@ -1,4 +1,4 @@ -当安装了其他 notification manager 时,plasma 在启动时可能会选择错误的 notification manager 导致通知中心无法正常工作 (虽然平时也并不怎么在意这玩意,用什么 daemon 都无所谓,只要有通知看就行) +当安装了其他通知服务时,plasma 在启动时可能会选择错误的通知服务导致通知中心无法正常工作 (虽然平时也并不怎么在意这玩意,用什么 daemon 都无所谓,只要有通知看就行) 如何知道是否是这种情况呢?以 mako 为例: @@ -21,15 +21,11 @@ ``` 那就是这种情况了。 -解决方法也很简单,启动时屏蔽掉错误的服务,例如: - -```sh -systemctl --user mask mako.service -``` - -或者将 plasmashell 的 notificationmanager 优先级提高: +解决方法之一,将 plasma 的通知服务的优先级提高: ```sh mkdir -p ~/.local/share/dbus-1/services/ ln -s /usr/share/dbus-1/services/org.kde.plasma.Notifications.service ~/.local/share/dbus-1/services/org.kde.plasma.Notifications.service ``` + +或者放到 `/usr/local/share/dbus-1/services/` 也可以提高优先级。