Compare commits

..

5 Commits

31 changed files with 440 additions and 772 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
# Proxy, set in environment.d?
http_proxy="http://127.0.0.1:7890/"
https_proxy="http://127.0.0.1:7890/"
# firefox 记得单独配一次.
# also needs manual configuration in firefox.
no_proxy="127.*,192.168.*,10.147.17.*"
+2 -2
View File
@@ -43,7 +43,7 @@
<string>LXGW WenKai Mono</string>
<string>Noto Sans Mono CJK SC</string>
<string>Noto Color Emoji</string>
<string>MesloLGS NF</string>
<string>Monaco Nerd Font Mono</string>
<string>Comic Mono</string>
</edit>
</match>
@@ -75,7 +75,7 @@
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Comic Mono</string>
<string>MesloLGS NF</string>
<string>Monaco Nerd Font Mono</string>
<string>Noto Sans Mono CJK SC</string>
<string>Noto Color Emoji</string>
</edit>
+3 -3
View File
@@ -9,7 +9,7 @@
# title=foot
# locked-title=no
font=MesloLGS NF:size=11
font=Monaco Nerd Font Mono:size=11
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
@@ -64,7 +64,7 @@ osc8-underline=always
# hide-when-typing=no
# alternate-scroll-mode=yes
[colors-dark]
[colors]
alpha=0.9
# foreground=dcdccc
# background=000000
@@ -180,4 +180,4 @@ find-next=Control+n
# select-row=BTN_LEFT-3
[main]
include=~/.config/foot/themes/noctalia
include=/usr/share/foot/themes/rose-pine
+1 -2
View File
@@ -1,6 +1,6 @@
[main]
anchor = top
font = MesloLGSNF:size=13
font = MonacoNerdFontMono:size=13
#dpi-aware = no
terminal = foot
y-margin = 16
@@ -25,4 +25,3 @@ selection-text = e0def4ff
selection-match = ebbcbaff
prompt = 908caaff
input = 9ccfd8ff
include=~/.config/fuzzel/themes/noctalia
@@ -2,12 +2,12 @@
transition: 1000ms ease ;
}
window {
background-image: url("/home/agxcoy/.cache/wallpaper_blur");
background-image: url("/home/agxcoy/.local/share/.wallpaper_blur");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-color: rgba(0,0,0,0.3);
font-family: 'monospace';
font-family: 'Monaco Nerd Font Mono';
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7)
}
#input-field {
@@ -11,7 +11,7 @@ icons=1
max-icon-size=32
default-timeout=5000
ignore-timeout=1
font=MesloLGSNF 11
font=MonacoNerdFontMono 11
padding=8
[urgency=low]
-226
View File
@@ -1,226 +0,0 @@
// 芝士快捷键表。我自己也很难说能熟练用,所以从`config.kdl`里拆出来了。所幸它支持 include。
binds {
Mod+F1 hotkey-overlay-title="显示帮助喵" { show-hotkey-overlay; }
Mod+Return hotkey-overlay-title="终端 (foot)" { spawn "foot"; }
Mod+F9 hotkey-overlay-title="浏览器 (chrome)" { spawn "google-chrome-stable"; }
Mod+E hotkey-overlay-title="文件管理器 (yazi)" { spawn "foot" "yazi"; }
//Shift+Mod+Return hotkey-overlay-title="Steam" { spawn "steam"; }
Mod+F12 hotkey-overlay-title="打开桌面项目 ... (VSCode)" { spawn ".fuzzel-vscode"; }
Mod+R hotkey-overlay-title="运行命令 ... (fuzzel)" { spawn ".fuzzel-startb"; }
Mod+Space hotkey-overlay-title="启动面板 (Noctalia)" { spawn-sh "qs -c noctalia-shell ipc call launcher toggle"; }
// Applications such as remote-desktop clients and software KVM switches may
// request that niri stops processing the keyboard shortcuts defined here
// so they may, for example, forward the key presses as-is to a remote machine.
// It's a good idea to bind an escape hatch to toggle the inhibitor,
// so a buggy application can't hold your session hostage.
//
// The allow-inhibiting=false property can be applied to other binds as well,
// which ensures niri always processes them, even when an inhibitor is active.
Mod+Alt+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
XF86PowerOff hotkey-overlay-title="电源管理 (Noctalia)" { spawn-sh "qs -c noctalia-shell ipc call sessionMenu toggle"; }
Super+Escape hotkey-overlay-title="锁屏 (Noctalia)" { spawn-sh "qs -c noctalia-shell ipc call lockScreen lock"; }
Mod+Delete hotkey-overlay-title="锁屏并睡眠... (Noctalia)" allow-when-locked=true { spawn-sh "qs -c noctalia-shell ipc call sessionMenu lockAndSuspend"; }
// 有兴趣可以自己替换成 noctalia 的命令行。我是发现保持现状依然可以看到视觉反馈,没必要替换。
XF86AudioRaiseVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
XF86AudioLowerVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
XF86AudioMute hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
//Mod+Shift+M allow-when-locked=true { spawn "swayosd-client" "--input-volume" "mute-toggle"; }
// 这块还真得换。`yay -Rs waybar` 发现 playerctl 也给带走了。
XF86AudioPlay allow-when-locked=true { spawn-sh "qs -c noctalia-shell ipc call media playPause"; }
XF86AudioPause allow-when-locked=true { spawn-sh "qs -c noctalia-shell ipc call media playPause"; }
XF86AudioNext allow-when-locked=true { spawn-sh "qs -c noctalia-shell ipc call media next"; }
XF86AudioPrev allow-when-locked=true { spawn-sh "qs -c noctalia-shell ipc call media previous"; }
XF86AudioStop allow-when-locked=true { spawn-sh "qs -c noctalia-shell ipc call media stop"; }
// 结果 Noctalia 自己就依赖 brightnessctl。那留着。
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+5%"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "5%-"; }
// 有些键位懒得补汉化说明,自己摁两下就知道了。
Alt+Tab hotkey-overlay-title=null repeat=false { toggle-overview; }
Alt+F4 { close-window; }
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
//Mod+H { focus-column-left; }
//Mod+J { focus-window-down; }
//Mod+K { focus-window-up; }
//Mod+L { focus-column-right; }
Mod+Shift+Left { move-column-left; }
Mod+Shift+Down { move-window-down; }
Mod+Shift+Up { move-window-up; }
Mod+Shift+Right { move-column-right; }
//Mod+Shift+H { move-column-left; }
//Mod+Shift+J { move-window-down; }
//Mod+Shift+K { move-window-up; }
//Mod+Shift+L { move-column-right; }
// Alternative commands that move across workspaces when reaching
// the first or last window in a column.
// Mod+J { focus-window-or-workspace-down; }
// Mod+K { focus-window-or-workspace-up; }
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
Mod+Ctrl+Left { focus-monitor-left; }
Mod+Ctrl+Down { focus-monitor-down; }
Mod+Ctrl+Up { focus-monitor-up; }
Mod+Ctrl+Right { focus-monitor-right; }
//Mod+Ctrl+H { focus-monitor-left; }
//Mod+Ctrl+J { focus-monitor-down; }
//Mod+Ctrl+K { focus-monitor-up; }
//Mod+Ctrl+L { focus-monitor-right; }
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
//Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
//Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
//Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
//Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
// Alternatively, there are commands to move just a single window:
// Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
// ...
// And you can also move a whole workspace to another monitor:
// Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
// ...
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
//Mod+U { focus-workspace-down; }
//Mod+I { focus-workspace-up; }
Mod+Shift+Page_Down { move-column-to-workspace-down; }
Mod+Shift+Page_Up { move-column-to-workspace-up; }
//Mod+Shift+U { move-column-to-workspace-down; }
//Mod+Shift+I { move-column-to-workspace-up; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
// ...
Mod+Ctrl+Page_Down { move-workspace-down; }
Mod+Ctrl+Page_Up { move-workspace-up; }
//Mod+Ctrl+U { move-workspace-down; }
//Mod+Ctrl+I { move-workspace-up; }
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
Mod+Shift+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Shift+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Shift+WheelScrollRight { move-column-right; }
Mod+Shift+WheelScrollLeft { move-column-left; }
// Usually scrolling up and down with Shift in applications results in
// horizontal scrolling; these binds replicate that.
// Mod+Shift+WheelScrollDown { focus-column-right; }
// Mod+Shift+WheelScrollUp { focus-column-left; }
// Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
// Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
// Similarly, you can bind touchpad scroll "ticks".
// Touchpad scrolling is continuous, so for these binds it is split into
// discrete intervals.
// These binds are also affected by touchpad's natural-scroll, so these
// example binds are "inverted", since we have natural-scroll enabled for
// touchpads by default.
// Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
// Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Shift+1 { move-column-to-workspace focus=false 1 ; }
Mod+Shift+2 { move-column-to-workspace focus=false 2 ; }
Mod+Shift+3 { move-column-to-workspace focus=false 3 ; }
Mod+Shift+4 { move-column-to-workspace focus=false 4 ; }
Mod+Shift+5 { move-column-to-workspace focus=false 5 ; }
Mod+Shift+6 { move-column-to-workspace focus=false 6 ; }
Mod+Shift+7 { move-column-to-workspace focus=false 7 ; }
Mod+Shift+8 { move-column-to-workspace focus=false 8 ; }
Mod+Shift+9 { move-column-to-workspace focus=false 9 ; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+1 { move-window-to-workspace 1; }
// Switches focus between the current and the previous workspace.
// Mod+Tab { focus-workspace-previous; }
Mod+Comma { consume-window-into-column; }
Mod+Period { expel-window-from-column; }
Mod+Shift+V { toggle-window-floating; }
Mod+V { switch-focus-between-floating-and-tiling; }
Mod+BracketLeft { consume-or-expel-window-left; }
Mod+BracketRight { consume-or-expel-window-right; }
Mod+X { switch-preset-column-width; }
Mod+Shift+X { switch-preset-window-height; }
Mod+Ctrl+X { reset-window-height; }
Mod+F11 { maximize-column; }
Mod+Shift+F11 { toggle-windowed-fullscreen; }
Mod+Ctrl+F11 { fullscreen-window; }
Mod+T hotkey-overlay-title="将整列窗口撑满整个显示器" { expand-column-to-available-width; }
Mod+W hotkey-overlay-title="用页签表示(所选)窗口所在列" { toggle-column-tabbed-display; }
Mod+C { center-column; }
Mod+Ctrl+C { center-visible-columns; }
// Finer width adjustments.
// This command can also:
// * set width in pixels: "1000"
// * adjust width in pixels: "-5" or "+5"
// * set width as a percentage of screen width: "25%"
// * adjust width as a percentage of screen width: "-10%" or "+10%"
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
// set-column-width "100" will make the column occupy 200 physical screen pixels.
Mod+Minus { set-column-width "-5%"; }
Mod+Equal { set-column-width "+5%"; }
// Finer height adjustments when in column with other windows.
Mod+Shift+Minus { set-window-height "-5%"; }
Mod+Shift+Equal { set-window-height "+5%"; }
// Actions to switch layouts.
// Note: if you uncomment these, make sure you do NOT have
// a matching layout switch hotkey configured in xkb options above.
// Having both at once on the same hotkey will break the switching,
// since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
// Mod+Space { switch-layout "next"; }
// Mod+Shift+Space { switch-layout "prev"; }
Print hotkey-overlay-title=null { screenshot-screen; }
Mod+Shift+S hotkey-overlay-title="截取矩形画面(和 Win11 类似)" { screenshot; }
Alt+Print { screenshot-window; }
// Powers off the monitors. To turn them back on, do any input like
// moving the mouse or pressing any other key.
//Mod+Shift+P { power-off-monitors; }
}
-98
View File
@@ -1,98 +0,0 @@
// 这是窗口布局表。由于经常改,也拆出来了。
window-rule {
geometry-corner-radius 6
clip-to-geometry true
}
window-rule {
// 以下应用*不应该*开模糊——开了模糊也只是附上一层边框色,并不具备通常意义上的亚克力、云母质感。
// 排除列表随时更新。因为我测不过来。
// 另注:为什么不用正则组合成一行?正则越长性能开销越大。况且单独的应用方便用注释切换。
exclude app-id="QQ"
exclude app-id="wechat"
exclude app-id="steam"
exclude app-id="google-chrome"
exclude app-id="org.telegram.desktop"
exclude app-id=".exe$" // wine
exclude title=r#"Visual Studio Code$"# app-id=r#"^code"#
// 以下应用*不推荐*开模糊——尽管开了也没什么大问题,但体验内容时容易分散注意力。
exclude app-id="vlc"
exclude app-id="nwjs" // rpgmaker games.
// match app-id="(foot|obs)"
opacity 0.8
background-effect {
blur true
xray false
}
}
window-rule {
match app-id="QQ"
match app-id="[Ee]lectron" title="MetaCubeXD$"
match app-id="wechat"
match app-id="org.telegram.desktop"
match app-id="nwjs" // mainly for rpgmaker games.
// open-on-output "eDP-1"
block-out-from "screencast"
}
window-rule {
match app-id="com.obsproject.Studio"
// default-column-width { proportion 0.6; }
open-on-output "eDP-1"
}
/-window-rule {
match app-id="google-chrome"
default-column-width { proportion 0.6; }
}
window-rule {
match app-id="[Ee]lectron" title="Test" // frg2089.BiliLive.Observer
match app-id="[Ee]lectron" title="Blivechat-Openlive" // blivechat
default-column-width { proportion 0.42; }
// default-column-display "tabbed"
open-on-output "eDP-1"
}
window-rule {
match title="^(图片查看器|.*记录)$" app-id="QQ"
match app-id="pavucontrol-qt"
default-column-width { proportion 0.6; }
default-window-height { proportion 0.85; }
open-floating true
}
window-rule {
match app-id="nwjs"
default-column-width { proportion 0.85; }
default-window-height { proportion 0.9; }
open-floating true
}
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
match app-id=r#"^org\.kde\.ksecretd$"#
open-floating true
}
window-rule {
// match title=r#"Code - OSS$"#
match title=r#"Visual Studio Code$"# app-id=r#"^code"#
// match app-id="krita"
open-maximized true
}
window-rule {
// match app-id=r#"firefox$"# title="^Picture-in-Picture$"
match app-id="steam" title="Friends List"
open-floating true
default-floating-position x=8 y=8 relative-to="bottom-right"
open-focused false
open-on-output "eDP-1"
}
+307 -37
View File
@@ -1,4 +1,4 @@
// edited. thx to fizzyizzy05 & silvaire-qwq.
// edited. thx to fizzyizzy05.
input {
keyboard {
xkb {
@@ -41,26 +41,23 @@ input {
}
warp-mouse-to-focus
// 还需要在`/etc/systemd/logind.conf`里屏蔽关机键行为.
disable-power-key-handling
focus-follows-mouse max-scroll-amount="0%"
}
output "eDP-1" {
scale 1.25
position x=1920 y=0
}
output "HDMI-A-1" {
mode "1920x1080@180.000"
position x=0 y=0
//position x=1920 y=0
focus-at-startup
}
layout {
gaps 8
gaps 6
background-color "transparent"
center-focused-column "never"
preset-column-widths {
@@ -122,23 +119,36 @@ layout {
}
}
hotkey-overlay {
skip-at-startup
hide-not-bound
}
layer-rule {
match namespace="^swww-daemonblur$"
place-within-backdrop true
}
overview {
backdrop-color "#26233a"
zoom 0.5
}
layer-rule {
match namespace="^noctalia-overview*"
place-within-backdrop true
switch-events {
lid-close { spawn "bash" "-c" "swaylock" "&&" "systemctl" "suspend"; }
}
layer-rule {
match namespace="^noctalia-(background|launcher-overlay|dock)-.*$"
background-effect {
xray false
gestures {
hot-corners {
off
}
}
prefer-no-csd
screenshot-path "~/.tmp/Screenshots/%Y-%m-%d %H-%M-%S.png"
// screenshot-path null
animations {
// off
@@ -183,15 +193,73 @@ animations {
}
}
// 我看雪叶是把能拆的大板块都拆得一干二净,但就我这份配置而言,拆两份常用的出来已经足矣。
// 部分视觉效果拆出去可能还会失效(比如窗口边框)。
include "config-window.kdl"
include "config-keyboard.kdl"
window-rule {
geometry-corner-radius 6
clip-to-geometry true
}
// spawn-at-startup "waybar" // 建议交给 systemctl --user,它自己没法热重载。
// spawn-sh-at-startup "wl-paste --watch cliphist store"
// spawn-at-startup "awww-daemon"
spawn-at-startup "qs" "-c" "noctalia-shell"
window-rule {
match app-id="QQ"
match app-id="Electron" title="yacd" // Yet Another Clash Daemon (webui)
match app-id="wechat"
// open-on-output "eDP-1"
block-out-from "screencast"
}
window-rule {
match app-id="com.obsproject.Studio"
match app-id="Electron" title="Test" // frg2089.BiliLive.Observer
match app-id="Electron" title="Blivechat-Openlive" // blivechat
default-column-display "tabbed"
open-on-output "eDP-1"
}
window-rule {
match title="^(图片查看器|.*记录)$" app-id="QQ"
match app-id="pavucontrol-qt"
default-column-width { proportion 0.6; }
default-window-height { proportion 0.85; }
open-floating true
}
window-rule {
match app-id="nwjs"
default-column-width { proportion 0.85; }
default-window-height { proportion 0.9; }
open-floating true
block-out-from "screencast"
}
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
match app-id=r#"^org\.kde\.ksecretd$"#
open-floating true
}
window-rule {
match title=r#"Code - OSS$"#
match title=r#"Visual Studio Code$"#
match app-id=r#"^code"#
open-maximized true
}
window-rule {
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
match app-id="steam" title="Friends List"
open-floating true
default-floating-position x=8 y=8 relative-to="bottom-right"
open-focused false
open-on-output "eDP-1"
}
spawn-at-startup "waybar"
spawn-at-startup "swww-daemon"
spawn-at-startup "swww-daemon" "--namespace" "blur"
spawn-at-startup "xwayland-satellite"
spawn-at-startup "/usr/lib/pam_kwallet_init"
@@ -200,22 +268,224 @@ environment {
ELECTRON_OZONE_PLATFORM_HINT "auto"
}
hotkey-overlay {
skip-at-startup
hide-not-bound
binds {
Mod+F1 { show-hotkey-overlay; }
Mod+Return hotkey-overlay-title="Terminal (foot)" { spawn "foot"; }
Mod+F9 hotkey-overlay-title="Browser (firefox)" { spawn "firefox"; }
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 "~/.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
// so they may, for example, forward the key presses as-is to a remote machine.
// It's a good idea to bind an escape hatch to toggle the inhibitor,
// so a buggy application can't hold your session hostage.
//
// The allow-inhibiting=false property can be applied to other binds as well,
// which ensures niri always processes them, even when an inhibitor is active.
Mod+Alt+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
XF86PowerOff hotkey-overlay-title="Exit niri" { quit; }
Super+Escape hotkey-overlay-title="Lock the Screen (gtklock)" { spawn "gtklock" "-d"; }
Mod+Delete hotkey-overlay-title="Lock screen and Hibernate ..." allow-when-locked=true {
spawn-sh "(pgrep gtklock || gtklock -d) && sleep 1 && systemctl hibernate";
}
gestures {
hot-corners {
off
XF86AudioRaiseVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
XF86AudioLowerVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
XF86AudioMute hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
//Mod+Shift+M allow-when-locked=true { spawn "swayosd-client" "--input-volume" "mute-toggle"; }
XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioPause allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
XF86AudioStop allow-when-locked=true { spawn "playerctl" "stop"; }
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+5%"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "5%-"; }
Alt+Tab hotkey-overlay-title=null repeat=false { toggle-overview; }
Alt+F4 { close-window; }
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
//Mod+H { focus-column-left; }
//Mod+J { focus-window-down; }
//Mod+K { focus-window-up; }
//Mod+L { focus-column-right; }
Mod+Shift+Left { move-column-left; }
Mod+Shift+Down { move-window-down; }
Mod+Shift+Up { move-window-up; }
Mod+Shift+Right { move-column-right; }
//Mod+Shift+H { move-column-left; }
//Mod+Shift+J { move-window-down; }
//Mod+Shift+K { move-window-up; }
//Mod+Shift+L { move-column-right; }
// Alternative commands that move across workspaces when reaching
// the first or last window in a column.
// Mod+J { focus-window-or-workspace-down; }
// Mod+K { focus-window-or-workspace-up; }
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
Mod+Ctrl+Left { focus-monitor-left; }
Mod+Ctrl+Down { focus-monitor-down; }
Mod+Ctrl+Up { focus-monitor-up; }
Mod+Ctrl+Right { focus-monitor-right; }
//Mod+Ctrl+H { focus-monitor-left; }
//Mod+Ctrl+J { focus-monitor-down; }
//Mod+Ctrl+K { focus-monitor-up; }
//Mod+Ctrl+L { focus-monitor-right; }
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
//Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
//Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
//Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
//Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
// Alternatively, there are commands to move just a single window:
// Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
// ...
// And you can also move a whole workspace to another monitor:
// Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
// ...
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
//Mod+U { focus-workspace-down; }
//Mod+I { focus-workspace-up; }
Mod+Shift+Page_Down { move-column-to-workspace-down; }
Mod+Shift+Page_Up { move-column-to-workspace-up; }
//Mod+Shift+U { move-column-to-workspace-down; }
//Mod+Shift+I { move-column-to-workspace-up; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
// ...
Mod+Ctrl+Page_Down { move-workspace-down; }
Mod+Ctrl+Page_Up { move-workspace-up; }
//Mod+Ctrl+U { move-workspace-down; }
//Mod+Ctrl+I { move-workspace-up; }
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
Mod+Shift+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Shift+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Shift+WheelScrollRight { move-column-right; }
Mod+Shift+WheelScrollLeft { move-column-left; }
// Usually scrolling up and down with Shift in applications results in
// horizontal scrolling; these binds replicate that.
// Mod+Shift+WheelScrollDown { focus-column-right; }
// Mod+Shift+WheelScrollUp { focus-column-left; }
// Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
// Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
// Similarly, you can bind touchpad scroll "ticks".
// Touchpad scrolling is continuous, so for these binds it is split into
// discrete intervals.
// These binds are also affected by touchpad's natural-scroll, so these
// example binds are "inverted", since we have natural-scroll enabled for
// touchpads by default.
// Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
// Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Shift+1 { move-column-to-workspace focus=false 1 ; }
Mod+Shift+2 { move-column-to-workspace focus=false 2 ; }
Mod+Shift+3 { move-column-to-workspace focus=false 3 ; }
Mod+Shift+4 { move-column-to-workspace focus=false 4 ; }
Mod+Shift+5 { move-column-to-workspace focus=false 5 ; }
Mod+Shift+6 { move-column-to-workspace focus=false 6 ; }
Mod+Shift+7 { move-column-to-workspace focus=false 7 ; }
Mod+Shift+8 { move-column-to-workspace focus=false 8 ; }
Mod+Shift+9 { move-column-to-workspace focus=false 9 ; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+1 { move-window-to-workspace 1; }
// Switches focus between the current and the previous workspace.
// Mod+Tab { focus-workspace-previous; }
Mod+Comma { consume-window-into-column; }
Mod+Period { expel-window-from-column; }
Mod+Shift+V { toggle-window-floating; }
Mod+V { switch-focus-between-floating-and-tiling; }
Mod+BracketLeft { consume-or-expel-window-left; }
Mod+BracketRight { consume-or-expel-window-right; }
Mod+R { switch-preset-column-width; }
Mod+Shift+R { switch-preset-window-height; }
Mod+Ctrl+R { reset-window-height; }
Mod+F11 { maximize-column; }
Mod+Shift+F11 { toggle-windowed-fullscreen; }
Mod+Ctrl+F11 { fullscreen-window; }
Mod+T hotkey-overlay-title="Expand column to available width" { expand-column-to-available-width; }
Mod+W hotkey-overlay-title="Tabbed Column Mode" { toggle-column-tabbed-display; }
Mod+C { center-column; }
Mod+Ctrl+C { center-visible-columns; }
// Finer width adjustments.
// This command can also:
// * set width in pixels: "1000"
// * adjust width in pixels: "-5" or "+5"
// * set width as a percentage of screen width: "25%"
// * adjust width as a percentage of screen width: "-10%" or "+10%"
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
// set-column-width "100" will make the column occupy 200 physical screen pixels.
Mod+Minus { set-column-width "-5%"; }
Mod+Equal { set-column-width "+5%"; }
// Finer height adjustments when in column with other windows.
Mod+Shift+Minus { set-window-height "-5%"; }
Mod+Shift+Equal { set-window-height "+5%"; }
// Actions to switch layouts.
// Note: if you uncomment these, make sure you do NOT have
// a matching layout switch hotkey configured in xkb options above.
// Having both at once on the same hotkey will break the switching,
// since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
// Mod+Space { switch-layout "next"; }
// Mod+Shift+Space { switch-layout "prev"; }
Print hotkey-overlay-title=null { screenshot-screen; }
Mod+Shift+S { screenshot; }
Alt+Print { screenshot-window; }
// Powers off the monitors. To turn them back on, do any input like
// moving the mouse or pressing any other key.
//Mod+Shift+P { power-off-monitors; }
}
}
prefer-no-csd
// 我自己搞了个软链接,把截图丢进 tmpfs 里了。参见 .zshrc。
screenshot-path "~/.tmp/Screenshots/%Y-%m-%d %H-%M-%S.png"
// screenshot-path null
include "./noctalia.kdl"
-4
View File
@@ -1,7 +1,3 @@
# 像这种有明显时间规律的定时任务我懒得专门搞配套。不觉得 timer 非得跟 service 同名搞绑定很啰嗦吗?
# 我完全可以 on-hourly@renew-wallpaper.timer、on-hourly@webapi-health-check.timer 嘛。
# 当然这样也算不上简洁,但至少不需要另装个 cron(arch 不自带)。
[Unit]
Description=Run %i hourly
+12
View File
@@ -0,0 +1,12 @@
[Unit]
Description=Run %i monthly
[Timer]
OnCalendar=monthly
RandomizedDelaySec=1h
AccuracySec=45s
Persistent=true
Unit=%i.service
[Install]
WantedBy=timers.target
+12
View File
@@ -0,0 +1,12 @@
[Unit]
Description=Run %i weekly
[Timer]
OnCalendar=weekly
RandomizedDelaySec=30m
AccuracySec=1s
Persistent=true
Unit=%i.service
[Install]
WantedBy=timers.target
@@ -3,7 +3,6 @@
"modules-left": [
"niri/workspaces",
"niri/window"
// sway niri
],
"modules-center": [
"clock"
@@ -36,13 +35,11 @@
"icon-size": 14,
"rewrite": {
"(.*) — Mozilla Firefox": "$1",
"(.*) - Google Chrome": "$1",
"(.*) - Visual Studio Code": "$1",
"(.*) - VLC media player": "$1",
"Yazi: (.*)": "$1"
}
},
//
"mpris": {
"format": "{status_icon} {title}",
"format-stopped": "",
@@ -61,7 +58,6 @@
"tray": {
"spacing": 12
},
// yazi
"temperature": {
// "thermal-zone": 1,
"hwmon-path-abs": "/sys/devices/platform/coretemp.0/hwmon",
@@ -7,7 +7,7 @@ window#waybar {
}
* {
font-family: "Symbols Nerd Font", monospace;
font-family: "MonaspiceNe Nerd Font";
font-size: 10pt;
}
@@ -2,6 +2,5 @@
default=gnome;gtk;
org.freedesktop.impl.portal.Access=gtk
org.freedesktop.impl.portal.Notification=gtk
# gnome 密码框太丑了。
org.freedesktop.impl.portal.Secret=kwallet
org.freedesktop.impl.portal.FileChooser=gtk
-3
View File
@@ -1,3 +0,0 @@
[flavor]
dark = "noctalia"
light = "noctalia"
-7
View File
@@ -1,10 +1,3 @@
[mgr]
show_hidden = true
show_symlink = true
[opener]
play = [
{ run = 'vlc "$@"', orphan = true, for = "unix" },
{ run = 'mpv --force-window %*', orphan = true, for = "windows" },
{ run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" },
]
-153
View File
@@ -1,153 +0,0 @@
#!/bin/bash
set -euo pipefail
THIS_COMMAND=$(basename "$0")
IMG_MAGICK="magick"
SERVICE_NAME="swaybg.service"
WP_DIR="${XDG_CACHE_HOME:-$HOME/.cache}"
WP_FILE="$WP_DIR/wallpaper"
BLUR_WP="$WP_DIR/wallpaper_blur"
usage() {
cat << EOF
Usage: $THIS_COMMAND [-d output_path] image1 image2 ...
Options:
-d, --dir OUTPUT_PATH Directory to store chosen image. (default: $WP_DIR)
-h, --help Show this help message and exit.
Notes:
- This script needs 'swaybg.service' to be set up for overview background support (unless awww #521 solved). See niri documentation for details.
- Web URLs are also supported (via 'curl' or 'wget' downloading).
- If multiple images are provided, one will be randomly picked each time the script is executed.
EOF
exit 1
}
# showing help shouldn't require any dependencies.
while [[ $# -gt 0 ]]; do
case "$1" in
-d|--dir)
if [[ $# -lt 2 ]]; then echo "Missing argument for $1"; usage; fi
WP_DIR="$2"; shift 2 ;;
-h|--help)
usage ;;
--)
shift; break ;;
-*)
echo "Unknown option: $1"; usage ;;
*)
break ;;
esac
done
if ! command -v awww >/dev/null 2>&1; then
echo "x) 'awww' not found. Unable to comply." >&2
exit 2
fi
if command -v magick >/dev/null 2>&1; then
IMG_MAGICK="magick"
elif command -v convert >/dev/null 2>&1; then
IMG_MAGICK="convert"
else
echo "x) 'magick' or 'convert' not found. Image processing unavailable." >&2
exit 2
fi
set_wallpaper() {
fsize=$($IMG_MAGICK identify -format "%w %h" -- "$1" 2>/dev/null) || {
echo "Invalid image file." >&2
exit 10
}
finput=$1
read -r fw fh <<< "$fsize"
(( fw > 3840 && fh > 2160 )) && {
finput=$(mktemp "${TMPDIR:-/tmp}/chbg.XXXXXXXX.webp")
trap 'rm -f "$finput"' EXIT
echo " -> image too large, resizing ..."
# echo "DEBUG: resized image at $finput"
$IMG_MAGICK "$1" -resize "3840x2160^" \
-quality 90 \
-define webp:method=6 \
-define webp:alpha-quality=100 "$finput"
}
echo -n " -> making blurred version of '${1##*/}' ... "
cp "$finput" "$WP_FILE"
$IMG_MAGICK "$WP_FILE" -filter Gaussian -blur 0x30 "$BLUR_WP"
echo "Done."
awww img "$WP_FILE" --transition-type=random
if [[ -f "$HOME/.config/systemd/user/niri.service.wants/$SERVICE_NAME" ]]; then
echo " -> restarting $SERVICE_NAME ..."
systemctl --user restart "$SERVICE_NAME"
else
echo " !) '$SERVICE_NAME' didn't loaded by niri. Won't reload backdrop." >&2
echo " => See niri documentation for setting up swaybg systemd unit." >&2
echo " => Or wait for awww #521 on codeberg being resolved." >&2
exit 1
fi
}
imagepool=()
lastresult=""
# Read from stdin if data is available
if [ ! -t 0 ]; then
while IFS= read -r line; do
imagepool+=("$line")
done
fi
# Read from positional arguments
for arg in "$@"; do
imagepool+=("$arg")
done
if [ ${#imagepool[@]} -eq 0 ]; then
echo "No images provided." >&2
exit 1
fi
mkdir -p -- "$WP_DIR" "/tmp/$USER"
if [ -f "/tmp/$USER/chbg.last-slide.log" ]; then
lastresult=$(cat "/tmp/$USER/chbg.last-slide.log")
fi
# Select a random image from the pool and set it as wallpaper
while : ; do
randomimage="${imagepool[RANDOM % ${#imagepool[@]}]}"
if [[ "$randomimage" == "http://"* || "$randomimage" == "https://"* ]]; then
break
fi
if [ "$randomimage" != "$lastresult" ] || [ ${#imagepool[@]} -eq 1 ]; then
echo "$randomimage" > "/tmp/$USER/chbg.last-slide.log"
break
fi
done
echo "Selected: $randomimage"
request_wallpaper() {
tmpfile=$(mktemp)
trap 'rm -f "$tmpfile"' EXIT
if command -v curl >/dev/null 2>&1; then
curl -sSL "$1" -o "$tmpfile"
elif command -v wget >/dev/null 2>&1; then
wget -qO "$tmpfile" "$1"
else
echo "x) Unable to fetch image without 'curl' or 'wget'." >&2
exit 2
fi
set_wallpaper "$tmpfile"
}
if [ -f "$randomimage" ]; then
set_wallpaper "$randomimage"
else
request_wallpaper "$randomimage"
fi
-2
View File
@@ -1,4 +1,2 @@
*.tar.zst
fake-nautilus/**/
.config/environment.d/[^0-9]*.conf
*noctalia*
+8 -6
View File
@@ -1,10 +1,12 @@
# 重启自动清空终端记录。毕竟万一露出什么不太好的关键词就丸辣。
# zsh (HISTFILE) => /tmp/$USER/terminal/zsh_history
# bash (HISTFILE) => /tmp/$USER/terminal/bash_history
# pwsh (.local/share/powershell/PSReadLine) -> /tmp/$USER/terminal
mkdir -p /tmp/$USER/terminal
# init at each startup
mkdir -p /tmp/$USER
#ln -sf /tmp/$UID $HOME/.tmp
[ $(readlink -f $HOME/.tmp) = "/tmp/$USER" ] || {
rm -f $HOME/.tmp
ln -s /tmp/$USER $HOME/.tmp
}
# 本意是为了防止 PATH 重复记录(算是我的强迫症吧),现在没必要了。
# avoid dumplicate env appending.
# [[ -f /run/user/$UID/.zshlogon ]] && return
# touch /run/user/$UID/.zshlogon
+9 -13
View File
@@ -19,9 +19,6 @@ fi
# History
#
# also export this in bashrc.
HISTFILE=/tmp/$USER/terminal/zsh_history
# Remove older command from the history if a duplicate is to be added.
setopt HIST_IGNORE_ALL_DUPS
@@ -142,22 +139,21 @@ unset key
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -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 uvenv='source .venv/bin/activate'
alias noproxy='env -u http_proxy -u https_proxy'
alias savebg='cp -v ~/.cache/wallpaper ~/Pictures/img.webp'
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"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# bun completions
[ -s "/home/agxcoy/.bun/_bun" ] && source "/home/agxcoy/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
option=$(fuzzel --dmenu --prompt-only="Run command: ")
[ -z "$option" ] || exec startb $option
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
desktop="$HOME/Desktop"
options=""
for item in $(ls $desktop); do
if [[ "$item" == *.desktop && -f "$desktop/$item" ]]; then
continue
fi
options+=$item
if [[ -d "$desktop/$item" ]]; then
options+='/'
fi
options+="\n"
done
fsarg=$(echo -en "$options" | fuzzel --dmenu --prompt="Open with VSCode: Desktop/")
[ -z "$fsarg" ] || exec startb code "$desktop/$fsarg"
Executable
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# to change wallpapers both niri workspace and niri tab view
[ -z "$1" ] && { echo "Usage: $0 <image-file>"; exit 1; }
WP_DIR="$HOME/.local/share"
finput=$1
fw=$(magick identify -format "%w\n" $1)
fh=$(magick identify -format "%h\n" $1)
if [[ $((fw)) > 3840 && $((fh)) > 2160 ]]
then
finput="/tmp/${finput##*/}"
echo "WARNING: image too large, resizing ..."
magick $1 -resize "3840x2160^" $finput
fi
echo -n "making blurred version of $finput ... "
mkdir -p $WP_DIR
cp $finput $WP_DIR/.wallpaper
magick $WP_DIR/.wallpaper -filter Gaussian -blur 0x30 $WP_DIR/.wallpaper_blur
echo "Done."
swww img $WP_DIR/.wallpaper
swww img $WP_DIR/.wallpaper_blur --namespace blur
+15
View File
@@ -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"
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
option=$(fuzzel --dmenu --prompt-only="Command to execute: ")
[ -z "$option" ] || ykrun $option
-99
View File
@@ -1,99 +0,0 @@
#!/usr/bin/env bash
# startb: start a command in the background with journald or file logging fallback.
# Usage:
# startb [--log logfile] COMMAND [ARGS...]
# Environment:
# STARTB_LOGFILE=... to force a log file.
set -euo pipefail
# PATH may be incomplete from systemd login env; restore from interactive shell.
PATH=$(zsh -c -i 'echo $PATH')
export PATH
SCRIPT_NAME="${0##*/}"
usage() {
cat <<EOF
Usage: ${SCRIPT_NAME} [--log logfile] COMMAND [ARGS...]
--log logfile Write logs to this file instead of journald.
Environment variable STARTB_LOGFILE can also provide a logfile path.
EOF
exit 1
}
if [ $# -lt 1 ]; then
usage
fi
LOG_FILE=${STARTB_LOGFILE:-}
if [ "$1" = "--log" ] || [ "$1" = "-l" ]; then
shift
if [ $# -lt 1 ]; then
echo "Error: --log requires a logfile path." >&2
usage
fi
LOG_FILE=$1
shift
fi
if [ $# -lt 1 ]; then
usage
fi
COMMAND=("$@")
UNIT_BASE=$(basename "${COMMAND[0]}")
UNIT_BASE=${UNIT_BASE:-cmd}
UNIT_NAME="${UNIT_BASE}-$(date +%Y%m%d_%H%M%S_%N)"
log_to_file() {
local path=$1
mkdir -p "$(dirname "$path")" 2>/dev/null || true
touch "$path" || {
echo "Failed to touch logfile: $path" >&2
return 1
}
nohup setsid "${COMMAND[@]}" >>"$path" 2>&1 &
local pid=$!
disown "$pid" 2>/dev/null || true
echo "$UNIT_NAME started in background (pid=$pid), logs: $path"
return 0
}
log_to_journal() {
# 不按雪叶那样写基本记录不到输出,懒得调了,直接屏蔽。
# if command -v systemd-run >/dev/null 2>&1; then
# systemd-run --user --scope --unit="$UNIT_NAME" -- "${COMMAND[@]}" >/dev/null 2>&1 &
# local pid=$!
# echo "$UNIT_NAME started in systemd scope (pid=$pid), journald logging enabled"
# return 0
# fi
if command -v systemd-cat >/dev/null 2>&1; then
nohup setsid systemd-cat -t "$UNIT_BASE" -- "${COMMAND[@]}" >/dev/null 2>&1 &
local pid=$!
disown "$pid" 2>/dev/null || true
echo "$UNIT_BASE started with systemd-cat (pid=$pid), journald logging enabled"
return 0
fi
return 1
}
if [ -n "$LOG_FILE" ]; then
log_to_file "$LOG_FILE" || exit 1
exit 0
fi
if log_to_journal; then
exit 0
fi
# Fallback log path when journald is unavailable.
LOG_FILE="/tmp/${USER:-unknown}/startb/${UNIT_NAME}.log"
log_to_file "$LOG_FILE"
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
systemd-run --user --scope --slice=YukiLauncher.slice --unit="$1-$$".scope /bin/sh -c '"$@"' _ "$@"
-17
View File
@@ -1,17 +0,0 @@
// ==UserScript==
// @name Genshin Cloud
// @namespace http://tampermonkey.net/
// @version 0.1
// @description fix a Genshin Impact cloud game bug
// @match https://*.mihoyo.com/cloud/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
const origin = HTMLElement.prototype.requestPointerLock
HTMLElement.prototype.requestPointerLock = function () {
return origin.call(this)
}
})();
+36 -69
View File
@@ -1,78 +1,45 @@
# niri 散装配置集(dotfiles
都怪雪叶!
都怪雪叶!
> [!note]
> 本仓库的配置管理方案比较原始:逐个做软链接处理。有觉得`stow`等工具好用,想要重新组织文件树的欢迎 pr.
> - `.config/**` -> `$HOME/.config/**`
> - `bin`直接并入`$PATH`
> > 其中带后缀(如`.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)
- [@silvaire-qwq](https://github.com/silvaire-qwq)
- fizzyizzy05 (Isabelle Jackson, mtf)
## 注意事项
懒得写说明文档了。姑且列个表吧
## 已知依赖
> 仅列出**想得起来的**依赖软件包
- sddm -> niri -> xdg-portal
1. sddm 主题:sddm-sugar-candy-git
2. `[General]` 开启 Numlock
3. niri 配置位于:.config/niri
- 姑且按修改频次拆分为 config-*.kdl。不建议拆太多,视觉效果容易失效。
- 启用 niri 原生窗口模糊需要从源码构建(即**换用 niri-git^AUR^**
- 部分应用(典型如 Chromium 应用和 wine 调起的 Windows 应用)无法应用模糊效果:参见`config-window.kdl`内注释。
4. 本仓库的方案**不需要**装大多数 niri 可选依赖。至少只需要以下包:
- xdg-desktop-portal-*
- xwayland-satellite
5. 我个人把密码管理器交给 kwallet(可在 .config/xdg-desktop-portal/niri-portals.conf 里查改)。
- 装 kwallet 建议加装 kwallet-pam,免得 VSCode 等应用自己尝试解锁结果闪退。
|依赖|配置|备注|
|-|-|-|
|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`|
- niri -> noctalia -> foot, yazi, mpris, fuzzel...
1. 由于引入 Noctalia Shell,另自动集成了配色模板。模板\*可以做到\*随壁纸切换自动更变色调,故本仓库**不包含**它们
2. 由于 noctalia 接管了大部分桌面 UI,以下散装部件弃用(配置移至 .deprecated ):
- waybar (含 pavucontrol-qt), mako, gtklock
- bin/chbg (含 swaybg 和 awww)
3. fuzzel 无法弃用:*我需要将 VSC 打开的项目锁死在桌面范围内*,而 Noctalia 插件做不到。
- 当然 Mod+Space 仍调整为 Noctalia 启动面板。毕竟 .fuzzel-startb 只能当 Win+R 用。
3. noctalia 自身设置可以通过 GUI 微调:面板里有设置。配置文件恕不提供(懒得维护了)。
4. 尚不确定 noctalia 里的媒体组件是否还需要 mpris(毕竟原本是 waybar 在管)。对其的设置参见 Arch Wiki。
## 参考资源与备注
- 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 里表现不咋地
> 统一交给 noctalia 还是散装,见仁见智。我觉得好看就行。
- foot -> zsh, fastfetch
1. zsh 另装了 ZshIM(即 ZIM)和 powerlevel10k 主题。
2. 请酌情调整 .zprofile 里的 PATH 路径。
3. 有一些仅当前用户安装的包管理器(bun、uv、nvm)也在 .zshrc 初始化配置。酌情挑选需要的设置行。
## 其他组件
### default-electron-flags
用于 electron/chromium 应用(如 chrome、VSCode、linuxqq)的命令行标签。可以这么软链接:
```bash
ln -s ./default-electron-flags ~/.config/chrome-flags.conf
```
但 qq-flags.conf 略为不同:
```
-enable-platform=wayland --enable-wayland-ime --wayland-text-input-version=3
```
### hoyocloud-chromium-userscript.js
用于 Chrome(火狐不需要)的米哈游云游戏油猴脚本。
参见 [Bilibili 专栏](https://www.bilibili.com/opus/842314310196658193)。
### fake-nautilus
经雪叶指导搞出来的空包。现在执行 nautilus 会发个通知:*Doki Doki Forever!*
旨在替换 gnome portal 的必需依赖 nautilus(就是 GNOME 文件浏览器),因为太丑了。
## 补充说明
Nerd 字体:[Monaco Nerd Font Mono](https://glowmem.com/upload/articles/archlinux-note/Monaco_Nerd_Font_Mono-Regular.ttf) (MelodyEcho ver.) 或直接 [MesloLGS NF](https://github.com/romkatv/powerlevel10k/blob/master/font.md) (for p10k)。
---
深色模式:
```bash
gsettings set org.gnome.desktop.interface color-scheme prefer-dark
```
GTK/QT 深色主题:参见 [Arch Wiki](https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications#Styles_for_both_Qt_and_GTK)。我摆烂了。
> 深色模式:`gsettings set org.gnome.desktop.interface color-scheme prefer-dark`
> GTK/QT 深色主题:参见 [Arch Wiki](https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications#Styles_for_both_Qt_and_GTK).