Documentation ¶
Overview ¶
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 ¶
- Constants
- func NewApplet(base cdtype.AppBase, events *cdtype.Events) cdtype.AppInstance
- type Applet
- func (app *Applet) AskLocationConfirm(locstr string)
- func (app *Applet) AskLocationText(deftxt string)
- func (app *Applet) Check()
- func (app *Applet) DetectLocation()
- func (app *Applet) DialogWeatherCurrent()
- func (app *Applet) DialogWeatherForecast(ref string)
- func (app *Applet) Draw()
- func (app *Applet) Init(def *cdtype.Defaults, confLoaded bool)
- func (app *Applet) OpenWebCurrent()
- func (app *Applet) OpenWebForecast(numDay int)
- func (app *Applet) SetLocationCode(locationCode, locationName string)
- func (app *Applet) WeatherIcon(icon string) string
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.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Applet ¶
type Applet struct { cdtype.AppBase // Applet base and dock connection. // contains filtered or unexported fields }
Applet defines a dock applet.
func (*Applet) AskLocationConfirm ¶
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 ¶
AskLocationText asks the user his location name.
If confirmed, continues the selection process. A default text may be used as argument.
func (*Applet) Check ¶
func (app *Applet) Check()
Check gets and displays updated weather informations.
func (*Applet) DetectLocation ¶
func (app *Applet) DetectLocation()
DetectLocation tries to detect your location from IP and get the matching code.
func (*Applet) DialogWeatherCurrent ¶
func (app *Applet) DialogWeatherCurrent()
DialogWeatherCurrent shows the current weather details.
func (*Applet) DialogWeatherForecast ¶
DialogWeatherForecast shows the weather details for one of the next days.
func (*Applet) OpenWebCurrent ¶
func (app *Applet) OpenWebCurrent()
OpenWebCurrent opens a web page on the provider site for the current day.
func (*Applet) OpenWebForecast ¶
OpenWebForecast opens a web page on the provider site for the given day.
func (*Applet) SetLocationCode ¶
SetLocationCode updates the config file with the new location and ... (TODO: need reload, to check).
func (*Applet) WeatherIcon ¶
WeatherIcon returns the full path to the current weather theme icon.