Skip to content

Instantly share code, notes, and snippets.

@bbb651
Last active February 16, 2025 23:29
Show Gist options
  • Select an option

  • Save bbb651/e36858746b86aa12feac7a7b3aa76be8 to your computer and use it in GitHub Desktop.

Select an option

Save bbb651/e36858746b86aa12feac7a7b3aa76be8 to your computer and use it in GitHub Desktop.
Niri + Fish terminal xdg activation
function xdg_activation --on-event fish_preexec
set -l tmpdir /tmp
set -q TMPDIR
and set tmpdir $TMPDIR
set filename (mktemp -u $tmpdir/.xdg-activation.XXXXXXXXXX)
command mkfifo $filename
niri msg action spawn -- sh -c "echo \$XDG_ACTIVATION_TOKEN > $filename" &
set -gx XDG_ACTIVATION_TOKEN (cat $filename)
command rm $filename
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment