1
0
Fork 0
This commit is contained in:
Massaki Archambault 2019-08-28 20:54:49 -04:00
parent abd045f412
commit 23d6822ed6
4 changed files with 40 additions and 15 deletions

View File

@ -30,8 +30,8 @@
; lock-memory = no ; lock-memory = no
; cpu-limit = no ; cpu-limit = no
high-priority = yes ; high-priority = yes
nice-level = -11 ; nice-level = -11
; realtime-scheduling = yes ; realtime-scheduling = yes
; realtime-priority = 5 ; realtime-priority = 5
@ -50,7 +50,7 @@ nice-level = -11
; log-time = no ; log-time = no
; log-backtrace = 0 ; log-backtrace = 0
resample-method = soxr-mq resample-method = speex-float-3
avoid-resampling = yes avoid-resampling = yes
; enable-remixing = yes ; enable-remixing = yes
; remixing-use-all-sink-channels = yes ; remixing-use-all-sink-channels = yes
@ -76,7 +76,7 @@ flat-volumes = no
; rlimit-rttime = 200000 ; rlimit-rttime = 200000
; default-sample-format = s16le ; default-sample-format = s16le
default-sample-rate = 48000 ; default-sample-rate = 44100
; alternate-sample-rate = 48000 ; alternate-sample-rate = 48000
; default-sample-channels = 2 ; default-sample-channels = 2
; default-channel-map = front-left,front-right ; default-channel-map = front-left,front-right

View File

@ -43,8 +43,8 @@ __nmap_iface() {
bc -l <<<"$*" bc -l <<<"$*"
} }
# start looking-glass # start game mode
play-vm() { gamemode() {
if ! [ -S /tmp/win10.sock ]; then if ! [ -S /tmp/win10.sock ]; then
echo "Cannot find spice socket! Is the vm started?" echo "Cannot find spice socket! Is the vm started?"
else else
@ -63,8 +63,7 @@ play-vm() {
sudo sh -c "echo 0,4 > /proc/irq/$i/smp_affinity_list" sudo sh -c "echo 0,4 > /proc/irq/$i/smp_affinity_list"
done done
echo "Starting looking-glass" LD_PRELOAD="/usr/\$LIB/libgamemodeauto.so" looking-glass-wrapper
LD_PRELOAD=/usr/\$LIB/libgamemodeauto.so looking-glass-client -p 0 -c /tmp/win10.sock -K 60 -MFk $@
echo "Restore system" echo "Restore system"
# irq # irq

View File

@ -2,7 +2,7 @@
print_help() { print_help() {
echo "" echo ""
echo "Convert an archive to the 7zip format, or create a new archive" echo "Convert an archive from one format to another"
echo "" echo ""
echo "Usage: to7zip [options] ...files" echo "Usage: to7zip [options] ...files"
echo "" echo ""
@ -11,17 +11,19 @@ print_help() {
echo " -d, --delete-old Delete converted file" echo " -d, --delete-old Delete converted file"
echo " -f, --force Replace the file with the converted file even if the file exists" echo " -f, --force Replace the file with the converted file even if the file exists"
echo " -r, --rezip Extract and archive again even if the converted file is already a 7zip archive" echo " -r, --rezip Extract and archive again even if the converted file is already a 7zip archive"
echo " -F, --format The format of the output"
echo " -t, --thread Set the number of threads for archive extraction and creation (default: $thread_count)" echo " -t, --thread Set the number of threads for archive extraction and creation (default: $thread_count)"
echo "" echo ""
} }
short_args=hdfrt: short_args=hdfrF:t:
long_args=help,delete-old,force,rezip,thread: long_args=help,delete-old,force,rezip,format:,thread:
# default # default
rezip= rezip=
delete_old= delete_old=
force= force=
zip_args=
thread_count=8 thread_count=8
params="" params=""
@ -50,6 +52,20 @@ while true; do
rezip=y rezip=y
shift shift
;; ;;
-F|--format)
case "$2" in
7z)
;;
zip)
zip_args="-tzip"
output_ext="zip"
;;
*)
echo "Unknown format: $2"
exit 1
esac
shift 2
;;
-t|--thread) -t|--thread)
thread_count="$2" thread_count="$2"
shift 2 shift 2
@ -66,9 +82,14 @@ done
out_dir="$PWD" out_dir="$PWD"
if [[ -z "$zip_args" ]]; then
zip_args="-t7z -m0=lzma2 -ms=on"
output_ext=7z
fi
for f in "$@"; do for f in "$@"; do
tmp_dir="$(mktemp -d "$PWD/to7zip.XXX")" tmp_dir="$(mktemp -d "$PWD/to7zip.XXX")"
output="$(echo "$f" | sed -E 's/\.(zip|rar|7z)$//g').7z" output="$(echo "$f" | sed -E 's/\.(7z|tar\.gz|zip|rar)$//g').$output_ext"
backup_file="$output".backup backup_file="$output".backup
do_backup= do_backup=
@ -88,7 +109,12 @@ for f in "$@"; do
fi fi
fi fi
if [[ "$f" =~ \.tar|gz|bz2|zip|7z$ ]]; then if [[ "$f" =~ \.tar[^/]*$ ]]; then
if ! tar -xf "$f" -C "$tmp_dir" >/dev/null; then
echo "$f : extract failed"
continue
fi
elif [[ "$f" =~ \.tar|gz|bz2|zip|7z$ ]]; then
if ! 7z e -mmt="$thread_count" -o"$tmp_dir" "$f" >/dev/null; then if ! 7z e -mmt="$thread_count" -o"$tmp_dir" "$f" >/dev/null; then
echo "$f : extract failed" echo "$f : extract failed"
continue continue
@ -107,7 +133,7 @@ for f in "$@"; do
fi fi
pushd "$tmp_dir" >/dev/null pushd "$tmp_dir" >/dev/null
7z a -t7z -m0=lzma2 -mx=9 -ms=on -mmt="$thread_count" "$out_dir/$output" >/dev/null 7z a $zip_args -mx=9 -mmt="$thread_count" "$out_dir/$output" >/dev/null
return_val=$? return_val=$?
popd >/dev/null popd >/dev/null
if [[ $return_val -eq 0 ]]; then if [[ $return_val -eq 0 ]]; then

@ -1 +1 @@
Subproject commit 476f6ca69922c9e67c408ae92dff0eb0ccb8ee51 Subproject commit 42bb2bf48bef881be504278cf5156371b542cf81