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

View File

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

View File

@ -2,7 +2,7 @@
print_help() {
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 "Usage: to7zip [options] ...files"
echo ""
@ -11,17 +11,19 @@ print_help() {
echo " -d, --delete-old Delete converted file"
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 " -F, --format The format of the output"
echo " -t, --thread Set the number of threads for archive extraction and creation (default: $thread_count)"
echo ""
}
short_args=hdfrt:
long_args=help,delete-old,force,rezip,thread:
short_args=hdfrF:t:
long_args=help,delete-old,force,rezip,format:,thread:
# default
rezip=
delete_old=
force=
zip_args=
thread_count=8
params=""
@ -50,6 +52,20 @@ while true; do
rezip=y
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)
thread_count="$2"
shift 2
@ -66,9 +82,14 @@ done
out_dir="$PWD"
if [[ -z "$zip_args" ]]; then
zip_args="-t7z -m0=lzma2 -ms=on"
output_ext=7z
fi
for f in "$@"; do
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
do_backup=
@ -88,7 +109,12 @@ for f in "$@"; do
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
echo "$f : extract failed"
continue
@ -107,7 +133,7 @@ for f in "$@"; do
fi
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=$?
popd >/dev/null
if [[ $return_val -eq 0 ]]; then

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