Expose DNS setting in the network widget
This commit is contained in:
@@ -155,7 +155,11 @@
|
||||
"setup.default.editor.helix": {"icon":"","label":"Helix","when":"omarchy-cmd-present helix","checked":"[[ \"$(omarchy-default-editor)\" == \"helix\" ]]","action":"omarchy-default-editor helix"},
|
||||
"setup.default.editor.vim": {"icon":"","label":"Vim","when":"omarchy-cmd-present vim","checked":"[[ \"$(omarchy-default-editor)\" == \"vim\" ]]","action":"omarchy-default-editor vim"},
|
||||
"setup.default.editor.emacs": {"icon":"","label":"Emacs","when":"omarchy-cmd-present emacs","checked":"[[ \"$(omarchy-default-editor)\" == \"emacs\" ]]","action":"omarchy-default-editor emacs"},
|
||||
"setup.dns": {"icon":"","label":"DNS","keywords":"network","action":"omarchy-launch-floating-terminal-with-presentation omarchy-setup-dns"},
|
||||
"setup.dns": {"icon":"","label":"DNS","keywords":"network resolver"},
|
||||
"setup.dns.dhcp": {"icon":"","label":"DHCP","keywords":"router automatic","checked":"[[ $(omarchy-dns) == \"DHCP\" ]]","action":"omarchy-dns DHCP"},
|
||||
"setup.dns.cloudflare": {"icon":"","label":"Cloudflare","checked":"[[ $(omarchy-dns) == \"Cloudflare\" ]]","action":"omarchy-dns Cloudflare"},
|
||||
"setup.dns.google": {"icon":"","label":"Google","checked":"[[ $(omarchy-dns) == \"Google\" ]]","action":"omarchy-dns Google"},
|
||||
"setup.dns.custom": {"icon":"","label":"Custom","checked":"[[ $(omarchy-dns) == \"Custom\" ]]","action":"omarchy-launch-floating-terminal-with-presentation omarchy-dns Custom"},
|
||||
"setup.security": {"icon":"","label":"Security","keywords":"fingerprint fido2"},
|
||||
"setup.config": {"icon":"","label":"Config","keywords":"files hyprland bar quickshell walker"},
|
||||
"setup.security.fingerprint": {"icon":"","label":"Fingerprint","action":"omarchy-launch-floating-terminal-with-presentation omarchy-setup-security-fingerprint"},
|
||||
|
||||
@@ -56,7 +56,7 @@ Example `shell.json` (bar subtree only shown):
|
||||
|---|---|---|
|
||||
| `media` | MPRIS now-playing — scrolling track + artist, cover-art popup | left = play/pause · middle = next · scroll = prev/next · right = popup |
|
||||
| `audioPanel` | Volume icon + popup with master slider, output-device picker, per-app mixer | left = popup · right = mute · middle = audio TUI · scroll = volume |
|
||||
| `networkPanel` | Wi-Fi/Ethernet icon + popup with Wi-Fi scan, signal, connect | left = popup · right = nmtui |
|
||||
| `networkPanel` | Wi-Fi/Ethernet icon + popup with Wi-Fi scan, signal, connect, DNS provider selection | left = popup · right = nmtui |
|
||||
| `bluetoothPanel` | Bluetooth icon + popup with device list, connect/disconnect, battery | left = popup · right = toggle radio · middle = bluetoothctl TUI |
|
||||
| `calendar` | Clock + popup with month-grid calendar | left = popup · right = tz selector |
|
||||
| `notificationCenter` | Bell with badge + popup with recent notifications, DND toggle | left = popup · right = toggle DND |
|
||||
|
||||
@@ -38,7 +38,10 @@ Item {
|
||||
|
||||
function refresh() {
|
||||
if (!detailsProc.running) detailsProc.running = true
|
||||
if (!dnsProc.running) dnsProc.running = true
|
||||
if (!dnsProc.running) {
|
||||
dnsProc.command = ["bash", "-lc", root.dnsCommand("")]
|
||||
dnsProc.running = true
|
||||
}
|
||||
if (!wifiProc.running) {
|
||||
scanning = true
|
||||
wifiProc.running = true
|
||||
@@ -110,7 +113,9 @@ Item {
|
||||
}
|
||||
|
||||
function dnsCommand(provider) {
|
||||
return "pkexec " + root.bar.shellQuote(root.bar.omarchyPath + "/bin/omarchy-setup-dns") + " " + root.bar.shellQuote(provider)
|
||||
var command = root.bar ? root.bar.shellQuote(root.bar.omarchyPath + "/bin/omarchy-dns") : "omarchy-dns"
|
||||
if (provider) command += " " + root.bar.shellQuote(provider)
|
||||
return command
|
||||
}
|
||||
|
||||
function setDns(provider) {
|
||||
@@ -208,19 +213,6 @@ iwctl station "$station" get-networks rssi-dbms 2>/dev/null \\
|
||||
|
||||
Process {
|
||||
id: dnsProc
|
||||
command: ["bash", "-c", `
|
||||
dns=$(awk -F= '/^[[:space:]]*DNS[[:space:]]*=/ { value=$0; sub(/^[^=]*=/, "", value); print value; exit }' /etc/systemd/resolved.conf 2>/dev/null)
|
||||
compact=$(printf '%s' "$dns" | tr -d '[:space:]')
|
||||
if [[ -z $compact ]]; then
|
||||
echo DHCP
|
||||
elif [[ $dns == *cloudflare-dns.com* || $dns == *"1.1.1.1"* || $dns == *"2606:4700:4700::1111"* ]]; then
|
||||
echo Cloudflare
|
||||
elif [[ $dns == *dns.google* || $dns == *"8.8.8.8"* || $dns == *"2001:4860:4860::8888"* ]]; then
|
||||
echo Google
|
||||
else
|
||||
echo Custom
|
||||
fi
|
||||
`]
|
||||
stdout: StdioCollector {
|
||||
waitForEnd: true
|
||||
onStreamFinished: root.updateDns(text)
|
||||
|
||||
Reference in New Issue
Block a user