fish: functions: Improve pipewire dot graph functions

xdot is more convenient to use and allows viewing dot file directly.
Generate svg only if requested.
This commit is contained in:
Sanchayan Maity 2022-10-10 14:00:18 +05:30
parent 11d04bc1d6
commit 1e3eb7f7e0
2 changed files with 10 additions and 6 deletions

View file

@ -1,5 +1,7 @@
function dotP --description 'Generate Pipewire dot graph for all nodes'
pw-dot -d -L -a -o /tmp/pw.dot
dot -Tsvg /tmp/pw.dot >~/Pictures/pipewire/pw-dot-(date +%T).svg
rm /tmp/pw.dot
set -l output ~/Pictures/pipewire/pw-dot-(date +%T)
pw-dot -d -L -a -o $output.dot
if test "$argv[1]" = -c
dot -Tsvg $output.dot >$output.svg
end
end

View file

@ -1,5 +1,7 @@
function dotp --description 'Generate Pipewire dot graph for linked nodes'
pw-dot -d -L -s -o /tmp/pw.dot
dot -Tsvg /tmp/pw.dot >~/Pictures/pipewire/pw-dot-(date +%T).svg
rm /tmp/pw.dot
set -l output ~/Pictures/pipewire/pw-dot-(date +%T)
pw-dot -d -L -s -o $output.dot
if test "$argv[1]" = -c
dot -Tsvg $output.dot >$output.svg
end
end