panelplugin

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package panelplugin defines the panel plugin contract.

Index

Constants

View Source
const (
	// PanelPluginName constant.
	PanelPluginName = `panel`
)

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   `hyprpanel`,
	MagicCookieValue: `panel`,
}

Handshake default parameters.

View Source
var PluginMap = map[string]plugin.Plugin{
	PanelPluginName: &PanelPlugin{},
}

PluginMap default parameters.

Functions

This section is empty.

Types

type Host

type Host interface {
	Exec(command string) error
	FindApplication(query string) (*hyprpanelv1.AppInfo, error)
	SystrayActivate(busName string, x, y int32) error
	SystraySecondaryActivate(busName string, x, y int32) error
	SystrayScroll(busName string, delta int32, orientation hyprpanelv1.SystrayScrollOrientation) error
	SystrayMenuContextActivate(busName string, x, y int32) error
	SystrayMenuAboutToShow(busName string, menuItemID string) error
	SystrayMenuEvent(busName string, id int32, eventID hyprpanelv1.SystrayMenuEvent, data any, timestamp time.Time) error
	NotificationClosed(id uint32, reason hyprpanelv1.NotificationClosedReason) error
	NotificationAction(id uint32, actionKey string) error
	AudioSinkVolumeAdjust(id string, direction eventv1.Direction) error
	AudioSinkMuteToggle(id string) error
	AudioSourceVolumeAdjust(id string, direction eventv1.Direction) error
	AudioSourceMuteToggle(id string) error
	BrightnessAdjust(devName string, direction eventv1.Direction) error
}

Host interface.

type HostGRPCClient

type HostGRPCClient struct {
	// contains filtered or unexported fields
}

HostGRPCClient plugin host client implementation.

func (*HostGRPCClient) AudioSinkMuteToggle

func (c *HostGRPCClient) AudioSinkMuteToggle(id string) error

AudioSinkMuteToggle implementation.

func (*HostGRPCClient) AudioSinkVolumeAdjust

func (c *HostGRPCClient) AudioSinkVolumeAdjust(id string, direction eventv1.Direction) error

AudioSinkVolumeAdjust implementation.

func (*HostGRPCClient) AudioSourceMuteToggle

func (c *HostGRPCClient) AudioSourceMuteToggle(id string) error

AudioSourceMuteToggle implementation.

func (*HostGRPCClient) AudioSourceVolumeAdjust

func (c *HostGRPCClient) AudioSourceVolumeAdjust(id string, direction eventv1.Direction) error

AudioSourceVolumeAdjust implementation.

func (*HostGRPCClient) BrightnessAdjust

func (c *HostGRPCClient) BrightnessAdjust(devName string, direction eventv1.Direction) error

BrightnessAdjust implementation.

func (*HostGRPCClient) Exec

func (c *HostGRPCClient) Exec(command string) error

Exec implmenetation.

func (*HostGRPCClient) FindApplication

func (c *HostGRPCClient) FindApplication(query string) (*hyprpanelv1.AppInfo, error)

FindApplication implementation.

func (*HostGRPCClient) NotificationAction

func (c *HostGRPCClient) NotificationAction(id uint32, actionKey string) error

NotificationAction implementation.

func (*HostGRPCClient) NotificationClosed

func (c *HostGRPCClient) NotificationClosed(id uint32, reason hyprpanelv1.NotificationClosedReason) error

NotificationClosed implementation.

func (*HostGRPCClient) SystrayActivate

func (c *HostGRPCClient) SystrayActivate(busName string, x, y int32) error

SystrayActivate implementation.

func (*HostGRPCClient) SystrayMenuAboutToShow

func (c *HostGRPCClient) SystrayMenuAboutToShow(busName string, menuItemID string) error

SystrayMenuAboutToShow implementation.

func (*HostGRPCClient) SystrayMenuContextActivate

func (c *HostGRPCClient) SystrayMenuContextActivate(busName string, x, y int32) error

SystrayMenuContextActivate implementation.

