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>
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>
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>
McdeSys gets mcde_sys_timezone_get (where /etc/localtime points into
/usr/share/zoneinfo), mcde_sys_timezones (zone1970.tab, else zone.tab, and
UTC) and mcde_sys_timezone_set: the zone must be a file of the zoneinfo
directory and a plain name, the caller root; the new link is made beside
/etc/localtime and renamed over it, so it is never missing (sysinst makes
the same link: src/usr.sbin/sysinst/util.c), and Debian's /etc/timezone
follows where it exists. All POSIX, in common.c, for NetBSD and Linux.
Date & Time shows the regions and their places with the zone in use
selected; Set Time Zone sets it as root, or opens a terminal where su asks
for the password and runs dtsystemsettings -set-timezone ZONE.
Measured: test_sysinfo on the Linux host says "zone Europe/Lisbon, 313
zones offered" and refuses "../../etc/passwd"; on Xvfb the pane shows
Europe / Lisbon selected (build/mcde-shots/desk-0.png). Setting a zone
is not measured yet (not on the host; the build VM is busy).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Motif 2.3.8 shifts the channels of a PNG without alpha the wrong way and
draws only its blue (docs/reference/motif-png.txt). libDtSvc gets
McdeImageGetPixmap/McdeImageFreePixmap (Mcde/Image.h): PNG through libpng's
simplified interface (png_image, the background for the alpha), packed by
the visual's masks; every other format still through XmGetPixmap. dtwm's
backdrops and slideshow and the small pictures of System Settings use it.
dtwm now also frees a backdrop pixmap that is not in Motif's cache (a
scaled copy), which it kept for good before.
configure finds libpng >= 1.6 with pkg-config; the recipe includes
graphics/png's buildlink3.mk (Motif depends on it already); the header is
in the PLIST.
Measured on Xvfb: the RGB PNG that showed only blue (slide-3.png before)
shows its colours as backdrop (build/mcde-shots/slide-3.png) and as a
small picture (desk-2.png). A 16-bit PNG is not measured.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
dtterm does not call DtInitialize: it starts the program side itself
(_DtMcdeGlobalMenuInitialize, declared in Mcde/GlobalMenu.h when Xt is in).
McdeGlobalMenu.c keeps all menu bars (dtterm has one per tab), hides any the
program manages while the bar runs (Xt change hook) and exports the first
that lives. dtterm's menus follow the tab with the focus
(_DtTermViewMenuSetCurrent, setContext split into contextFor), since from the
bar they are not posted from the tab. dtbar defers a new menu text while one
of its menus is open (the open menu was pulled away under the click).
Tested on Xvfb: dtterm's Window/Edit/Options/Help in the bar, no menu bar in
the window with two tabs, Window > New Tab from the bar makes the third.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
include/Mcde/GlobalMenu.h is the protocol (selection _MCDE_BAR_S<n>,
_MCDE_MENU on the program's window, _MCDE_ACTIVE_MENU on the root, client
messages to activate and refresh). libDtSvc's McdeGlobalMenu.c, started by
DtInitialize, finds every XmMenuBar with an Xt create hook, hides it while
the bar runs and writes its tree; a click in the bar calls the button's own
callback -- no Motif patch, every CDE program takes part. The text form is
McdeMenuModel.c with its test (PASS test_menumodel). dtbar: M menu (dtaction
Dtstyle, Dtterm, Dtfile, LockDisplay, ExitSession), the program's menus, the
clock; started by Xsession.d/0090.dtbar. The Mcde headers are installed.
Tested on Xvfb with dtwm and dtcalc: its menu bar leaves its window, Options
and Help are in the bar, Options > Memory Registers opens dtcalc's dialog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- pkgsrc recipe: DISTNAME mcde-0.1.0 (archive from tools/mcde-dist.sh),
CONFLICTS+= cde-[0-9]*, DESCR.
- configure.ac: AC_INIT name and version 0.1.0; MCDE_VERSION; the
tarname and the CDE_VERSION_* API level stay (share/cde, DtVERSION).
- Dt.h: DtVERSION_STRING "MCDE 0.1.0 (CDE 2.5.3)".
- programs/icons/MakronixDtlogo.pm from docs/logo/camouflage, installed,
in PLIST, the default Dtlogin*logo*bitmapFile.
- include/Mcde/McdeSys.h: users, network/Wi-Fi, host name, time zone;
checked with gcc -std=c99 -D_POSIX_C_SOURCE=200809L -pedantic.
- ext/src/mcde/AGENTS.md: the philosophy (CDE/Motif/Xlib only, C99/POSIX,
everything OS-specific behind lib/McdeSys, conflicts with CDE).
Not built yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cde-2.5.3.tar.gz, SHA512 a01b413b... as in pkgsrc distinfo; recipe from
pkgsrc 3c1118e94432. Added with -f: CDE's .gitignore hides 612 files of
the archive.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>