diff --git a/doc.go b/doc.go new file mode 100644 index 0000000..5530084 --- /dev/null +++ b/doc.go @@ -0,0 +1,32 @@ +// Package to set window hints like progress in taskbar on Linux. +// +// You can enable progress bar, set an urgent state to an application ("pulse") +// or add a counter badge in taskbar. +// Take a note that you should not make your application rely on these features, +// as whether they will work depends on users desktop environments. +// +// The package uses libunity Launcher API +// (https://wiki.ubuntu.com/Unity/LauncherAPI) by default, which is supported in +// KDE and in GNOME with extensions like Dash-to-Dock. On Cinnamon it uses Xorg +// hints, the same that are used in libxapp (https://github.com/linuxmint/xapp). +// Neither libunity nor libxapp don't need to be installed for this package to +// work, direct Dbus calls and Xorg hints are used instead. +// +// There are 2 environment variables to enforce specific behaviour for this +// library: +// +// - GO_TASKBAR_BACKEND chooses specific backend no matter what should be +// selected automatically by code. Only useful for testing. +// Possible values: libunity, xapp +// - GO_TASKBAR_DESKTOP_NAME overwrites desktop file name passed to the library +// for libunity backend to work. This can be useful for packagers (especially +// for snaps, because desktop file names are changed there automaticaly) +// without the need to patch a program. +// +// A note for KDE users: while Plasma supports libunity Launcher API, you may +// notice lack of counter badges when developing software. This is caused by +// Plasma behaviour, that expects a counter badge to only be shown by an +// application that also shows notifications. If you application shows them, +// has a proper desktop file and showing badges is allowed in plasma settings, +// counter badge will work as it should. +package taskbar diff --git a/taskbar.go b/taskbar.go index 637392e..4c5ff3b 100644 --- a/taskbar.go +++ b/taskbar.go @@ -1,4 +1,3 @@ -// Package to set window hints like progress in taskbar on Linux. package taskbar import ( @@ -33,7 +32,8 @@ type Taskbar struct { // Creates [Taskbar] item. // `desktopName` is a name of desktop file to be worked with using libunity // Launcher API (".desktop" suffix can be omitted). `xid` is an xorg window ID -// used in case if taskbar item is modified using xapp window hints. +// used in case if taskbar item is modified using xapp window hints, set it to 0 +// if not used. func Connect(desktopName string, xid int32) (*Taskbar, error) { var t Taskbar var session session