func (*HostGRPCClient) SystrayMenuEvent

func (c *HostGRPCClient) SystrayMenuEvent(busName string, id int32, eventID hyprpanelv1.SystrayMenuEvent, _ any, timestamp time.Time) error

SystrayMenuEvent implementation.

func (*HostGRPCClient) SystrayScroll

func (c *HostGRPCClient) SystrayScroll(busName string, delta int32, orientation hyprpanelv1.SystrayScrollOrientation) error

SystrayScroll implementation.

func (*HostGRPCClient) SystraySecondaryActivate

func (c *HostGRPCClient) SystraySecondaryActivate(busName string, x, y int32) error

SystraySecondaryActivate implmenetation.

type HostGRPCServer

type HostGRPCServer struct {
	hyprpanelv1.UnimplementedHostServiceServer
	Impl Host
}

HostGRPCServer plugin host implementation.

func (*HostGRPCServer) AudioSinkMuteToggle

AudioSinkMuteToggle implementation.

func (*HostGRPCServer) AudioSinkVolumeAdjust

AudioSinkVolumeAdjust implementation.

func (*HostGRPCServer) AudioSourceMuteToggle

AudioSourceMuteToggle implmenetation.

func (*HostGRPCServer) AudioSourceVolumeAdjust

AudioSourceVolumeAdjust implementation.

func (*HostGRPCServer) BrightnessAdjust

BrightnessAdjust implementation.

func (*HostGRPCServer) Exec

Exec implementation.

func (*HostGRPCServer) FindApplication

FindApplication implementation.

func (*HostGRPCServer) NotificationAction

NotificationAction implementation.

func (*HostGRPCServer) NotificationClosed

NotificationClosed implementation.

func (*HostGRPCServer) SystrayActivate

SystrayActivate implementation.

func (*HostGRPCServer) SystrayMenuAboutToShow

SystrayMenuAboutToShow implementation.

func (*HostGRPCServer) SystrayMenuContextActivate

SystrayMenuContextActivate implementation.

func (*HostGRPCServer) SystrayMenuEvent

SystrayMenuEvent implementation.

func (*HostGRPCServer) SystrayScroll

SystrayScroll implementation.

func (*HostGRPCServer) SystraySecondaryActivate

SystraySecondaryActivate implementation.

type Panel

type Panel interface {
	Init(host Host, id string, loglevel configv1.LogLevel, config *configv1.Panel, stylesheet []byte) error
	Notify(evt *eventv1.Event)
	Context() context.Context
	Close()
}

Panel interface.

type PanelGRPCClient

type PanelGRPCClient struct {
	// contains filtered or unexported fields
}

PanelGRPCClient panel plugin client implementation.

func (*PanelGRPCClient) Close

func (c *PanelGRPCClient) Close()

Close implementation.

func (*PanelGRPCClient) Context

func (c *PanelGRPCClient) Context() context.Context

Context implementation.

func (*PanelGRPCClient) Init

func (c *PanelGRPCClient) Init(h Host, id string, loglevel configv1.LogLevel, config *configv1.Panel, stylesheet []byte) error

Init implementation.

func (*PanelGRPCClient) Notify

func (c *PanelGRPCClient) Notify(evt *eventv1.Event)

Notify implementation.

type PanelGRPCServer

type PanelGRPCServer struct {
	hyprpanelv1.UnimplementedPanelServiceServer
	Impl Panel
	// contains filtered or unexported fields
}

PanelGRPCServer panel plugin server implementation.

func (*PanelGRPCServer) Close

Close implmenetation.

func (*PanelGRPCServer) Init

Init implementation.

func (*PanelGRPCServer) Notify

Notify implementation.

type PanelPlugin

type PanelPlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Impl Panel
}

PanelPlugin definition.

func (*PanelPlugin) GRPCClient

func (p *PanelPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient satsifise the plugin interface.

func (*PanelPlugin) GRPCServer

func (p *PanelPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer satisfies the plugin interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL