Commit Graph
8 Commits
Author SHA1 Message Date
lotherkandClaude Opus 5.5 385f366abd mcde: McdeSys finds the computers on the network and connects to them
mcde_sys_net_browse lists the computers that announce SMB, AFP, NFS, SSH
or just themselves by DNS-SD: on NetBSD through mdnsd with dns_sd.h from
base (DNSServiceBrowse per type, DNSServiceResolve per service, select
until the time is up; docs/reference/dns-sd.txt), on Linux with
avahi-browse -atrpk (its \DDD escapes decoded).  mcde_sys_net_shares
lists NFS exports (showmount -e) and SMB shares (smbclient -g -N -L);
mcde_sys_net_mount connects sftp:// (sshfs, a password on its standard
input), nfs:// (mount_nfs / mount.nfs) and afp:// (afpfs-ng's mount_afp)
to a folder; mcde_sys_net_unmount (fusermount -u, else umount).  Host
and user names are checked before they reach a command line.

mcde_sys_capture_limited ends a child after a time: showmount waited
minutes for an rpcbind that was not there (measured in the build VM);
the share lists wait 8 seconds.

Measured: on the Linux host 4 computers with their services (KITT,
N95 with SMB; two laptops with SMB and SSH), the local SMB share and NFS
export listed, a host name with ';' refused.  In the build VM: it builds
with -ldns_sd; without mdnsd a clear message; with mdnsd started the
browse ran and found none (qemu's user network carries no multicast);
showmount gave up after 8 s.  Mounting is not measured yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:47:12 +00:00
lotherkandClaude Opus 5.5 64bfd2048f mcde: Sharing in System Settings: SSH, SMB, NFS, AFP, AppleTalk
McdeSys gets the services that let others in (mcde_sys_service_state,
mcde_sys_service_set) and one list of shared folders for SMB, NFS and AFP
(mcde_sys_shares, mcde_sys_shares_set: /etc/mcde-shares, and a block
between "# MCDE shares begin" and "... end" in exports, smb.conf and
afp.conf; the rest of each file stays as written).  NetBSD switches
rc.conf and runs the rc.d scripts -- sshd; rpcbind, mountd, nfsd and
nfslocking for NFS; samba, netatalk, atalkd and papd from pkgsrc, whose
example rc.d scripts are copied to /etc/rc.d first, as PKG_RCD_SCRIPTS=YES
would.  Linux uses systemctl (ssh, smbd and nmbd, nfs-server, netatalk;
no AppleTalk).  NetBSD's kernel has AppleTalk (GENERIC: options NETATALK)
and pkgsrc's netatalk4 builds atalkd on NetBSD.  docs/reference/sharing.txt.

The Sharing pane (Internet & Network) shows each service with its switch
and how others reach it (ssh host, smb://host/, host:/folder,
afp://host/), and the shared folders with Add and Remove; as a user it
offers Unlock..., as Accounts does.

Measured: on the Linux host, read only: ssh, smb, nfs installed, enabled,
running; afp and appletalk not installed (the pane on Xvfb says so).  In
the build VM as root: NFS on started rpcbind, mountd, nfsd, statd, lockd;
sharing /tmp/mcdeshare made showmount -e list it for Everyone; NFS off
stopped them; the VM's rc.conf was restored after.  First found there:
mountd will not start without /etc/exports, and statd/lockd are one
script, nfslocking.  Samba and netatalk are not in the makronix set yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:36:46 +00:00
lotherkandClaude Opus 5.5 0987753527 mcde: the front panel shows the open programs left of the trash
CDE's front panel stays as it is.  Left of the trash it gets one part of
MCDE's (dtwm/WmMcdePanel.c): first the programs kept in the panel
(~/.dt/panel-apps), then the running programs no main panel control names.
A click brings a window forward on its workspace, or starts a kept
program; the right button offers Keep in Panel / Remove from Panel, and
dragging a running one to the left with the button held keeps it too.
The command to start a kept program comes from WM_COMMAND, else from the
process of _NET_WM_PID through the new mcde_sys_process_command (NetBSD:
sysctl kern.proc_args, Linux: /proc/PID/cmdline), else the class.

The buttons are CDE's panel controls (_DtCreateControl) with the class's
icon; a blank of the same width in the arrow row keeps every drawer's
arrow over its control; colour and pattern come from the panel row, so the
part follows the palette.  Hooks: UI.c (MainControlCreate), WmManage.c
(manage, unmanage), PopupMenu.c (the menu button over the part).

Measured on Xvfb (build/mcde-shots/panel-*.png, theme-*.png): dtterm and
dtcalc appear left of the trash; Keep in Panel wrote "Dtterm	dtterm",
the drag "Dtcalc	'dtcalc'"; with none running a click on the kept
dtcalc started it; in a dtsession with the Default and the Arizona palette
the part has the panel's colours and the bar, the panel and the windows
all change with the palette.

www: the front panel and the colours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:16:06 +00:00
lotherkandClaude Opus 5.5 dffeaf9b17 mcde: Wi-Fi in System Settings: the networks in reach, joining one
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>
2026-11-11 08:37:38 +00:00
lotherkandClaude Opus 5.5 451aac7fe4 mcde: the battery in the bar
McdeSys gets mcde_sys_battery: all batteries as one, charging, mains,
minutes left.  NetBSD reads the envsys(4) dictionary of /dev/sysmon as
envstat(8) does (acpibat "present", "charge", "charging", "discharge
rate"; acpiacad "connected"), Linux /sys/class/power_supply (energy_* or
charge_*, status, Mains/USB online).  The sources are in
docs/reference/battery.txt.

dtbar shows a fourth icon, only when there is a battery: full, half, low
(red), charging; its menu says the charge, the power source and the time
left.  The status bar is 30 pixels an icon.

Measured: on the Linux host test_sysinfo says "battery 76% ac", as
/sys/class/power_supply/BAT0/capacity and AC/online do; the menu on Xvfb
(build/mcde-shots/battery-menu.png) says "Battery: 76 %", "Power Source:
Power Adapter".  The NetBSD backend compiles and runs in the build VM,
which has no battery (envstat: no drivers registered): only the
no-battery case is measured there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 07:01:18 +00:00
lotherkandClaude Opus 5.5 8ab668c689 mcde: Accounts and Software Update, in dtsystemsettings and McdeSys
McdeSys: mcde_sys_users/user_add/user_delete (users.c, POSIX getpwent and
useradd/userdel), user_set_password and user_set_admin per system (NetBSD:
pw_gensalt+crypt for usermod -p, wheel; a group member removed by rewriting
the group's line as user.c does, since usermod -G only appends -- measured;
Linux: chpasswd on stdin, gpasswd, sudo), mcde_sys_update_check/apply
(NetBSD: /etc/makronix/update, RELEASE, sysupgrade, pkg_add -uu; Linux:
apt-get).  A secret goes through a pipe, never on a command line.
Tests: test_sysinfo refuses a bad login and, not as root, adding (PASS on
Linux and NetBSD); as root in the NetBSD VM add/admin on/off/password/delete
pass and /etc/group is as before.

dtsystemsettings: Accounts (list, Add/Delete/Password/Administrator,
Unlock... through su -m root in a terminal, password fields show stars),
Software Update (running, available, new packages, source, Check Now,
Update Now... runs -apply-update as root in a terminal; the check runs
after the pane shows: apt took 21 s here).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:38:21 +00:00
lotherkandClaude Opus 5.5 7aab59d334 mcde: McdeSys: network interfaces, volume, Bluetooth (NetBSD and Linux)
mcde_sys_interfaces (getifaddrs; Wi-Fi and SSID from the backend: the
SIOCG80211NWID ioctl on NetBSD, /sys/class/net and iw(8) on Linux),
mcde_sys_volume_get/set/mute (PulseAudio's pactl where a server answers,
else mixerctl(1) on NetBSD, amixer(1) on Linux), mcde_sys_bluetooth and
_power (btconfig(8), bluetoothctl(1)).  mcde_sys_capture reads a tool's
output to the end.  test_sysinfo only reads: on the Linux host Wi-Fi with
its SSID, 75 %, hci0 on; in the NetBSD VM wm0 wired with its address, no
mixer, no Bluetooth -- both PASS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 08:07:43 +00:00
lotherkandClaude Opus 5.5 9b90e256d6 mcde: lib/McdeSys begins: system information and power, NetBSD and Linux
mcde_sys_info (system, version, kernel, model, processor and count, memory,
startup disk and its space, host name) and mcde_sys_power (sleep, restart,
shut down) in libMcdeSys: common.c is POSIX, netbsd.c uses sysctl(3),
/etc/release, statvfs's f_mntfromname, zzz(8) and shutdown(8); linux.c uses
os-release(5), /proc and /sys, systemctl or shutdown(8).  test_sysinfo (make
check) passes on the Linux host and, compiled natively, in the NetBSD build VM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 07:47:52 +00:00