Compare commits

..

No commits in common. "916055d8bdd5c067f56d95c9643fd639210ed122" and "da3d4c36a9931df6b9f3ca1402b0adbd1c0b2df5" have entirely different histories.

7 changed files with 17 additions and 58 deletions

View file

@ -14,6 +14,5 @@ public enum ECoreType
hysteria2 = 26, hysteria2 = 26,
brook = 27, brook = 27,
overtls = 28, overtls = 28,
shadowquic = 29,
v2rayN = 99 v2rayN = 99
} }

View file

@ -507,7 +507,6 @@ public class Global
{ ECoreType.juicity, "juicity/juicity" }, { ECoreType.juicity, "juicity/juicity" },
{ ECoreType.brook, "txthinking/brook" }, { ECoreType.brook, "txthinking/brook" },
{ ECoreType.overtls, "ShadowsocksR-Live/overtls" }, { ECoreType.overtls, "ShadowsocksR-Live/overtls" },
{ ECoreType.shadowquic, "spongebob888/shadowquic" },
{ ECoreType.v2rayN, "2dust/v2rayN" }, { ECoreType.v2rayN, "2dust/v2rayN" },
}; };

View file

@ -200,15 +200,6 @@ public sealed class CoreInfoHandler
Arguments = "-r client -c {0}", Arguments = "-r client -c {0}",
Url = GetCoreUrl(ECoreType.overtls), Url = GetCoreUrl(ECoreType.overtls),
AbsolutePath = false, AbsolutePath = false,
},
new CoreInfo
{
CoreType = ECoreType.shadowquic,
CoreExes = [ "shadowquic", "shadowquic"],
Arguments = "-c {0}",
Url = GetCoreUrl(ECoreType.shadowquic),
AbsolutePath = false,
} }
]; ];

View file

@ -7,4 +7,4 @@ X-GNOME-Autostart-enabled=true
Name[en_US]=v2rayN Name[en_US]=v2rayN
Name=v2rayN Name=v2rayN
Comment[en_US]=v2rayN Comment[en_US]=v2rayN
Comment=v2rayN Comment=v2rayN

View file

