Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bibelin committed Sep 30, 2024
1 parent cc37199 commit 6ab112a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
32 changes: 32 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions taskbar.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Package to set window hints like progress in taskbar on Linux.
package taskbar

import (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6ab112a

Please sign in to comment.