mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-08 06:28:27 -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:
@@ -3,7 +3,6 @@ package wlroutput
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||
@@ -31,7 +30,7 @@ type ConfigurationRequest struct {
|
||||
Test bool `json:"test"`
|
||||
}
|
||||
|
||||
func HandleRequest(conn net.Conn, req models.Request, manager *Manager) {
|
||||
func HandleRequest(conn *models.Conn, req models.Request, manager *Manager) {
|
||||
if manager == nil {
|
||||
models.RespondError(conn, req.ID, "wlroutput manager not initialized")
|
||||
return
|
||||
@@ -51,11 +50,11 @@ func HandleRequest(conn net.Conn, req models.Request, manager *Manager) {
|
||||
}
|
||||
}
|
||||
|
||||
func handleGetState(conn net.Conn, req models.Request, manager *Manager) {
|
||||
func handleGetState(conn *models.Conn, req models.Request, manager *Manager) {
|
||||
models.Respond(conn, req.ID, manager.GetState())
|
||||
}
|
||||
|
||||
func handleApplyConfiguration(conn net.Conn, req models.Request, manager *Manager, test bool) {
|
||||
func handleApplyConfiguration(conn *models.Conn, req models.Request, manager *Manager, test bool) {
|
||||
headsParam, ok := models.Get[any](req, "heads")
|
||||
if !ok {
|
||||
models.RespondError(conn, req.ID, "missing 'heads' parameter")
|
||||
@@ -86,13 +85,13 @@ func handleApplyConfiguration(conn net.Conn, req models.Request, manager *Manage
|
||||
models.Respond(conn, req.ID, models.SuccessResult{Success: true, Message: msg})
|
||||
}
|
||||
|
||||
func handleSubscribe(conn net.Conn, req models.Request, manager *Manager) {
|
||||
func handleSubscribe(conn *models.Conn, req models.Request, manager *Manager) {
|
||||
clientID := fmt.Sprintf("client-%p", conn)
|
||||
stateChan := manager.Subscribe(clientID)
|
||||
defer manager.Unsubscribe(clientID)
|
||||
|
||||
initialState := manager.GetState()
|
||||
if err := json.NewEncoder(conn).Encode(models.Response[State]{
|
||||
if err := conn.WriteResponse(models.Response[State]{
|
||||
ID: req.ID,
|
||||
Result: &initialState,
|
||||
}); err != nil {
|
||||
@@ -100,7 +99,7 @@ func handleSubscribe(conn net.Conn, req models.Request, manager *Manager) {
|
||||
}
|
||||
|
||||
for state := range stateChan {
|
||||
if err := json.NewEncoder(conn).Encode(models.Response[State]{
|
||||
if err := conn.WriteResponse(models.Response[State]{
|
||||
Result: &state,
|
||||
}); err != nil {
|
||||
return
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/proto/wlr_output_management"
|
||||
wlclient "github.com/AvengeMedia/DankMaterialShell/core/pkg/go-wayland/wayland/client"
|
||||
"github.com/AvengeMedia/DankMaterialShell/core/pkg/syncmap"
|
||||
"github.com/AvengeMedia/dankgo/syncmap"
|
||||
)
|
||||
|
||||
type OutputMode struct {
|
||||
|
||||
Reference in New Issue
Block a user