mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
start at windows startup
This commit is contained in:
@@ -134,5 +134,27 @@ namespace VRCX
|
|||||||
{
|
{
|
||||||
return CpuMonitor.CpuUsage;
|
return CpuMonitor.CpuUsage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetStartup(bool enabled)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
|
||||||
|
{
|
||||||
|
if (enabled)
|
||||||
|
{
|
||||||
|
var path = Application.ExecutablePath;
|
||||||
|
key.SetValue("VRCX", $"\"{path}\" --startup");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
key.DeleteValue("VRCX", false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5304,12 +5304,16 @@ CefSharp.BindObjectAsync(
|
|||||||
VRCXStorage.SetBool('isDarkMode', this.isDarkMode);
|
VRCXStorage.SetBool('isDarkMode', this.isDarkMode);
|
||||||
$appDarkStyle.disabled = this.isDarkMode === false;
|
$appDarkStyle.disabled = this.isDarkMode === false;
|
||||||
};
|
};
|
||||||
|
$app.data.isStartAtWindowsStartup = VRCXStorage.GetBool('VRCX_StartAtWindowsStartup');
|
||||||
$app.data.isStartAsMinimizedState = VRCXStorage.GetBool('VRCX_StartAsMinimizedState');
|
$app.data.isStartAsMinimizedState = VRCXStorage.GetBool('VRCX_StartAsMinimizedState');
|
||||||
$app.data.isCloseToTray = VRCXStorage.GetBool('VRCX_CloseToTray');
|
$app.data.isCloseToTray = VRCXStorage.GetBool('VRCX_CloseToTray');
|
||||||
var saveVRCXWindowOption = function () {
|
var saveVRCXWindowOption = function () {
|
||||||
|
VRCXStorage.SetBool('VRCX_StartAtWindowsStartup', this.isStartAtWindowsStartup);
|
||||||
VRCXStorage.SetBool('VRCX_StartAsMinimizedState', this.isStartAsMinimizedState);
|
VRCXStorage.SetBool('VRCX_StartAsMinimizedState', this.isStartAsMinimizedState);
|
||||||
VRCXStorage.SetBool('VRCX_CloseToTray', this.isCloseToTray);
|
VRCXStorage.SetBool('VRCX_CloseToTray', this.isCloseToTray);
|
||||||
|
VRCX.SetStartup(this.isStartAtWindowsStartup);
|
||||||
};
|
};
|
||||||
|
$app.watch.isStartAtWindowsStartup = saveVRCXWindowOption;
|
||||||
$app.watch.isStartAsMinimizedState = saveVRCXWindowOption;
|
$app.watch.isStartAsMinimizedState = saveVRCXWindowOption;
|
||||||
$app.watch.isCloseToTray = saveVRCXWindowOption;
|
$app.watch.isCloseToTray = saveVRCXWindowOption;
|
||||||
|
|
||||||
|
|||||||
+7
-3
@@ -771,7 +771,7 @@
|
|||||||
<el-switch v-model="discordActive"></el-switch>
|
<el-switch v-model="discordActive"></el-switch>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size:12px;margin-top:5px">
|
<div style="font-size:12px;margin-top:5px">
|
||||||
<span style="display:inline-block;min-width:150px">Instance Details</span>
|
<span style="display:inline-block;min-width:150px">Instance details</span>
|
||||||
<el-switch v-model="discordInstance"></el-switch>
|
<el-switch v-model="discordInstance"></el-switch>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -794,11 +794,15 @@
|
|||||||
<div style="margin-top:30px">
|
<div style="margin-top:30px">
|
||||||
<span style="font-weight:bold">Window</span>
|
<span style="font-weight:bold">Window</span>
|
||||||
<div style="font-size:12px;margin-top:5px">
|
<div style="font-size:12px;margin-top:5px">
|
||||||
<span style="display:inline-block;min-width:150px">Start as Minimized State</span>
|
<span style="display:inline-block;min-width:150px">Start at Windows startup</span>
|
||||||
|
<el-switch v-model="isStartAtWindowsStartup"></el-switch>
|
||||||
|
</div>
|
||||||
|
<div style="font-size:12px;margin-top:5px">
|
||||||
|
<span style="display:inline-block;min-width:150px">Start as minimized state</span>
|
||||||
<el-switch v-model="isStartAsMinimizedState"></el-switch>
|
<el-switch v-model="isStartAsMinimizedState"></el-switch>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size:12px;margin-top:5px">
|
<div style="font-size:12px;margin-top:5px">
|
||||||
<span style="display:inline-block;min-width:150px">Close to Tray</span>
|
<span style="display:inline-block;min-width:150px">Close to tray</span>
|
||||||
<el-switch v-model="isCloseToTray"></el-switch>
|
<el-switch v-model="isCloseToTray"></el-switch>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user