@ -29,6 +29,9 @@ set_gnome_proxy() {
echo "Ignored Hosts: $IGNORE_HOSTS" echo "Ignored Hosts: $IGNORE_HOSTS"
elif [ "$MODE" == "none" ]; then elif [ "$MODE" == "none" ]; then
echo "GNOME: Proxy disabled." echo "GNOME: Proxy disabled."
else
echo "GNOME: Invalid mode. Use 'none' or 'manual'."
exit 1
fi fi
} }
@ -66,6 +69,9 @@ set_kde_proxy() {
# Disable proxy # Disable proxy
$KWRITECONFIG --file kioslaverc --group "Proxy Settings" --key ProxyType 0 $KWRITECONFIG --file kioslaverc --group "Proxy Settings" --key ProxyType 0
echo "KDE: Proxy disabled." echo "KDE: Proxy disabled."
else
echo "KDE: Invalid mode. Use 'none' or 'manual'."
exit 1
fi fi
# Apply changes by restarting KDE's network settings # Apply changes by restarting KDE's network settings
@ -78,7 +84,7 @@ detect_desktop_environment() {
echo "gnome" echo "gnome"
return return
fi fi
if [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]] || [[ "$XDG_SESSION_DESKTOP" == *"XFCE"* ]]; then if [[ "$XDG_CURRENT_DESKTOP" == *"XFCE"* ]] || [[ "$XDG_SESSION_DESKTOP" == *"XFCE"* ]]; then
echo "gnome" echo "gnome"
return return
@ -88,7 +94,7 @@ detect_desktop_environment() {
echo "gnome" echo "gnome"
return return
fi fi
if [[ "$XDG_CURRENT_DESKTOP" == *"UKUI"* ]] || [[ "$XDG_SESSION_DESKTOP" == *"ukui"* ]]; then if [[ "$XDG_CURRENT_DESKTOP" == *"UKUI"* ]] || [[ "$XDG_SESSION_DESKTOP" == *"ukui"* ]]; then
echo "gnome" echo "gnome"
return return
@ -111,15 +117,6 @@ detect_desktop_environment() {
return return
fi fi
done done
# Fallback to GNOME method if CLI utility is available. This solves the
# proxy configuration issues on minimal installation systems, like setups
# with only window managers, that borrow some parts from big DEs.
if command -v gsettings >/dev/null 2>&1; then
echo "gnome"
return
fi
echo "unsupported" echo "unsupported"
} }
@ -137,11 +134,6 @@ PROXY_IP=$2
PROXY_PORT=$3 PROXY_PORT=$3
IGNORE_HOSTS=$4 IGNORE_HOSTS=$4
if ! [[ "$MODE" =~ ^(manual|none)$ ]]; then
echo "Invalid mode. Use 'none' or 'manual'." >&2
exit 1
fi
# Detect desktop environment # Detect desktop environment
DE=$(detect_desktop_environment) DE=$(detect_desktop_environment)
@ -152,6 +144,6 @@ elif [ "$DE" == "kde" ]; then
set_gnome_proxy "$MODE" "$PROXY_IP" "$PROXY_PORT" "$IGNORE_HOSTS" set_gnome_proxy "$MODE" "$PROXY_IP" "$PROXY_PORT" "$IGNORE_HOSTS"
set_kde_proxy "$MODE" "$PROXY_IP" "$PROXY_PORT" "$IGNORE_HOSTS" set_kde_proxy "$MODE" "$PROXY_IP" "$PROXY_PORT" "$IGNORE_HOSTS"
else else
echo "Unsupported desktop environment: $DE" >&2 echo "Unsupported desktop environment: $DE"
exit 1 exit 1
fi fi

View file

@ -34,8 +34,6 @@ public class StatusBarViewModel : MyReactiveObject
public ReactiveCommand<Unit, Unit> SubUpdateViaProxyCmd { get; } public ReactiveCommand<Unit, Unit> SubUpdateViaProxyCmd { get; }
public ReactiveCommand<Unit, Unit> CopyProxyCmdToClipboardCmd { get; } public ReactiveCommand<Unit, Unit> CopyProxyCmdToClipboardCmd { get; }
public ReactiveCommand<Unit, Unit> NotifyLeftClickCmd { get; } public ReactiveCommand<Unit, Unit> NotifyLeftClickCmd { get; }
public ReactiveCommand<Unit, Unit> ShowWindowCmd { get; }
public ReactiveCommand<Unit, Unit> HideWindowCmd { get; }
#region System Proxy #region System Proxy
@ -93,9 +91,6 @@ public class StatusBarViewModel : MyReactiveObject
[Reactive] [Reactive]
public bool EnableTun { get; set; } public bool EnableTun { get; set; }
[Reactive]
public bool BlIsNonWindows { get; set; }
#endregion UI #endregion UI
public StatusBarViewModel(Func<EViewAction, object?, Task<bool>>? updateView) public StatusBarViewModel(Func<EViewAction, object?, Task<bool>>? updateView)
@ -105,7 +100,6 @@ public class StatusBarViewModel : MyReactiveObject
SelectedServer = new(); SelectedServer = new();
RunningServerToolTipText = "-"; RunningServerToolTipText = "-";
BlSystemProxyPacVisible = Utils.IsWindows(); BlSystemProxyPacVisible = Utils.IsWindows();
BlIsNonWindows = Utils.IsNonWindows();
if (_config.TunModeItem.EnableTun && AllowEnableTun()) if (_config.TunModeItem.EnableTun && AllowEnableTun())
{ {
@ -149,21 +143,11 @@ public class StatusBarViewModel : MyReactiveObject
Locator.Current.GetService<MainWindowViewModel>()?.ShowHideWindow(null); Locator.Current.GetService<MainWindowViewModel>()?.ShowHideWindow(null);
await Task.CompletedTask; await Task.CompletedTask;
}); });
ShowWindowCmd = ReactiveCommand.CreateFromTask(async () =>
{
Locator.Current.GetService<MainWindowViewModel>()?.ShowHideWindow(true);
await Task.CompletedTask;
});
HideWindowCmd = ReactiveCommand.CreateFromTask(async () =>
{
Locator.Current.GetService<MainWindowViewModel>()?.ShowHideWindow(false);
await Task.CompletedTask;
});
AddServerViaClipboardCmd = ReactiveCommand.CreateFromTask(async () => AddServerViaClipboardCmd = ReactiveCommand.CreateFromTask(async () =>
{ {
await AddServerViaClipboard(); await AddServerViaClipboard();
}); });
AddServerViaScanCmd = ReactiveCommand.CreateFromTask(async () => AddServerViaScanCmd = ReactiveCommand.CreateFromTask(async () =>
{ {
await AddServerViaScan(); await AddServerViaScan();

View file

@ -32,15 +32,7 @@
ToolTipText="{Binding RunningServerToolTipText}"> ToolTipText="{Binding RunningServerToolTipText}">
<TrayIcon.Menu> <TrayIcon.Menu>
<NativeMenu> <NativeMenu>
<NativeMenuItem <NativeMenuItem Command="{Binding NotifyLeftClickCmd}" Header="{x:Static resx:ResUI.menuShowOrHideMainWindow}" />
Command="{Binding ShowWindowCmd}"
Header="{x:Static resx:ResUI.TbDisplayGUI}"
IsVisible="{Binding BlIsNonWindows}" />
<NativeMenuItem
Command="{Binding NotifyLeftClickCmd}"
Header="{x:Static resx:ResUI.menuShowOrHideMainWindow}"
IsVisible="{Binding BlIsNonWindows}" />
<NativeMenuItem Command="{Binding CopyProxyCmdToClipboardCmd}" Header="{x:Static resx:ResUI.menuCopyProxyCmdToClipboard}" />
<NativeMenuItemSeparator /> <NativeMenuItemSeparator />
<NativeMenuItem <NativeMenuItem
Command="{Binding SystemProxyClearCmd}" Command="{Binding SystemProxyClearCmd}"
@ -68,6 +60,8 @@
<NativeMenuItem Command="{Binding SubUpdateCmd}" Header="{x:Static resx:ResUI.menuSubUpdate}" /> <NativeMenuItem Command="{Binding SubUpdateCmd}" Header="{x:Static resx:ResUI.menuSubUpdate}" />
<NativeMenuItem Command="{Binding SubUpdateViaProxyCmd}" Header="{x:Static resx:ResUI.menuSubUpdateViaProxy}" /> <NativeMenuItem Command="{Binding SubUpdateViaProxyCmd}" Header="{x:Static resx:ResUI.menuSubUpdateViaProxy}" />
<NativeMenuItemSeparator /> <NativeMenuItemSeparator />
<NativeMenuItem Command="{Binding CopyProxyCmdToClipboardCmd}" Header="{x:Static resx:ResUI.menuCopyProxyCmdToClipboard}" />
<NativeMenuItemSeparator />
<NativeMenuItem Click="MenuExit_Click" Header="{x:Static resx:ResUI.menuExit}" /> <NativeMenuItem Click="MenuExit_Click" Header="{x:Static resx:ResUI.menuExit}" />
</NativeMenu> </NativeMenu>
</TrayIcon.Menu> </TrayIcon.Menu>