wm/src/bsp/wm.go
2023-06-11 05:24:15 -05:00

47 lines
500 B
Go

package bsp
import (
"sync"
)
type WM struct {
Desktops []*Desktop
Monitors []*Monitor
mu sync.RWMutex
}
type Desktop struct {
Name string
Monitor *Monitor
}
type Monitor struct {
Name string
}
func (w *WM) Mutate(fn func() error) {
w.mu.Lock()
defer w.mu.Unlock()
if fn != nil {
fn()
}
}
func (w *WM) View(fn func() error) {
w.mu.RLock()
defer w.mu.RUnlock()
if fn != nil {
fn()
}
}
func (w *WM) AddDesktop(name string) {
}
func NewWM() *WM {
w := &WM{}
return w
}