control centre: status pill top right that opens into a macOS-like panel
Wi-Fi and hotspot (iwd, never D-Bus-activated by a read), VPN (openrc openvpn.*), Bluetooth (bluez), battery, volume, screen and keyboard light, performance mode (platform profile + governor + EPP through doas -n), and the external GPU with the programs using it (drm fdinfo). Icons move to glyph.rs.
This commit is contained in:
@@ -12,6 +12,76 @@ A Dynamic-Island-style media widget for Amane (Rust Wayland shell library), runn
|
||||
- **Opening animation:** the pill fades out, the empty shape grows, then the card fades in. Closing runs backwards. Moving the pointer off the open card closes it.
|
||||
- **Every monitor:** each monitor shows the pill. The card opens only on the monitor you click (a keybind opens it on the focused one), and only the focused monitor's pill shows live bars; the others show still bars, which keeps the cost at about one island's.
|
||||
- **Workspace pill:** top left on every monitor, that monitor's Hyprland workspaces as round numbered slots in the island's look. The focused workspace takes the accent colour, the one shown on another monitor a softer accent, empty ones dim. Click one to switch to it.
|
||||
- **Control centre:** top right on every monitor, a pill with Wi-Fi (or the hotspot), VPN, Bluetooth and the battery. Click it and it opens, in the island's way, into a panel like macOS's Control Center. See [Control centre](#control-centre).
|
||||
|
||||
## Control centre
|
||||
|
||||
The pill shows Wi-Fi signal (the hotspot sign while it's on), the VPN lock (accent when connected), Bluetooth (accent with a device connected) and the battery with its percentage (a bolt while charging, red below 15 %). Dim means off or not running.
|
||||
|
||||
The panel has:
|
||||
|
||||
- **Four tiles:** Wi-Fi, Bluetooth, VPN, Hotspot. Accent = on, grey = the service behind it isn't running. A grey tile is clickable when it can start that service.
|
||||
- *Wi-Fi* (iwd): iwd stopped → grey, a click runs `rc-service iwd start`. iwd running → a click turns the device (station) on or off. The shell never wakes iwd by asking it anything: it checks `NameHasOwner` first, because any D-Bus call to `net.connman.iwd` starts it.
|
||||
- *Bluetooth* (BlueZ, through Amane's `Bluetooth`): on/off. With bluez installed but stopped, a click runs `rc-service bluetooth start`; without bluez the tile says so.
|
||||
- *VPN*: the openrc services `/etc/init.d/openvpn.*` (here `openvpn.swiss`). Connecting while openrc has it *inactive*, connected once its `up.sh` marks it *started*. A click runs `rc-service openvpn.<name> start|stop`.
|
||||
- *Hotspot* (iwd access point): see [Hotspot setup](#hotspot-setup).
|
||||
- **Sound:** the default output's volume (drag or scroll the slider); the value next to the title is the mute button.
|
||||
- **Display:** the laptop screen's brightness (through logind, like Amane's `Brightness`) and the keyboard light (`tpacpi::kbd_backlight`: Off, Low, High). For external monitors see [External monitor brightness](#external-monitor-brightness).
|
||||
- **Performance:** the firmware profiles in `/sys/firmware/acpi/platform_profile_choices` (Low power, Balanced, Performance), and the battery's state and time left. Picking one sets the platform profile and the CPU governor and energy preference with it: Low power = `powersave` + `power`, Balanced = `powersave` + `balance_performance`, Performance = the `performance` governor.
|
||||
- **External GPU:** the GPU the machine didn't boot with (`boot_vga = 0`, here the Radeon RX 6600 in the Thunderbolt enclosure): load, temperature, power draw, video memory, and every program that has it open with its video memory (and its share of the GPU while the driver reports engine time). Found through `/proc/<pid>/fdinfo` (`drm-pdev`), only while the panel is open. Root's processes can't be read and don't show; the shell itself shows up, because Vulkan opens every GPU.
|
||||
|
||||
Changes that need root (starting services, the performance mode) run as `doas -n <fixed command>`, so they need a doas rule without a password for these commands (here `permit nopass fabian`). Nothing from other programs is passed to a shell.
|
||||
|
||||
```sh
|
||||
amane ipc call control toggle # also: open, close
|
||||
amane ipc call control status # expanded=<bool> wifi=<state> vpn=<state> profile=<p> battery=<n%>
|
||||
```
|
||||
|
||||
### Hotspot setup
|
||||
|
||||
iwd turns the Wi-Fi device into an access point, so the laptop isn't a Wi-Fi client while the hotspot is on (the internet then comes from `eth0`). Once, as root:
|
||||
|
||||
1. Let iwd hand out addresses, in `/etc/iwd/main.conf`. This also makes iwd configure IPv4 for Wi-Fi as a client:
|
||||
|
||||
```ini
|
||||
[General]
|
||||
EnableNetworkConfiguration=true
|
||||
```
|
||||
|
||||
2. A profile `/var/lib/iwd/ap/<Name>.ap` (`man iwd.ap`):
|
||||
|
||||
```ini
|
||||
[Security]
|
||||
Passphrase=at-least-eight-characters
|
||||
|
||||
[IPv4]
|
||||
Address=192.168.80.1
|
||||
DNSList=<your router, or a public resolver>
|
||||
```
|
||||
|
||||
3. `hotspot = <Name>` in `shell.conf` (applies live).
|
||||
4. To share `eth0`'s internet with the hotspot's devices, forwarding and NAT (iwd doesn't do this), e.g. with nftables:
|
||||
|
||||
```sh
|
||||
sysctl -w net.ipv4.ip_forward=1
|
||||
nft add table ip hotspot
|
||||
nft 'add chain ip hotspot post { type nat hook postrouting priority 100 ; }'
|
||||
nft add rule ip hotspot post ip saddr 192.168.80.0/24 oifname eth0 masquerade
|
||||
```
|
||||
|
||||
Clicking the tile switches the device to access-point mode and calls `StartProfile(<Name>)`; if that fails (no such profile) it switches back to a client. The tile shows the profile's name, then how many devices are connected.
|
||||
|
||||
### External monitor brightness
|
||||
|
||||
External monitors take brightness over DDC/CI (VCP code `10`), which `ddcutil` speaks. Not wired in yet; to try it:
|
||||
|
||||
1. `emerge --ask app-misc/ddcutil`
|
||||
2. Load `i2c-dev`: `modprobe i2c-dev`, and to keep it, `modules="i2c-dev"` in `/etc/conf.d/modules`.
|
||||
3. Access without root: ddcutil's udev rule gives the `/dev/i2c-*` buses to group `i2c`; `gpasswd -a fabian i2c`, then log in again.
|
||||
4. Turn on DDC/CI in each monitor's on-screen menu, if it has the option.
|
||||
5. `ddcutil detect` lists the monitors; `ddcutil --display 1 getvcp 10` reads one's brightness, `ddcutil --display 1 setvcp 10 60` sets it.
|
||||
|
||||
Each call takes 50–300 ms, so a slider has to send only where the drag ends. Monitors behind docks or MST hubs often don't pass DDC; the eGPU's own DP and HDMI ports usually do. Once `ddcutil detect` works, the Display block can get one slider per external monitor.
|
||||
|
||||
## Colours
|
||||
|
||||
@@ -29,8 +99,11 @@ The Material You scheme type is Skwd-wall's setting (`matugen.schemeType`).
|
||||
```
|
||||
cover_colors = false # true: the open media card and equalizer take the song cover's colours as background
|
||||
transition_ms = 400 # how long a colour change cross-fades; 0 switches instantly
|
||||
hotspot = MyHotspot # the iwd access point profile the control centre's hotspot starts
|
||||
```
|
||||
|
||||
Keep comments on lines of their own in the real file: a `#` after a value becomes part of it.
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
@@ -40,10 +113,13 @@ src/sound.rs per-player volume, mute, output and equalizer (pactl, pw-cli,
|
||||
src/spectrum.rs the shown player's sound as 24 levels (pw-record | cava)
|
||||
src/art.rs cover download (curl) and the palette file
|
||||
src/workspaces.rs the workspace pill, top left on every monitor
|
||||
src/control.rs the control centre: status pill top right, its panel, `control` IPC
|
||||
src/system.rs what the control centre shows: iwd, openvpn, power, the external GPU
|
||||
src/glyph.rs every drawn icon
|
||||
src/theme.rs the shell's colours: the matugen theme file, shell.conf, the cross-fade
|
||||
src/parse.rs pure text parsing with unit tests, no amane dependency
|
||||
matugen/ the matugen template (amane.colors), rendered by skwd-wall into ./theme
|
||||
shell.conf settings: cover_colors, transition_ms
|
||||
shell.conf settings: cover_colors, transition_ms, hotspot
|
||||
island-eq saved equalizer curves (a snapshot of ~/.config/amane/island-eq)
|
||||
tools/ remote test driver and fake MPRIS players, see AGENTS.md
|
||||
```
|
||||
@@ -56,6 +132,7 @@ On the desktop that runs the shell:
|
||||
- PipeWire with `pipewire-pulse`: `pactl`, `pw-record`, `pw-cli`, `pipewire` (filter-chain module)
|
||||
- `cava`, `curl`
|
||||
- the Fira Code font
|
||||
- for the control centre: `iwd`, openrc `openvpn.<name>` services, `pciutils` (`lspci`), optionally `bluez`, and a doas rule without a password for `rc-service` and `sh` (see [Control centre](#control-centre))
|
||||
|
||||
## Install and run
|
||||
|
||||
|
||||
Reference in New Issue
Block a user