From 1e3eb7f7e09ed38d1cc861e683dc38736e192b6b Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Mon, 10 Oct 2022 14:00:18 +0530 Subject: [PATCH] fish: functions: Improve pipewire dot graph functions xdot is more convenient to use and allows viewing dot file directly. Generate svg only if requested. --- fish/.config/fish/functions/dotP.fish | 8 +++++--- fish/.config/fish/functions/dotp.fish | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fish/.config/fish/functions/dotP.fish b/fish/.config/fish/functions/dotP.fish index 27eafce..dfeeb70 100644 --- a/fish/.config/fish/functions/dotP.fish +++ b/fish/.config/fish/functions/dotP.fish @@ -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 diff --git a/fish/.config/fish/functions/dotp.fish b/fish/.config/fish/functions/dotp.fish index e0c4d7a..b50bcde 100644 --- a/fish/.config/fish/functions/dotp.fish +++ b/fish/.config/fish/functions/dotp.fish @@ -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