1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-02 03:28:28 -04:00

core: migrate to dankgo shared go modules, embed quickshell in DMS

binary to mount at runtime, -c or DMS_SHELL_DIR overrides required to
explicitly override embedded configuration
This commit is contained in:
bbedward
2026-07-18 14:51:09 -04:00
parent 2114ece0df
commit 0cdb065739
114 changed files with 1009 additions and 3024 deletions
+2 -4
View File
@@ -1,12 +1,10 @@
package evdev
import (
"net"
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/models"
)
func HandleRequest(conn net.Conn, req models.Request, m *Manager) {
func HandleRequest(conn *models.Conn, req models.Request, m *Manager) {
switch req.Method {
case "evdev.getState":
handleGetState(conn, req, m)
@@ -15,6 +13,6 @@ func HandleRequest(conn net.Conn, req models.Request, m *Manager) {
}
}
func handleGetState(conn net.Conn, req models.Request, m *Manager) {
func handleGetState(conn *models.Conn, req models.Request, m *Manager) {
models.Respond(conn, req.ID, m.GetState())
}
+9 -6
View File
@@ -52,7 +52,8 @@ func TestHandleRequest(t *testing.T) {
closeChan: make(chan struct{}),
}
conn := newMockNetConn()
mc := newMockNetConn()
conn := models.NewConn(mc)
req := models.Request{
ID: 123,
Method: "evdev.getState",
@@ -62,7 +63,7 @@ func TestHandleRequest(t *testing.T) {
HandleRequest(conn, req, m)
var resp models.Response[State]
err := json.NewDecoder(conn.writeBuf).Decode(&resp)
err := json.NewDecoder(mc.writeBuf).Decode(&resp)
require.NoError(t, err)
assert.Equal(t, 123, resp.ID)
@@ -81,7 +82,8 @@ func TestHandleRequest(t *testing.T) {
closeChan: make(chan struct{}),
}
conn := newMockNetConn()
mc := newMockNetConn()
conn := models.NewConn(mc)
req := models.Request{
ID: 456,
Method: "evdev.unknownMethod",
@@ -91,7 +93,7 @@ func TestHandleRequest(t *testing.T) {
HandleRequest(conn, req, m)
var resp models.Response[any]
err := json.NewDecoder(conn.writeBuf).Decode(&resp)
err := json.NewDecoder(mc.writeBuf).Decode(&resp)
require.NoError(t, err)
assert.Equal(t, 456, resp.ID)
@@ -110,7 +112,8 @@ func TestHandleGetState(t *testing.T) {
closeChan: make(chan struct{}),
}
conn := newMockNetConn()
mc := newMockNetConn()
conn := models.NewConn(mc)
req := models.Request{
ID: 789,
Method: "evdev.getState",
@@ -120,7 +123,7 @@ func TestHandleGetState(t *testing.T) {
handleGetState(conn, req, m)
var resp models.Response[State]
err := json.NewDecoder(conn.writeBuf).Decode(&resp)
err := json.NewDecoder(mc.writeBuf).Decode(&resp)
require.NoError(t, err)
assert.Equal(t, 789, resp.ID)
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"time"
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
"github.com/AvengeMedia/DankMaterialShell/core/pkg/syncmap"
"github.com/AvengeMedia/dankgo/syncmap"
"github.com/fsnotify/fsnotify"
evdev "github.com/holoplot/go-evdev"
)