It requires x11-display and contributes exec i3 to xinitrc's last slot, and XDG_CURRENT_DESKTOP/XDG_SESSION_DESKTOP to the environment. It owns ~/.config/i3/config, ending with the config.d include where other modules drop their files, and /etc/lemurs/wms/i3, which runs the session's start. Over today's identical config it drops the dead lxpolkit, the D-Bus-activated portal, the xrdb merge xorg now does, and the execs that XDG autostart already started. It sets JetBrainsMono Nerd Font, runs i3-sensible-terminal, and declares dex, which the desktop lacked. The tools speak i3's IPC: the seat's reload, workspaces and windows, and focus, move, layout save/restore, exec, kill, bindings, config check, marks and the scratchpad. A watcher in the bundle (ADR 0198) replaces the predecessor's inotify script and user unit. It reloads only a configuration i3 -C accepts, and at its start whatever i3 has not loaded.
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package desktop
|
|
|
|
import (
|
|
"bytes"
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
)
|
|
|
|
// The desktop modules that carry this package. Each builds alone, so each has its own copy; this
|
|
// test, itself one of the copied files, holds them to one text wherever the siblings are present.
|
|
var carriers = []string{"xorg", "lemurs", "i3", "xterm", "adwaita"}
|
|
|
|
func TestEveryDesktopModuleCarriesTheSameCopy(t *testing.T) {
|
|
mine, err := filepath.Glob("*.go")
|
|
if err != nil || len(mine) == 0 {
|
|
t.Fatal("no files of this package found", err)
|
|
}
|
|
compared := 0
|
|
for _, module := range carriers {
|
|
dir := filepath.Join("..", "..", "..", module, "internal", "desktop")
|
|
if _, err := os.Stat(dir); err != nil {
|
|
continue
|
|
}
|
|
theirs, _ := filepath.Glob(filepath.Join(dir, "*.go"))
|
|
if len(theirs) != len(mine) {
|
|
t.Errorf("%s carries %d files of this package, this copy %d", module, len(theirs), len(mine))
|
|
continue
|
|
}
|
|
for _, f := range mine {
|
|
a, _ := os.ReadFile(f)
|
|
b, err := os.ReadFile(filepath.Join(dir, f))
|
|
if err != nil || !bytes.Equal(a, b) {
|
|
t.Errorf("%s's copy of %s differs from this one: change every copy together", module, f)
|
|
}
|
|
}
|
|
compared++
|
|
}
|
|
if compared == 0 {
|
|
t.Log("no sibling copies beside this module")
|
|
}
|
|
}
|