shellipc

package
v0.3.16 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package shellipc is the shell's own session-bus surface: the dev.stubbe.lys.Shell1 control interface (wayle-shell-core's shell_ipc: bar visibility per monitor, the lock and VPN sign-in hooks) and the GApplication identity dev.stubbe.lys.shell with its org.gtk.Actions (quit, inspector), which `lys-shell panel` and single-instance checks use.

Index

Constants

View Source
const (
	AppID         = "dev.stubbe.lys.shell"
	AppPath       = dbus.ObjectPath("/dev/stubbe/lys/shell")
	ActionsIface  = "org.gtk.Actions"
	ActionQuit    = "quit"
	ActionInspect = "inspector"
)

The shell's application identity: the name and the org.gtk.Actions object a GtkApplication exports through GIO, so `lys-shell panel` and gapplication(1) reach the shell the same way.

View Source
const (
	ServiceName = "dev.stubbe.lys.Shell1"
	ServicePath = dbus.ObjectPath("/dev/stubbe/lys/Shell")
)

dev.stubbe.lys.Shell1 (wayle-ipc/src/shell_ipc.rs).

Variables

This section is empty.

Functions

func Claim added in v0.3.13

func Claim(conn *dbus.Conn) (bool, error)

Claim takes the application id on conn, or keeps it when conn holds it already. False means another shell holds it.

func IsRunning

func IsRunning(conn *dbus.Conn) (bool, error)

IsRunning is bootstrap.rs's is_already_running / the CLI's is_running: whether a shell owns the application id.

func Lock

func Lock(ctx context.Context, conn *dbus.Conn) error

Lock asks the running shell to show its lock screen.

func LockCommand

func LockCommand(ctx context.Context, conn *dbus.Conn, connErr error, stdout io.Writer) error

LockCommand is `lys-shell lock` and the lys-lock binary (lys-shell/src/cli/lock.rs): lock through the running shell and print "Session locked"; the errors carry the Rust CLI's wording. connErr is the session-bus dial's error.

func Serve

func Serve(conn *dbus.Conn, state *State, hooks Hooks) (func(), error)

Serve exports dev.stubbe.lys.Shell1 over state; from then until the release, each change of its Connectors or BarHidden is announced with PropertiesChanged.

func ServeApplication

func ServeApplication(conn *dbus.Conn, run Actions) (func(), error)

ServeApplication takes the application id, or keeps the one conn claimed, and exports run as its actions. Another shell holding the id is an error.

func VPNSSOCallback

func VPNSSOCallback(ctx context.Context, conn *dbus.Conn, uri string) error

VPNSSOCallback hands a globalprotectcallback: URI to the running shell's waiting sign-in. A refusal reads "<error name>: <message>", the zbus Display the Rust CLI prints.

Types

type Actions

type Actions struct {
	Quit    func()
	Inspect func()
}

Actions is what the two stateless actions run: Quit ends the shell, Inspect opens lys-ui's inspector.

type Hooks

type Hooks struct {
	// Lock shows the lock screen; false means it is not ready.
	Lock func() bool
	// VPNSSOCallback hands a browser callback to a waiting sign-in;
	// false means none is waiting.
	VPNSSOCallback  func(uri string) bool
	DashboardToggle func(monitor string) error
	// BarReveal shows an auto-hiding bar ("" every bar) for a few seconds.
	BarReveal func(monitor string)
	// BarFocus hands a bar ("" the focused output's) the keyboard.
	BarFocus func(monitor string) error
}

Hooks are the actions other parts of the shell provide. A nil hook answers as the Rust shell does before its component exists.

type State

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

State is ShellIpcState: the connectors that have a bar and the hidden subset. Changes reach OnHidden with the new hidden set, and the served Shell1 object announces them as PropertiesChanged.

func NewState

func NewState(onHidden func(hidden map[string]bool)) *State

NewState builds an empty state; onHidden (may be nil) observes every change of the hidden set.

func (*State) Hidden

func (s *State) Hidden(connector string) bool

Hidden reports whether connector's bar is hidden.

func (*State) Hide

func (s *State) Hide(monitor string)

Hide is bar.rs's hide: "" hides every bar; an unknown connector is ignored.

func (*State) SetConnectors

func (s *State) SetConnectors(connectors []string)

SetConnectors is monitors.rs's sync_ipc_state: the bars that exist, with hidden entries for vanished connectors dropped. Call it on every change of the set, startup's and each hotplug's.

func (*State) Show

func (s *State) Show(monitor string)

Show is bar.rs's show: "" shows every bar.

func (*State) Toggle

func (s *State) Toggle(monitor string)

Toggle is bar.rs's toggle: "" hides all when none is hidden and shows all otherwise.

Jump to

Keyboard shortcuts

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