Compare commits

..

No commits in common. "7884fbdbcdd791d33c75a264ef0eecc136abfce5" and "f233795fd4040a8bb5dd01c410cfd6bc2d33ee7f" have entirely different histories.

2 changed files with 6 additions and 26 deletions

14
nswitch
View file

@ -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"

View file

@ -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