diff --git a/nswitch b/nswitch index e90d6a5..4696966 100755 --- a/nswitch +++ b/nswitch @@ -5,18 +5,14 @@ set -E -o pipefail shopt -s failglob export LC_ALL=C.UTF8 -INITIAL_PWD="$(pwd)" -PROJECT="$HOME/Projects/NixOS" +PROJECT="$HOME/Projects/NixOS/" GIT_PATTERN="." # "*.nix" exit_with_new_shell() { - # check if already in directory - [[ "$INITIAL_PWD" = "$PROJECT" ]] && printf '>>> already in directory\n' && exit 0 - printf '\n' printf '>>> opening a new \"%s\" shell\n' "$(basename "$SHELL")" - printf ' cwd: %s\n' "$(pwd)" + printf '>>> cwd: %s\n' "$(pwd)" "$SHELL" exit 0 } @@ -24,15 +20,11 @@ exit_with_new_shell() { cd "$PROJECT" || exit 1 nvim -# check if there are changes at all -[[ -z "$(git diff -U0 "$GIT_PATTERN")" ]] && echo ">>> no changes, exiting ..." && exit_with_new_shell - -# only then do auto formating printf ">>> auto formating ..." nix fmt . &> /dev/null printf " DONE!\n" -# and then show the user a diff +[ -z "$(git diff -U0 "$GIT_PATTERN")" ] && echo ">>> no changes, exiting ..." && exit_with_new_shell git diff -U0 "$GIT_PATTERN" # as a seperate command so we get nice colors and pager printf ">>> Do you want to rebuild NixOS? [y/N]\n" diff --git a/remote-audio b/remote-audio index 6f7187b..d50540e 100755 --- a/remote-audio +++ b/remote-audio @@ -7,18 +7,9 @@ set -E -o pipefail shopt -s failglob export LC_ALL=C.UTF8 - - start() { - roc-recv \ - --source=rtp+rs8m://0.0.0.0:10001 \ - --repair=rs8m://0.0.0.0:10002 \ - --output=alsa://default & - - roc-send \ - --source=rtp+rs8m://192.168.178.40:10001 \ - --repair=rs8m://192.168.178.40:10002 \ - --input=alsa://default & + roc-recv -s rtp+rs8m://0.0.0.0:10001 -r rs8m://0.0.0.0:10002 -o alsa://default & + roc-send -s rtp+rs8m://192.168.178.40:10001 -r rs8m://192.168.178.40:10002 -i alsa://default & } stop() { @@ -31,11 +22,8 @@ stop9() { killall -9 roc-recv } -list() { - pgrep -a 'roc-' -} - if [[ -z "$1" ]]; then + #start() start else $1