Repository navigation
Announce connected devices that need software, with a setup guide - #19543
avillagran wants to merge 6 commits into
Conversation
Plugging in a printer, scanner, camera, iPhone, smart card reader, serial board or DisplayLink dock shows a notification whenever the device still needs software, at every plug-in and login until it is set up. Its click opens a guide where the user always picks what to install: packages from the repositories, the AUR where a driver is nowhere else, or the maker's download page. Installing brings the app to use the device too and sets it up: a printer gets its CUPS queue, a scanner its permissions. Omarchy ships no drivers and adds no packages to the base install: the watcher is a shell loop over udevadm monitor, and the guides are a JSON catalog. Setup > Devices reaches the same guides, including Printer for network printers.
[Medium impact] The PR appears safe to merge, with a non-blocking readiness bug for printers without serials. Findings
SummaryAdds notices and setup guides for connected devices that need software.
|
Match a printer's whole serial when picking its USB URI, give a second printer of the same model its own CUPS queue instead of taking over the first one's, and ask which driver to use when several installed drivers name the model, listing the chosen option's first. Offer scanning in the driverless and HP printer guides, open the app of the option that was installed (Epson Scan 2), recognise the fingerprint reader names omarchy-hw-fingerprint trusts, and number the device list so two identical devices can each be picked.
# Conflicts: # default/hypr/autostart.lua # test/shell.d/menu-test.sh
|
6201980 recognizes FocalTech fingerprint readers and treats an existing CUPS queue for the exact USB serial as evidence that the printer driver is installed. Other readiness checks still apply. The device guide and menu suites pass. |
| done <<<"$queues" | ||
| return 1 | ||
| else | ||
| [[ $queues == *"usb://"* ]] |
There was a problem hiding this comment.
Unconfigured printers can stay hidden
For a printer without a USB serial, this branch accepts any USB printer's CUPS queue. If this printer's catalog driver is installed, guide_ready returns true even when the queue belongs to another printer. The user gets no setup notice, and the printer disappears from Setup > Devices.
When no serial is available, match the queue to this printer's vendor and model instead of accepting any usb:// queue.
What changes
Plugging in a printer or scanner today gives no sign that anything happened, and nothing in the launcher scans. Someone coming from macOS or Windows has to know about SANE, ipp-usb, CUPS queues and vendor drivers, or ask someone. This adds a small watcher that notices devices that still need software and a guide that gets them working, without adding a single package to the base install: Omarchy ships no drivers, only knowledge of where to get them.
omarchy-device-watch, started with the session fromdefault/hypr/autostart.lua, readsudevadm monitorfor USB devices and also checks what is already connected at login. A device that needs software gets a notification — when it is plugged in and at every login until it is set up, at most once a minute for a loose cable. Devices that already work (keyboards, mice, drives, webcams, phones in file-transfer mode, hubs, YubiKeys, cellular modems, USB-C Billboards) stay quiet. Idle, it is one bash process andudevadm, about 2 MB of memory and no CPU: it blocks on the read.omarchy-device-detectsorts each device into a role from its sysfs interfaces: printer (and whether it prints driverless over IPP-USB), scanner, camera, iPhone/iPad, smart card reader, serial device, DisplayLink, fingerprint reader, or none bound at all. It then picks the most specific guide: the exact model, then driverless, then the vendor, then the role.default/omarchy/devices.jsonholds the guides as data: steps, the options to install, the app that uses the device, and a link to the docs or the maker's download page.omarchy-setup-deviceis what a notification click opens, in a floating terminal. It shows the guide, and Install and set up asks for each part of the device which option to use, every time, with Skip. For example, an Epson printer offers ESC/P-R, ESC/P-R 2, Gutenprint or Epson's download page, and its scanner half offers SANE with Document Scanner or Epson Scan 2. A driverless or HP printer can be installed with or without scanning (sane-airscan or SANE, plus Document Scanner). It then shows one summary of what will be installed and where from, and installs only after a confirmation. Installing brings in the app as well as the driver, and finishes the setup:devicesprovider), then Printer and Scanner, which also cover network printers, then Other.devices-otherprovider), such as Touch ID on Apple Silicon laptops, with what to do instead. That kind of hardware is never announced, since there is nothing to install.Where drivers come from
Most guides install from the Arch repositories:
gutenprint,foomatic-db,hplip,ipp-usb,sane,sane-airscan,simple-scan,gvfs-gphoto2,usbmuxd,gvfs-afc,pcsclite,ccidandfprintd.Vendor drivers are in neither the Arch repositories nor OPR, so for those the guide offers the AUR package next to the maker's download page, and says plainly that the AUR builds from community recipes. It asks for a separate confirmation before building. Those drivers are:
epson-inkjet-printer-escprandepson-inkjet-printer-escpr2(Epson printers; both build on aarch64)epsonscan2(Epson scanners, x86_64 only)brlaser(Brother lasers)brscan4andbrscan5(Brother scanners)cnijfilter2(Canon PIXMA, x86_64 only)splix(Samsung lasers)displaylink(DisplayLink docks)If OPR picked these up, the guides would only need their
aurlists moved topackages.Smaller pieces
swapProviderRowstakes aleadingflag, so a provider can list its rows above a submenu's fixed children.docs/menu.mddocuments the new providers and notes that a provider's row values must not slugify to a fixed child's id.docs/notifications.mddescribes the watcher.devices.*notification bodies indefault/i18n/en/cli.json, and the menu labels inmenu.json.Verification
test/shell.d/device-guide-test.shruns every command against a fake sysfs tree, with pacman, CUPS, gum, sudo and the notification sender stubbed. Its 32 tests cover:menu-test.shcovers theleadingprovider merge.i18n,menu,menu-guards,config,qml-text-formatand./test/clipass, as dobin/omarchy commands --checkand the syntax check overbin/../test/all,remote-session-service,tailscale-receive,update-stay-awake-security,theme-set-herdr-ssh-reuseandwindows-vm-mount-boundaryfail the same way on an unmodifiedquattrocheckout in this environment.Screenshots
The notification when the Epson is plugged in:
Setup > Devices, with the connected printer above the fixed guides:
Setup > Devices > Other on an Apple Silicon laptop:
A guide, opened from Setup > Devices > Printer: