diff --git a/config/niri/.config/niri/config/binds.kdl b/config/niri/.config/niri/config/binds.kdl index 1c83ab4..eba2be2 100644 --- a/config/niri/.config/niri/config/binds.kdl +++ b/config/niri/.config/niri/config/binds.kdl @@ -38,7 +38,7 @@ binds { // Actions Mod+V { spawn-sh "pkill -x rofi || rofi-cliphist"; } Mod+Period { spawn-sh "pkill -x rofi || rofi-emoji"; } - Ctrl+Alt+Delete { spawn "pkill -x wlogout || wlogout -p layer-shell"; } + Ctrl+Alt+Delete { spawn-sh "pkill -x wlogout || wlogout -p layer-shell"; } Print { spawn "niri" "msg" "action" "screenshot-screen"; } Mod+Shift+S { spawn "niri" "msg" "action" "screenshot"; } Mod+Ctrl+Shift+S { spawn "niri" "msg" "action" "screenshot-window"; } diff --git a/config/niri/.config/niri/config/execs.kdl b/config/niri/.config/niri/config/execs.kdl index 0681e54..bc4b399 100644 --- a/config/niri/.config/niri/config/execs.kdl +++ b/config/niri/.config/niri/config/execs.kdl @@ -35,3 +35,5 @@ spawn-at-startup "quickshell" // According to (https://ghostty.org/docs/linux/systemd#starting-ghostty-at-login) spawn-sh-at-startup "systemctl start --user app-com.mitchellh.ghostty.service" +// No, do not do this, otherwise the envs defined in envs.kdl won't be applied to ghostty. +// Unless you have something like "config/shell/.config/fish/prev.d/niri-env.fish" \ No newline at end of file diff --git a/config/niri/.config/niri/config/misc.kdl b/config/niri/.config/niri/config/misc.kdl index 8754766..cccfe86 100644 --- a/config/niri/.config/niri/config/misc.kdl +++ b/config/niri/.config/niri/config/misc.kdl @@ -1,10 +1,9 @@ +screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png" + debug { render-drm-device "/dev/dri/card0" } -screenshot-path "~/Pictures/Screenshots/niri_screenshot_%Y-%m-%d_%H-%M-%S.png" -// screenshot-path "~/Pictures/Screenshots/.niri_screenshot.png" - // gestures { // hot-corners { // off diff --git a/config/scripts/.local/snippets/set_display b/config/scripts/.local/snippets/set_display index babfa38..e8482da 100644 --- a/config/scripts/.local/snippets/set_display +++ b/config/scripts/.local/snippets/set_display @@ -2,6 +2,10 @@ # Description: # Select which GPU to use for rendering for Hyprland and Niri. +# +# envs exported: +# HYPR_AQ_DRM_DEVICES - Colon-separated list of DRM device paths for Hyprland's aq_drm +# BRIGHTNESSCTL_DEVICE - Device identifier for brightnessctl # AMD -> Nvidia -> Intel prefer_order=(amd nvidia intel) @@ -59,7 +63,7 @@ for who in "${prefer_order[@]}"; do done # Update niri config -for file in "$HOME/.config/niri/config.kdl" "$HOME/.config/niri/config.kdl.template"; do +for file in "$HOME/.config/niri/config/misc.kdl" "$HOME/.config/niri/config.kdl.template"; do [[ -f "$file" ]] || continue if grep -qE '^\s*render-drm-device\s+"[^"]+"' "$file"; then diff --git a/config/shell/.config/fish/prev.d/.gitignore b/config/shell/.config/fish/prev.d/.gitignore index b50eed5..43c738a 100644 --- a/config/shell/.config/fish/prev.d/.gitignore +++ b/config/shell/.config/fish/prev.d/.gitignore @@ -3,3 +3,4 @@ !prompt.fish !theme.fish !env.fish +!niri-env.fish \ No newline at end of file diff --git a/config/shell/.config/fish/prev.d/niri-env.fish b/config/shell/.config/fish/prev.d/niri-env.fish new file mode 100644 index 0000000..3b05ccd --- /dev/null +++ b/config/shell/.config/fish/prev.d/niri-env.fish @@ -0,0 +1,22 @@ +if test $XDG_CURRENT_DESKTOP = "niri" + set -l env_config "$HOME/.config/niri/config/envs.kdl" + + if test -f "$env_config" + while read -la line + # Remove comments + set line (string replace -r '//.*' '' -- "$line") + # Trim whitespace + set line (string trim -- "$line") + # Skip "environment" block lines + if test -z "$line"; or string match -q "environment*" -- "$line"; or test "$line" = "}" + continue + end + # Match lines like: VARIABLE "value" where VARIABLE is alphanumeric/underscore + set -l matches (string match -r '^([0-9A-Za-z_]+)\s+"(.*)"$' -- "$line") + # If have a matches, set the environment variable + if test (count $matches) -eq 3 + set -xg $matches[2] $matches[3] + end + end < "$env_config" + end +end \ No newline at end of file diff --git a/config/wallpaper/.config/wallpaper-carousel/config.json b/config/wallpaper/.config/wallpaper-carousel/config.json index 65684a3..aa1f641 100644 --- a/config/wallpaper/.config/wallpaper-carousel/config.json +++ b/config/wallpaper/.config/wallpaper-carousel/config.json @@ -1,11 +1,7 @@ { "wallpaper": { "dirs": ["~/Pictures/backgrounds", "/media/Beta/壁纸/库"], - "excludes": [ - "~/Pictures/backgrounds/nao-stars-crop-adjust-flop.jpg", - "~/Pictures/backgrounds/miku-gate.jpg", - "~/Pictures/backgrounds/README.md" - ] + "excludes": ["~/Pictures/backgrounds/nao-stars-crop-adjust-flop.jpg", "~/Pictures/backgrounds/miku-gate.jpg"] }, "action": { "confirm": "change-wallpaper \"%1\" 2560 1600"