feat: params in gui/tui

This commit is contained in:
FUFSoB committed 2026-10-10 23:17:44 +05:00
1 parent 584c8ba0a0
commit cacd51595c
17 files changed
+1341 -197

No files matched your search

+10
View File
@@ -20,5 +20,15 @@ in
default = 3;
description = "How often the status refreshes, in seconds.";
};
floating = mkOption {
type = types.bool;
default = true;
description = ''
Open the window floating, sized to the screen, where a tiling compositor (niri, sway,
Hyprland, i3) would tile it. It opens at a fixed size, which those compositors float,
then resizes as usual. Turn off to let the compositor tile it.
'';
};
};
}
+5 -2
View File
@@ -6,7 +6,7 @@
# $watched: whether proxy-suite-outbound-groups drives this instance's failover groups through
# its Clash API. Without it (the TUN instances) a failover group is sing-box's own urltest.
#
# Output: {groups: {name: {strategy, failback, interval, members, pinned}}, outbounds: [the
# Output: {groups: {name: {strategy, failback, interval, members, listed, pinned}}, outbounds: [the
# sing-box group outbounds], top: [what the top level picks among, in order], loops: [groups
# inside themselves], warnings, errors}.
# Errors mean the config cannot be built (a group inside itself); warnings are dropped members
@@ -71,9 +71,12 @@ def glob_regex: "^" + (gsub("(?<c>[.+^$()\\[\\]{}|\\\\])"; "\\\(.c)") | gsub("\\
| .warnings += (if $usable == [] then ["group '\($g)' has no available member; it blocks until one is"] else [] end)
| (if $all == [] then ["block"] else $all end) as $all
| (if $usable == [] then ["block"] else $usable end) as $usable
# listed: the members the group names itself, which the front ends edit; members adds those
# its subscriptions and patterns pull in.
| .groups[$g] = {strategy: $cfg.strategy, failback: ($cfg.failback != false),
interval: ($cfg.interval // (if $cfg.strategy == "urltest" then $interval else "30s" end)),
members: $all, pinned: $pinned, runtime: ($cfg.runtime // false)}
members: $all, listed: [($cfg.outbounds // [])[] | select(. != $g)],
pinned: $pinned, runtime: ($cfg.runtime // false)}
| .outbounds += [
if ($cfg.strategy == "urltest" or ($cfg.strategy == "failover" and ($watched | not))) and $pinned == "" then
{type: "urltest", tag: $g, outbounds: $usable, url: $url,
+2
View File
@@ -49,6 +49,7 @@ let
proxyInboundsSubscriptionsBaseUrl = proxyInboundsCfg.subscriptions.baseUrl;
proxyInboundsXray = "${proxyInboundsCfg.package}/bin/xray";
guiRefreshInterval = cfg.gui.refreshInterval;
guiFloating = cfg.gui.floating;
# proxy_ctl.py reads these as "1"/"0" strings.
flag = enabled: if enabled then "1" else "0";
in
@@ -56,6 +57,7 @@ in
proxyCtl = packages.mkProxyCtl {
inherit
guiRefreshInterval
guiFloating
subscriptionTagsFile
perAppRoutingProfilesFile
proxychainsConfigFile