wallpaper

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Unlicense Imports: 14 Imported by: 2

README

Custom fork of reujab/wallpaper module for Walldo.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Desktop = os.Getenv("XDG_CURRENT_DESKTOP")

Desktop contains the current desktop environment on Linux. Empty string on all other operating systems.

View Source
var DesktopSession = os.Getenv("DESKTOP_SESSION")

DesktopSession is used by LXDE on Linux.

View Source
var DisplayServer = os.Getenv("XDG_SESSION_TYPE")

Xserver or Wayland display manager. Used for wayland support

View Source
var ErrUnsupportedDE = errors.New("your desktop environment is not supported")

ErrUnsupportedDE is thrown when Desktop is not a supported desktop environment.

Functions

func Get

func Get() (string, error)

Get returns the current wallpaper.

func SetFromFile

func SetFromFile(file string, mode ...string) error

SetFromFile sets wallpaper from a file path. Recibe the mode if feh is the (just one)

func SetFromURL

func SetFromURL(url string) error

SetFromURL downloads the image to a cache directory and calls SetFromFile.

func SetMode

func SetMode(mode Mode) (string, error)

SetMode sets the wallpaper mode. In case of non DE's this returns a string containing a feh command mode You can pass this string to "SetFromFile" to change the feh mode

Types

type Mode

type Mode int
const (
	Center Mode = iota
	Crop
	Fit
	Span
	Stretch
	Tile
)

Jump to

Keyboard shortcuts

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