From 5fffcbcd5369e7c72eadac6444c92d940f26895c Mon Sep 17 00:00:00 2001 From: "SilverAg.L" Date: Tue, 14 Oct 2025 15:04:30 +0800 Subject: [PATCH] update - remove powershell deps - rewrite readme - fully use YukiLauncher --- .config/niri/config.kdl | 6 +- .../default.target.wants/mpris-proxy.service | 1 - .../default.target.wants/playerctld.service | 1 - .config/systemd/user/mpris-proxy.service | 10 --- .config/systemd/user/playerctld.service | 10 --- .zprofile | 14 ++-- .zshrc | 10 +++ bin/fuzzel-vsc-entries.ps1 | 10 --- bin/fuzzel-vsc-entries.sh | 15 +++++ bin/fuzzel-win+r.ps1 | 8 --- bin/fuzzel-win+r.sh | 3 + bin/ykrun | 2 + readme.md | 64 ++++++++----------- 13 files changed, 69 insertions(+), 85 deletions(-) delete mode 120000 .config/systemd/user/default.target.wants/mpris-proxy.service delete mode 120000 .config/systemd/user/default.target.wants/playerctld.service delete mode 100644 .config/systemd/user/mpris-proxy.service delete mode 100644 .config/systemd/user/playerctld.service delete mode 100755 bin/fuzzel-vsc-entries.ps1 create mode 100755 bin/fuzzel-vsc-entries.sh delete mode 100755 bin/fuzzel-win+r.ps1 create mode 100755 bin/fuzzel-win+r.sh create mode 100755 bin/ykrun diff --git a/.config/niri/config.kdl b/.config/niri/config.kdl index 9b5598f..bc90c97 100644 --- a/.config/niri/config.kdl +++ b/.config/niri/config.kdl @@ -230,7 +230,7 @@ window-rule { open-floating true default-floating-position x=8 y=8 relative-to="bottom-right" open-focused false - open-on-output "HDMI-A-1" + open-on-output "eDP-1" } spawn-at-startup "waybar" @@ -253,8 +253,8 @@ binds { Mod+E hotkey-overlay-title="Explorer (yazi)" { spawn "foot" "yazi"; } //Shift+Mod+Return hotkey-overlay-title="Steam" { spawn "steam"; } - Mod+F12 hotkey-overlay-title="Open Projects ... (VSCode)" { spawn "~/.local/bin/fuzzel-vsc-entries.ps1"; } - Mod+Space hotkey-overlay-title="Run a command ... (fuzzel)" { spawn "~/.local/bin/fuzzel-win+r.ps1"; } + Mod+F12 hotkey-overlay-title="Open Projects ... (VSCode)" { spawn "~/.niri-dotfiles/bin/fuzzel-vsc-entries.sh"; } + Mod+Space hotkey-overlay-title="Run a command ... (fuzzel)" { spawn "~/.niri-dotfiles/bin/fuzzel-win+r.sh"; } // Applications such as remote-desktop clients and software KVM switches may // request that niri stops processing the keyboard shortcuts defined here diff --git a/.config/systemd/user/default.target.wants/mpris-proxy.service b/.config/systemd/user/default.target.wants/mpris-proxy.service deleted file mode 120000 index cb275c8..0000000 --- a/.config/systemd/user/default.target.wants/mpris-proxy.service +++ /dev/null @@ -1 +0,0 @@ -/home/agxcoy/.config/systemd/user/mpris-proxy.service \ No newline at end of file diff --git a/.config/systemd/user/default.target.wants/playerctld.service b/.config/systemd/user/default.target.wants/playerctld.service deleted file mode 120000 index 960ef94..0000000 --- a/.config/systemd/user/default.target.wants/playerctld.service +++ /dev/null @@ -1 +0,0 @@ -/home/agxcoy/.config/systemd/user/playerctld.service \ No newline at end of file diff --git a/.config/systemd/user/mpris-proxy.service b/.config/systemd/user/mpris-proxy.service deleted file mode 100644 index 082a0b7..0000000 --- a/.config/systemd/user/mpris-proxy.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Forward bluetooth media controls to MPRIS - -[Service] -Type=simple -ExecStart=/usr/bin/mpris-proxy - -[Install] -WantedBy=default.target - diff --git a/.config/systemd/user/playerctld.service b/.config/systemd/user/playerctld.service deleted file mode 100644 index 806d256..0000000 --- a/.config/systemd/user/playerctld.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Keep track of media player activity - -[Service] -Type=oneshot -ExecStart=/usr/bin/playerctld daemon - -[Install] -WantedBy=default.target - diff --git a/.zprofile b/.zprofile index 79e97cc..a6cffc0 100644 --- a/.zprofile +++ b/.zprofile @@ -1,11 +1,17 @@ # init at each startup mkdir -p /tmp/$USER #ln -sf /tmp/$UID $HOME/.tmp -[[ ! -L $HOME/.tmp ]] && rm -f $HOME/.tmp && ln -s /tmp/$USER $HOME/.tmp +[ $(readlink -f $HOME/.tmp) = "/tmp/$USER" ] || { + rm -f $HOME/.tmp + ln -s /tmp/$USER $HOME/.tmp +} # avoid dumplicate env appending. -[[ -f /run/user/$UID/.zshlogon ]] && return -touch /run/user/$UID/.zshlogon +# [[ -f /run/user/$UID/.zshlogon ]] && return +# touch /run/user/$UID/.zshlogon -export PATH="$HOME/.local/bin:$PATH" +PATH="$HOME/.local/bin:$PATH" +PATH="$HOME/.niri-dotfiles/bin:$PATH" + +export -U PATH export EDITOR=nano diff --git a/.zshrc b/.zshrc index b2d3d3f..1d78dde 100644 --- a/.zshrc +++ b/.zshrc @@ -140,4 +140,14 @@ unset key [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh # USER MANUAL CONFIGS + +# https://unix.stackexchange.com/questions/608842/zshrc-export-gpg-tty-tty-says-not-a-tty export GPG_TTY=$TTY + +alias ykls='systemctl --user status YukiLauncher.slice' +alias yksuspend='systemctl --user freeze YukiLauncher.slice' +alias ykcout='systemctl --user thaw YukiLauncher.slice' +alias ykexit='systemctl --user stop YukiLauncher.slice' + +alias susp="systemctl --user freeze" +alias cont="systemctl --user thaw" diff --git a/bin/fuzzel-vsc-entries.ps1 b/bin/fuzzel-vsc-entries.ps1 deleted file mode 100755 index 4e59119..0000000 --- a/bin/fuzzel-vsc-entries.ps1 +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/pwsh - -$desktop="$env:HOME/Desktop" - -$fsarg=(Get-ChildItem $desktop -FollowSymlink | ForEach-Object { - if ($_ -is [System.IO.DirectoryInfo]) { return "$($_.Name)/" } - else { return $_.Name } -} | fuzzel --dmenu --prompt="Open with VSCode (~/Desktop): ") - -$fsarg -and (Start-Process code -ArgumentList @("$desktop/$fsarg")) diff --git a/bin/fuzzel-vsc-entries.sh b/bin/fuzzel-vsc-entries.sh new file mode 100755 index 0000000..09fc895 --- /dev/null +++ b/bin/fuzzel-vsc-entries.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +desktop="$HOME/Desktop" + +options="" +for item in $(ls $desktop); do + options+=$item + if [[ -d "$desktop/$item" ]]; then + options+='/' + fi + options+="\n" +done + +fsarg=$(echo -en "$options" | fuzzel --dmenu --prompt="Open Project with VSCode:") +[ -z "$fsarg" ] || ykrun code "$desktop/$fsarg" diff --git a/bin/fuzzel-win+r.ps1 b/bin/fuzzel-win+r.ps1 deleted file mode 100755 index b5176d4..0000000 --- a/bin/fuzzel-win+r.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/pwsh - -$option=(fuzzel --dmenu --prompt-only="Command to execute: ") - -$option -and ( - # garbage `start-process`. - systemd-run --user --scope --slice=AgExecBar.slice --unit="$(($option -split " ")[0])-$PID".scope /bin/sh -c "$option" -) diff --git a/bin/fuzzel-win+r.sh b/bin/fuzzel-win+r.sh new file mode 100755 index 0000000..6843769 --- /dev/null +++ b/bin/fuzzel-win+r.sh @@ -0,0 +1,3 @@ +#!/bin/bash +option=$(fuzzel --dmenu --prompt-only="Command to execute: ") +[ -z "$option" ] || ykrun $option diff --git a/bin/ykrun b/bin/ykrun new file mode 100755 index 0000000..5e7226d --- /dev/null +++ b/bin/ykrun @@ -0,0 +1,2 @@ +#!/bin/bash +systemd-run --user --scope --slice=YukiLauncher.slice --unit="$1-$$".scope /bin/sh -c '"$@"' _ "$@" diff --git a/readme.md b/readme.md index 715c71c..d8cd28d 100644 --- a/readme.md +++ b/readme.md @@ -6,51 +6,39 @@ > [!note] > 本仓库的配置管理方案比较原始:逐个做软链接处理。有觉得`stow`等工具好用,想要重新组织文件树的欢迎 pr. +> - `.config/**` -> `$HOME/.config/**` +> - `bin` -> `$HOME/.local/bin` +> > 其中带后缀(如`.sh`)的脚本仅供 niri 等组件调用,设计上并不希望在终端里启动。 +> +> - `.z*` -> `$HOME/.z*` +> - `default-electron-flags` -> `$HOME/.config/*-flags.conf` (code, chrome) +> > QQ 不适用这组参数,另见 archlinuxcn 社区论坛。 + +> [!note] +> 还有一些较早做的配置,以及全局配置(像 sddm)并不方便合进来,由于篇幅和复述可靠性有限,就略过罢。 ## 鸣谢 - 雪叶 [@Vescrity](https://github.com/Vescrity) (Yukitoha) - fizzyizzy05 (Isabelle Jackson, mtf) ## 已知依赖 -> [!note] -> 从 WSL 里测试开始,配这些组件先后花了我两个多月时间。 -> 恕我很难回忆出都用过什么。 +> 仅列出**想得起来的**依赖软件包。 -- `niri`,以及`yay -Si`中指定的可选依赖。 -- `swww`(从 fizzy 那毛的双层背景方案) -- ZshIM (`zim`):主要为了 powerlevel10k. - - 不再考虑 `oh-my-zsh`. - - 也不需要用包管理器装插件(像语法高亮),这些 zim 默认就集成了。 -- `powershell-bin`:用于便捷地拉起新进程。 - -> 在`.sh`里总是纠结用`command &`还是`nohup`还是别的什么。 -> 而 pwsh 的`start-process`在 Linux 的实现似乎有用到 xdg-open,直接跑命令的效果又类似`command &`,实际用下来感觉不如 sh。 -> 但胜在容易写。搁 bash 里写`fuzzel-vsc-entries`就只能字符串拼接之后`echo`进管道,pwsh 则支持直接把 .NET 对象送进管道。 - -## 后续替换 -``` -alacritty -> foot -nautilus (gnome files) -> yazi (console) -swaylock -> gtklock -gnome-keyring -> kwallet (kd6), kwallet-pam (to auto unlock), kwalletmanager (optional) -com.saivert.pwvucontrol (flatpak) -> pavucontrol-qt (extra) -... -``` +|依赖|配置|备注| +|-|-|-| +|niri|`.config/niri/config.kdl`| +|`fuzzel`|`.config/fuzzel/*`| +|`mako`|`.config/mako/*`| +|`swww`|`bin/chbg` (bash)|另需`imagemagick`来生成图片的高斯模糊版本。| +|`gtklock`|`.config/gtklock/*`|现阶段无法跟`swayidle`合用,尽管其 Wiki 鼓励这么做。| +|`xdg-desktop-portal-(gtk\|gnome)`|`.config/xdg-desktop-portal/*-portals.conf`|GNOME 支持最全,但称不上好看(| +|`kwallet`|VSCode 试图登录时会弹出向导让你配的。|替代`gnome-keyring`。建议加装`kwallet-pam`,免得 VSCode 自己尝试解锁结果闪退。| +|foot|`.config/foot/foot.ini`| +|yazi|`.config/yazi/*`|替代`nautilus`;另用`fake-nautilus`移除`nautilus`包。| +|fastfetch|`.config/fastfetch/*`| +|waybar|`.config/waybar/*`| +|`mpris`|`systemctl --user`服务|参见 ArchWiki.| +|`pavucontrol-qt`| ## 参考资源与备注 - Nerd 字体:[Monaco Nerd Font Mono (MelodyEcho ver.)](https://glowmem.com/upload/articles/archlinux-note/Monaco_Nerd_Font_Mono-Regular.ttf) 或直接`ttf-monaco-nerd-font`(AUR)。后者在 VSCode 里表现不咋地。 - -> [!note] -> 壁纸自己用`chbg`生成。 - -> [!important] -> Niri 里的 linuxqq 不能直接用`default-electron-flags`。改用以下标签: -> - `--enable-platform=wayland` -> - `--enable-wayland-ime` -> - `--wayland-text-input-version=3` -> -> 至于原因,可参见 archlinuxcn 社区论坛。 - -> [!note] -> `fcitx5`的配置基本上和 Miku 指南所述一致,就不再合进来了; -> 其余各 App 仍有一些兼容问题,排查后再更新此文档。