launcher

package module
v0.0.0-...-51eab02 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: MIT Imports: 18 Imported by: 0

README

firefox-launcher

firefox-launcher starts/stops/suspends multiple firefoxes.

Installation

go get -u github.com/susurri/firefox-launcher/cmd/firefox-launcher

Usage

Run firefox-launcher and type help at the prompt.

Auto mode

suspend firefox when it is not an active window.

Requirements

An EWMH/NetWM compatible X Window Manager.

It has been tested on Gentoo Linux running Cinnamon desktop.

It may work on the other Linux distributions and window managers.

License

The software is available as open source under the terms of the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Run is the entry point.

Types

type Config

type Config struct {
	Name string
	Mode string
}

Config configures mode of firefox instance.

type Configs

type Configs []Config

Configs is a slice of Config.

func (Configs) Len

func (c Configs) Len() int

Len returns the length of Configs.

func (Configs) Less

func (c Configs) Less(i, j int) bool

Less returns if the first element is less than the second one.

func (Configs) Swap

func (c Configs) Swap(i, j int)

Swap swaps the elements.

type Firefox

type Firefox struct {
	Pid      int
	Status   Status
	RealPath string
	Mode     Mode
}

Firefox holds the status of the firefox process.

func (Firefox) IsFront

func (f Firefox) IsFront() bool

IsFront returns whether it is running at the front window.

func (Firefox) Shutdown

func (f Firefox) Shutdown()

Shutdown gracefully shutdowns the firefox.

func (Firefox) Suspend

func (f Firefox) Suspend()

Suspend suspends the firefox.

func (*Firefox) Update

func (f *Firefox) Update()

Update updates the Firefox.

type FirefoxMap

type FirefoxMap map[string]Firefox

FirefoxMap is a map from profile name to Firefox.

func NewFirefoxMap

func NewFirefoxMap() FirefoxMap

NewFirefoxMap creates a FirefoxMap.

type Help

type Help struct {
	Text        string
	Description string
}

Help holds a help message.

type Mode

type Mode int

Mode represents mode of firefox instance.

const (
	Auto Mode = iota
	On
	Off
	Suspend
	None
)

Mode definitions for firefox instance.

func (Mode) String

func (m Mode) String() string

type Profile

type Profile struct {
	Name       string
	IsRelative int
	Path       string
}

Profile of firefox.

type Status

type Status int

Status is status of firefox process.

const (
	Up Status = iota
	Down
)

Firefox process is runnnig or not.

func (Status) String

func (s Status) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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