fynedesk

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: BSD-3-Clause Imports: 1 Imported by: 0

README

GoDoc Reference 0.1.3 release Join us on Slack Support Fyne.io
Code Status Build Status Coverage Status

About

FyneDesk is an easy to use Linux/Unix desktop environment following material design. It is build using the Fyne toolkit and is designed to be easy to use as well as easy to develop. We use the Go language and welcome any contributions or feedback for the project.

Dependencies

For a full desktop experience you will also need the following external tools installed:

  • xbacklight
  • arandr

Getting Started

Using standard go tools you can install Fyne's desktop using:

go get fyne.io/fynedesk/cmd/fynedesk

Once installed you could set $GOPATH/fynedesk as your window manager (usually using .xinitrc). You can also run it in an embedded X window for testing using:

DISPLAY=:0 Xephyr :1 -screen 1280x720 &
DISPLAY=:1 fynedesk

It should look like this:

Fyne Desktop - Dark

If you run the command when there is a window manager running, or on an operating system that does not support window managers (Windows or macOS) then the app will start in UI test mode. When loaded in this way you can run all of the features except the controlling of windows - they will load on your main desktop.

Runner

A desktop needs to be rock solid and, whilst we are working hard to get there, any alpha or beta software can run in to unexpected issues. For that reason we have included a fynedesk_runner utility that can help manage unexpected events. If you start the desktop using the runner then if a crash occurs it will normally recover where it left off with no loss of data in your applications.

Using standard go tools you can install the runner using:

go get fyne.io/fynedesk/cmd/fynedesk_runner

From then on execute that instead of the fynedesk command for a more resillient desktop when testing out pre-release builds.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInstance

func SetInstance(desk Desktop)

SetInstance is an internal call :( TODO

Types

type AppData

type AppData interface {
	Name() string       // Name is the name of the app usually
	Run([]string) error // Run is the command to run the app, passing any environment variables to be set

	Icon(theme string, size int) fyne.Resource // Icon returns an icon for the app in the requested theme and size
}

AppData is an interface for accessing information about application icons

type ApplicationProvider

type ApplicationProvider interface {
	AvailableApps() []AppData
	AvailableThemes() []string
	FindAppFromName(appName string) AppData
	FindAppFromWinInfo(win Window) AppData
	FindAppsMatching(pattern string) []AppData
	DefaultApps() []AppData
}

ApplicationProvider describes a type that can locate icons and applications for the current system

type DeskSettings

type DeskSettings interface {
	Background() string
	IconTheme() string
	LauncherIcons() []string
	LauncherIconSize() int
	LauncherDisableTaskbar() bool
	LauncherDisableZoom() bool
	LauncherZoomScale() float64
	AddChangeListener(listener chan DeskSettings)
}

DeskSettings describes the configuration options available for Fyne desktop

type Desktop

type Desktop interface {
	Root() fyne.Window
	Run()
	RunApp(AppData) error
	Settings() DeskSettings
	ContentSizePixels(screen *Screen) (uint32, uint32)
	Screens() ScreenList

	IconProvider() ApplicationProvider
	WindowManager() WindowManager
}

Desktop defines an embedded or full desktop environment that we can run.

func Instance

func Instance() Desktop

Instance returns the current desktop environment and provides access to injected functionality.

type Screen

type Screen struct {
	Name                string // Name is the randr provided name of the screen
	X, Y, Width, Height int    // Geometry of the screen
}

Screen provides relative information about a single physical screen

type ScreenList

type ScreenList interface {
	Screens() []*Screen                                            // Screens returns a Screen type slice of each available physical screen
	Active() *Screen                                               // Active returns the screen index of the currently active screen
	Primary() *Screen                                              // Primary returns the screen index of the primary screen
	Scale() float32                                                // Return the scale calculated for use across screens
	ScreenForWindow(Window) *Screen                                // Return the screen that a window is located on
	ScreenForGeometry(x int, y int, width int, height int) *Screen // Return the screen that a geometry is located on
}

ScreenList provides information about available physical screens for Fyne desktop

type Stack

type Stack interface {
	AddWindow(Window)    // Add a new window to the stack
	RemoveWindow(Window) // Remove a specified window from the stack

	TopWindow() Window // Get the currently top most window
	Windows() []Window // Return a list of all managed windows. This should not be modified

	RaiseToTop(Window) // Request that the passed window become top of the stack.
}

Stack describes an ordered list of windows. The order of the windows in this list matches the stacking order on screen. TopWindow() returns the 0th element with each item after that being stacked below the previous.

type StackListener

type StackListener interface {
	WindowAdded(Window)
	WindowRemoved(Window)
}

StackListener is used to listen for events in the window manager stack (window list). See WindowManager.AddStackListener.

type Window

type Window interface {
	Decorated() bool     // Should this window have borders drawn?
	Title() string       // The name of this window
	Class() []string     // The class of this window
	Command() string     // The command of this window
	IconName() string    // The icon name of this window
	Icon() fyne.Resource // The icon of this window
	Fullscreened() bool  // Is the window Fullscreen?
	Iconic() bool        // Is the window Iconified?
	Maximized() bool     // Is the window Maximized?
	TopWindow() bool     // Is this the window on top?
	SkipTaskbar() bool   // Should this window be added to the taskbar?
	Focused() bool       // Is this the currently focused window?

	Focus()            // Ask this window to get input focus
	Close()            // Close this window and possibly the application running it
	Fullscreen()       // Request to fullscreen this window
	Unfullscreen()     // Request to unfullscreen this window
	Iconify()          // Request to inimize this window and possibly children of this window
	Uniconify()        // Request to restore this window and possibly children of this window from being minimized
	Maximize()         // Request to resize this window to it's largest possible size
	Unmaximize()       // Request to restore this window to its size before being maximized
	RaiseAbove(Window) // Raise this window above a given other window
	RaiseToTop()       // Raise this window to the top of the stack
}

Window represents a single managed window within a window manager. There may be borders or not depending on configuration.

type WindowManager

type WindowManager interface {
	Stack
	AddStackListener(StackListener)

	Close()
	SetRoot(fyne.Window)
	Blank()
}

WindowManager describes a full window manager which may be loaded as part of the setup.

Directories

Path Synopsis
cmd
ui

Jump to

Keyboard shortcuts

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