This commit is contained in:
2025-11-14 02:54:05 +01:00
parent 7870b33e80
commit 85a981e522
9 changed files with 272 additions and 23 deletions

View File

@@ -41,7 +41,7 @@ if type -q fzf
# fyi: fuzzy yay install # fyi: fuzzy yay install
function fyi 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" if test -n "$pkg"
yay -S $pkg yay -S $pkg
end end

View File

@@ -1,4 +1,4 @@
WM 下 Dolphin 前景色可能会很奇怪,在 .config/dolphinrc 中添加以下内容可以解决: 不在 KDE 中运行 Dolphin 前景色可能会很奇怪,在 .config/dolphinrc 中指定颜色主题可以解决:
```conf ```conf
[UiSettigs] [UiSettigs]

View File

@@ -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 ### 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 ```bash
sudo timedatectl set-local-rtc 1 sudo timedatectl set-local-rtc 1
``` ```
```bash ```bash
sudo hwclock --systohc --localtime sudo hwclock --systohc --localtime
``` ```

103
memo/fontconfig.md Normal file
View File

@@ -0,0 +1,103 @@
感觉不适合放到 stow 包里,毕竟这取决于系统上安装了哪些字体。那就放 memo 里好了。
> path: `~/.config/fontconfig/fonts.conf`.
```xml
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
<!--
Artificial oblique for fonts without an italic or oblique version
-->
<match target="font">
<!-- check to see if the font is roman -->
<test name="slant">
<const>roman</const>
</test>
<!-- check to see if the pattern requested non-roman -->
<test compare="not_eq" name="slant" target="pattern">
<const>roman</const>
</test>
<!-- multiply the matrix to slant the font -->
<edit mode="assign" name="matrix">
<times>
<name>matrix</name>
<matrix>
<double>1</double>
<double>0.2</double>
<double>0</double>
<double>1</double>
</matrix>
</times>
</edit>
<!-- pretend the font is oblique now -->
<edit mode="assign" name="slant">
<const>oblique</const>
</edit>
<!-- and disable embedded bitmaps for artificial oblique -->
<edit mode="assign" name="embeddedbitmap">
<bool>false</bool>
</edit>
</match>
<!--
Synthetic emboldening for fonts that do not have bold face available
-->
<match target="font">
<!-- check to see if the weight in the font is less than medium which possibly need emboldening -->
<test compare="less_eq" name="weight">
<const>medium</const>
</test>
<!-- check to see if the pattern requests bold -->
<test compare="more_eq" name="weight" target="pattern">
<const>bold</const>
</test>
<!--
set the embolden flag
needed for applications using cairo, e.g. gucharmap, gedit, ...
-->
<edit mode="assign" name="embolden">
<bool>true</bool>
</edit>
<!--
set weight to bold
needed for applications using Xft directly, e.g. Firefox, ...
-->
<edit mode="assign" name="weight">
<const>bold</const>
</edit>
</match>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
<family>Noto Sans CJK SC</family>
<family>Noto Sans CJK JP</family>
<family>Noto Sans CJK KR</family>
<family>Maple Mono NF CN</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>Noto Serif CJK SC</family>
<family>Noto Serif CJK JP</family>
<family>Noto Serif CJK KR</family>
<family>Maple Mono NF CN</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Maple Mono NF CN</family>
<family>Noto Sans Mono</family>
<family>Noto Sans Mono CJK SC</family>
<family>Noto Sans Mono CJK JP</family>
<family>Noto Sans Mono CJK KR</family>
</prefer>
</alias>
</fontconfig>
```

View File

@@ -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

5
memo/grub-install-id.md Normal file
View File

@@ -0,0 +1,5 @@
在执行 grub-install 时,会有一个参数 `--bootloader-id=` 指定引导的名称,虽然都说随便写,但是同一个设备上的两个引导不能使用相同的名称,否则会冲突。
警钟长鸣。
(就这个问题居然让我排查了半下午,天)

View File

156
memo/sddm-blank.md Normal file
View File

@@ -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.
<details>
<summary>evidence</summary>
- 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=[<unknown>] rhost=[<unknown>]
(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)...
```
</details>
## 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.

View File

@@ -1,4 +1,4 @@
当安装了其他 notification manager 时plasma 在启动时可能会选择错误的 notification manager 导致通知中心无法正常工作 <s>(虽然平时也并不怎么在意这玩意,用什么 daemon 都无所谓,只要有通知看就行)</s> 当安装了其他通知服务时plasma 在启动时可能会选择错误的通知服务导致通知中心无法正常工作 <s>(虽然平时也并不怎么在意这玩意,用什么 daemon 都无所谓,只要有通知看就行)</s>
如何知道是否是这种情况呢?以 mako 为例: 如何知道是否是这种情况呢?以 mako 为例:
@@ -21,15 +21,11 @@
``` ```
那就是这种情况了。 那就是这种情况了。
解决方法也很简单,启动时屏蔽掉错误的服务,例如 解决方法之一,将 plasma 的通知服务的优先级提高
```sh
systemctl --user mask mako.service
```
或者将 plasmashell 的 notificationmanager 优先级提高:
```sh ```sh
mkdir -p ~/.local/share/dbus-1/services/ 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 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/` 也可以提高优先级。