Compare commits
No commits in common. "7884fbdbcdd791d33c75a264ef0eecc136abfce5" and "f233795fd4040a8bb5dd01c410cfd6bc2d33ee7f" have entirely different histories.
7884fbdbcd
...
f233795fd4
2 changed files with 6 additions and 26 deletions
14
nswitch
14
nswitch
|
@ -5,18 +5,14 @@ set -E -o pipefail
|
||||||
shopt -s failglob
|
shopt -s failglob
|
||||||
export LC_ALL=C.UTF8
|
export LC_ALL=C.UTF8
|
||||||
|
|
||||||
INITIAL_PWD="$(pwd)"
|
PROJECT="$HOME/Projects/NixOS/"
|
||||||
PROJECT="$HOME/Projects/NixOS"
|
|
||||||
GIT_PATTERN="." # "*.nix"
|
GIT_PATTERN="." # "*.nix"
|
||||||
|
|
||||||
|
|
||||||
exit_with_new_shell() {
|
exit_with_new_shell() {
|
||||||
# check if already in directory
|
|
||||||
[[ "$INITIAL_PWD" = "$PROJECT" ]] && printf '>>> already in directory\n' && exit 0
|
|
||||||
|
|
||||||
printf '\n'
|
printf '\n'
|
||||||
printf '>>> opening a new \"%s\" shell\n' "$(basename "$SHELL")"
|
printf '>>> opening a new \"%s\" shell\n' "$(basename "$SHELL")"
|
||||||
printf ' cwd: %s\n' "$(pwd)"
|
printf '>>> cwd: %s\n' "$(pwd)"
|
||||||
"$SHELL"
|
"$SHELL"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
@ -24,15 +20,11 @@ exit_with_new_shell() {
|
||||||
cd "$PROJECT" || exit 1
|
cd "$PROJECT" || exit 1
|
||||||
nvim
|
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 ..."
|
printf ">>> auto formating ..."
|
||||||
nix fmt . &> /dev/null
|
nix fmt . &> /dev/null
|
||||||
printf " DONE!\n"
|
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
|
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"
|
printf ">>> Do you want to rebuild NixOS? [y/N]\n"
|
||||||
|
|
18
remote-audio
18
remote-audio
|
@ -7,18 +7,9 @@ set -E -o pipefail
|
||||||
shopt -s failglob
|
shopt -s failglob
|
||||||
export LC_ALL=C.UTF8
|
export LC_ALL=C.UTF8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
roc-recv \
|
roc-recv -s rtp+rs8m://0.0.0.0:10001 -r rs8m://0.0.0.0:10002 -o alsa://default &
|
||||||
--source=rtp+rs8m://0.0.0.0:10001 \
|
roc-send -s rtp+rs8m://192.168.178.40:10001 -r rs8m://192.168.178.40:10002 -i alsa://default &
|
||||||
--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 &
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
|
@ -31,11 +22,8 @@ stop9() {
|
||||||
killall -9 roc-recv
|
killall -9 roc-recv
|
||||||
}
|
}
|
||||||
|
|
||||||
list() {
|
|
||||||
pgrep -a 'roc-'
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" ]]; then
|
||||||
|
#start()
|
||||||
start
|
start
|
||||||
else
|
else
|
||||||
$1
|
$1
|
||||||
|
|
Loading…
Add table
Reference in a new issue