From d6371a280145bf2a43ec768f3e99d9f0d9e0c72c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 19 Oct 2018 15:02:56 +0200 Subject: [run-virt] Support $SLX_VM_MUTED to toggle automute openslx.ini: [openslx] muteSound=1/0 --- .../data/opt/openslx/vmchooser/data/openslx.exe | Bin 53760 -> 55296 bytes .../vmchooser/run-virt.d/setup_virtual_floppy.inc | 4 ++++ core/modules/run-virt/winres/src/winres.c | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe b/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe index ed11dd80..e8b87aa9 100755 Binary files a/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe and b/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe differ diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc index 98b0b78a..ba421191 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc @@ -117,6 +117,9 @@ setup_virtual_floppy() { fi fi + local MUTED=1 + [ -n "$SLX_VM_MUTED" ] && [ "$SLX_VM_MUTED" -ge 0 ] && MUTED="$SLX_VM_MUTED" + # Write info file local UNAME= [ -s "${HOME}/.openslx/account" ] && UNAME=$(cat "${HOME}/.openslx/account") @@ -132,6 +135,7 @@ setup_virtual_floppy() { scriptVisibility=${OPTIONS[VISIBILITY]} passCreds=${SHARE_CREDENTIAL_PASSTHROUGH} bootIp=${SLX_PXE_CLIENT_IP} + muteSound=${MUTED} [remap] documents=${SHARE_DOCUMENTS} diff --git a/core/modules/run-virt/winres/src/winres.c b/core/modules/run-virt/winres/src/winres.c index 572dbfe8..851150f7 100644 --- a/core/modules/run-virt/winres/src/winres.c +++ b/core/modules/run-virt/winres/src/winres.c @@ -386,8 +386,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine _debug = TRUE; alog("Windows Version %d.%d", (int)winVer.dwMajorVersion, (int)winVer.dwMinorVersion); } - // Mute sound by default - if (retVer && winVer.dwMajorVersion >= 6) + // Mute sound? + BOOL mute = GetPrivateProfileIntA("openslx", "muteSound", 1, SETTINGS_FILE) != 0; + if (mute && retVer && winVer.dwMajorVersion >= 6) muteSound(); // Disable screen saver as it might give the false impression that the session is securely locked SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0); -- cgit v1.2.3-55-g7522