gosimac

command module
Version: v0.0.0-...-b9c0c39 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: GPL-2.0 Imports: 2 Imported by: 0

README

Go Si Mac

GitHub Workflow Status GitHub Workflow Status GitHub release (latest SemVer) GitHub Release Date

AUR package

Introduction

gosimac downloads Bing's daily wallpapers, Unsplash's random images, and etc. for you to have a beautiful wallpaper on your desktop whenever you want. Personally, I wrote this to have fun and help one of my friends who is not among us right now. 😞

Usage

Usage:
  GoSiMac [command]

Available Commands:
  bing        fetches images from https://bing.com
  help        Help about any command
  unsplash    fetches images from https://unsplash.org

Flags:
  -h, --help          help for GoSiMac
  -n, --number int    The number of photos to return (default 10)
  -p, --path string   A path to store the photos (default "/home/parham/Pictures/GoSiMac")
  -v, --version       version for GoSiMac

As an example, the following command downloads 10 images from unsplash while using Tehran as a search query.

export http_proxy="http://127.0.0.1:1080"
export https_proxy="http://127.0.0.1:1080"

gosimac u -q Tehran -n 10
set http_proxy "http://127.0.0.1:1080"
set https_proxy "http://127.0.0.1:1080"
$env:HTTP_PROXY = "http://127.0.0.1:1080"
$env:HTTPS_PROXY = "http://127.0.0.1:1080"

gosimac u -q Tehran -n 10

By default, gosimac stores images in $HOME/Pictures/GoSiMac.

Contribution

This module is highly customizable and new sources can easily add just by implementing source interface.

// Source represents source for image background.
type Source interface {
	Init() (int, error)                             // call once on source and return number of available images to fetch
	Name() string                                   // name of source in string format
	Fetch(index int) (string, io.ReadCloser, error) // fetch image from source
}

The Init method is called on initiation and returns number of available images to download. Then for each image Fetch is called and the result is stored at the user specific location. By implementing this interface you can create new sources for gosimac.

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Directories

Path Synopsis
Package bing provides a simple way to access bing API.
Package bing provides a simple way to access bing API.
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL