fix: import envs in ghostty
This commit is contained in:
@@ -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"; }
|
||||
|
||||
@@ -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"
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
1
config/shell/.config/fish/prev.d/.gitignore
vendored
1
config/shell/.config/fish/prev.d/.gitignore
vendored
@@ -3,3 +3,4 @@
|
||||
!prompt.fish
|
||||
!theme.fish
|
||||
!env.fish
|
||||
!niri-env.fish
|
||||
22
config/shell/.config/fish/prev.d/niri-env.fish
Normal file
22
config/shell/.config/fish/prev.d/niri-env.fish
Normal file
@@ -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
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user