McdeSys implements mcde_sys_wifi_scan and mcde_sys_wifi_join. NetBSD does what sysinst does (src/usr.sbin/sysinst/net.c): a network block in /etc/wpa_supplicant.conf -- a new file gets the example's ctrl_interface for the wheel group, so wpa_cli answers users -- and wpa_supplicant, wpa_supplicant_flags and dhcpcd in rc.conf, each line replaced or added; then both are restarted. Scanning asks wpa_cli scan_results, else ifconfig -v IF list scan (root). Linux uses nmcli. The sources are in docs/reference/wifi.txt. The Network pane lists the networks of the first Wi-Fi card with signal and lock, scanned once the pane is drawn. Join... opens a terminal where su asks for the administrator's password and dtsystemsettings -join-wifi IF SSID-HEX asks for the network's password without echo: the name goes as hexadecimal, the password on no command line of MCDE's (nmcli takes it on its own on Linux; said in linux.c). Measured on the Linux host: test_sysinfo finds 5 networks on wlp0s20f3 (read only); the pane lists them on Xvfb; -join-wifi as a user refuses with "Only the administrator can join" and refuses a bad name. Not measured: joining (never on this host), NetBSD scanning and joining (no Wi-Fi in the build VM). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
61 lines
2.4 KiB
C
61 lines
2.4 KiB
C
/*
|
|
* ui.h -- dtsystemsettings: what the panes share (main.c)
|
|
*
|
|
* Copyright (c) 2026 The Makronix project. GNU LGPL 2.0 or later, as CDE.
|
|
*/
|
|
|
|
#ifndef _dtsystemsettings_ui_h
|
|
#define _dtsystemsettings_ui_h
|
|
|
|
#include <X11/Intrinsic.h>
|
|
#include <Xm/Xm.h>
|
|
|
|
extern XtAppContext app;
|
|
|
|
XmRenderTable PaneFont(Widget w, int size, Boolean bold);
|
|
Widget Text(Widget parent, const char *name, const char *text);
|
|
void SetText(Widget w, const char *text);
|
|
Widget Button(Widget parent, const char *label, XtCallbackProc cb,
|
|
XtPointer data);
|
|
Widget PaneButton(Widget parent, const char *label, XtCallbackProc cb,
|
|
XtPointer data);
|
|
Widget Table(Widget parent, const char *const *rows, int n, Widget *values);
|
|
Pixmap Icon(Widget w, const char *file);
|
|
void Spawn(const char *command);
|
|
|
|
/* a message in a small window; ERROR: an error */
|
|
void Message(Widget parent, const char *text, int error);
|
|
/* the command line that runs COMMAND as root in a terminal, after su(1)
|
|
* asked for the password there ("Unlock..."); into BUF */
|
|
void AsRoot(const char *title, const char *command, char *buf, size_t len);
|
|
|
|
/* the panes in accounts.c and update.c */
|
|
Widget MakeAccounts(Widget parent);
|
|
Widget MakeUpdate(Widget parent);
|
|
/* the value of a resource in the server's RESOURCE_MANAGER, read anew
|
|
* (Xlib keeps the string of the connection's start); DEF when none */
|
|
void ServerResource(Display *dpy, const char *name, const char *class,
|
|
const char *def, char *buf, size_t len);
|
|
/* the pane in desktop.c, opened on its desktop or its screen saver page */
|
|
Widget MakeDesktop(Widget parent);
|
|
Widget MakeScreenSaver(Widget parent);
|
|
/* the Wi-Fi part of the Network pane (wifi.c); NULL without a Wi-Fi card */
|
|
Widget MakeWifi(Widget parent);
|
|
/* dtsystemsettings -join-wifi IF [SSID in hex]: the terminal of "Join..." */
|
|
int JoinWifiCommand(const char *ifname, const char *hexssid);
|
|
/* the time zone in Date & Time (timezone.c) */
|
|
Widget MakeZoneChooser(Widget parent);
|
|
/* dtsystemsettings -set-timezone ZONE: what the terminal of "Set Time Zone"
|
|
* runs */
|
|
int SetTimezoneCommand(const char *zone);
|
|
/* the panes in appearance.c */
|
|
Widget MakeAppearance(Widget parent);
|
|
Widget MakeFonts(Widget parent);
|
|
/* the panes in input.c */
|
|
Widget MakeKeyboard(Widget parent);
|
|
Widget MakeMouse(Widget parent);
|
|
/* dtsystemsettings -apply-update: what the terminal of "Update Now" runs */
|
|
int ApplyUpdate(void);
|
|
|
|
#endif /* _dtsystemsettings_ui_h */
|