mirror of
https://github.com/jahruz67/wisp-open.git
synced 2026-08-08 18:14:08 +00:00
feat: implement Linux global hotkey support using X11 and XDG portal backends with integrated media controls.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
//go:build linux
|
||||
|
||||
package hotkey
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/godbus/dbus/v5"
|
||||
)
|
||||
|
||||
const (
|
||||
linuxHKNone = iota
|
||||
linuxHKX11
|
||||
linuxHKPortal
|
||||
)
|
||||
|
||||
type platformHotkey struct {
|
||||
mu sync.Mutex
|
||||
registered bool
|
||||
backend int
|
||||
|
||||
// X11 (CGO)
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
canceled chan struct{}
|
||||
|
||||
// Wayland / XDG portal global shortcuts
|
||||
portalStop chan struct{}
|
||||
portalDone chan struct{}
|
||||
portalConn *dbus.Conn
|
||||
sessionPath dbus.ObjectPath
|
||||
}
|
||||
Reference in New Issue
Block a user