godock: github.com/sqp/godock/services/Clouds Index | Files

package Clouds

import "github.com/sqp/godock/services/Clouds"

Package Clouds is a weather monitoring applet for Cairo-Dock.

It's almost a clone of the weather app to show weather forecast icons.

Added:

Autodetect location based on IP.
Shortcuts: show dialog today, show tomorrow, open Webpage, recheck, set location.
Editable template.

Possible problem (to confirm):

External applets left and middle clicks disabled when a subdock is set.
  For me, even when the subdock is removed, clicks actions aren't restored.
  This can be tested by disabling the subdock (set forecast days to 0).

Dock issue:

On some systems the right click menu is called twice.

Dropped, because it's impossible to do for an external app:

  (but it could be possible to try in dock mode.
   The problem would be the config file differences between both)

Always visible option and its background color.
Render desklet in 3D
Sub-dock view type.

Index

Package Files

clouds.go

Constants

const (
    // IconWork is the name of icon displayed during polling.
    IconWork = "EmblemWork.svg" // file located in applet "img" subdir.

    // IconMissing is the name of the icon displayed when a weather icon is not found.
    IconMissing = "default-icon"

    // EmblemWork is the position of the emblem displayed during polling.
    EmblemWork = cdtype.EmblemTopLeft
)
const (
    ActionNone = iota
    ActionShowCurrent
    ActionShowTomorrow
    ActionOpenWebpage
    ActionRecheckNow
    ActionSetLocation
)

List of actions defined in this applet. Actions order in this list must match the order in defineActions.

func NewApplet Uses

func NewApplet(base cdtype.AppBase, events *cdtype.Events) cdtype.AppInstance

NewApplet creates a new applet instance.

type Applet Uses

type Applet struct {
    cdtype.AppBase // Applet base and dock connection.
    // contains filtered or unexported fields
}

Applet defines a dock applet.

func (*Applet) AskLocationConfirm Uses

func (app *Applet) AskLocationConfirm(locstr string)

AskLocationConfirm search the list of cities matching the provided name and shows a dialog with the list of locations for the user to choose. When validated, the config file is updated and ...(TODO: need reload, to check). If no data is found, the user is sent back to the AskLocationText dialog with the text he provided.

func (*Applet) AskLocationText Uses

func (app *Applet) AskLocationText(deftxt string)

AskLocationText asks the user his location name.

If confirmed, continues the selection process. A default text may be used as argument.

func (*Applet) Check Uses

func (app *Applet) Check()

Check gets and displays updated weather informations.

func (*Applet) DetectLocation Uses

func (app *Applet) DetectLocation()

DetectLocation tries to detect your location from IP and get the matching code.

func (*Applet) DialogWeatherCurrent Uses

func (app *Applet) DialogWeatherCurrent()

DialogWeatherCurrent shows the current weather details.

func (*Applet) DialogWeatherForecast Uses

func (app *Applet) DialogWeatherForecast(ref string)

DialogWeatherForecast shows the weather details for one of the next days.

func (*Applet) Draw Uses

func (app *Applet) Draw()

Draw new data on icon.

func (*Applet) Init Uses

func (app *Applet) Init(def *cdtype.Defaults, confLoaded bool)

Init load user configuration if needed and initialise applet.

func (*Applet) OpenWebCurrent Uses

func (app *Applet) OpenWebCurrent()

OpenWebCurrent opens a web page on the provider site for the current day.

func (*Applet) OpenWebForecast Uses

func (app *Applet) OpenWebForecast(numDay int)

OpenWebForecast opens a web page on the provider site for the given day.

func (*Applet) SetLocationCode Uses

func (app *Applet) SetLocationCode(locationCode, locationName string)

SetLocationCode updates the config file with the new location and ... (TODO: need reload, to check).

func (*Applet) WeatherIcon Uses

func (app *Applet) WeatherIcon(icon string) string

WeatherIcon returns the full path to the current weather theme icon.

Package Clouds imports 10 packages (graph) and is imported by 1 packages. Updated 2017-10-02. Refresh now. Tools for package owners.