Progress Bar¶
A progress bar that displays underneath the window or app icon on the taskbar/dock.
Unity, KDE, Dash-to-Dock, Plank¶
Unity Launcher D-Bus API¶
Emit the signal com.canonical.Unity.LauncherEntry.Update.
libunity helper functions (C)¶
Each launcher icon can be controlled remotely by a discrete LauncherEntry object. New launcher entry object may be created by calling unity_launcher_entry_get_for_desktop_id (char *id); where id is the name of the desktop file shipped by the application you wish to control. For example GNOME Evolution ships "evolution.desktop" and Empathy ships "empathy.desktop".
Progress can be set by
unity_launcher_entry_set_progress (UnityLauncherEntry *self, gdouble progress)
and made visible by calling
unity_launcher_entry_set_progress_visible (UnityLauncherEntry *self, gboolean visible);
The progress value should be between 0.0 and 1.0.
libunity helper functions (Vala)¶
Each launcher icon can be controlled remotely by a discrete LauncherEntry object. New launcher entry object may be created by calling Unity.LauncherEntry.get_for_desktop_id (string app_uri); where app_uri is the name of the desktop file shipped by the application you wish to control. For example GNOME Evolution ships "evolution.desktop" and Empathy ships "empathy.desktop".
Progress can be set by
public double progress { get; set; }
and made visible by setting
public bool progress_visible { get; set; }
The progress value should be between 0.0 and 1.0.
Cinnamon (Linux Mint)¶
You can set the following X properties, or use libxapp (only if you’re using Gtk).
_NET_WM_XAPP_PROGRESS (32-bit cardinal (unsigned integer))¶
xprop -f _NET_WM_XAPP_PROGRESS 32c
"_NET_WM_XAPP_PROGRESS" XA_CARDINAL 32
Valid values: 0 to 100
Sets the progress hint for a window manager (like muffin) to make available when applications want to display the application’s progress in some operation.
Note: If a window will stick around after progress is complete, you will probaby need to delete _NET_WM_XAPP_PROGRESS to remove any progress effects on taskbars and window lists.
You must also delete _NET_WM_XAPP_PROGRESS_PULSE to use this flag.
_NET_WM_XAPP_PROGRESS_PULSE (32-bit cardinal (unsigned integer))¶
xprop -f _NET_WM_XAPP_PROGRESS_PULSE 32c
"_NET_WM_XAPP_PROGRESS_PULSE" XA_CARDINAL 32
Valid values: 1 – to disable pulse, delete the
Sets the progress pulse hint hint for a window manager (like muffin) to make available when applications want to display indeterminate or ongoing progress in a task manager.
Note: If a window will stick around after progress is complete, you will probaby need to set progress to 0 to remove any progress effects on taskbars and window lists. This will also remove the pulse state, if it is set.
You must also delete _NET_WM_XAPP_PROGRESS to use this flag.
Usage¶
// `cardinal` is the progress percentage or the progress pulse.
// `xid` is the window ID
// `display` is the Gdk display which this is on.
if (cardinal > 0) {
XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
xid,
gdk_x11_get_xatom_by_name_for_display (display, atom_name),
XA_CARDINAL, 32,
PropModeReplace,
(guchar *) &cardinal, 1);
} else {
XDeleteProperty (GDK_DISPLAY_XDISPLAY (display),
xid,
gdk_x11_get_xatom_by_name_for_display (display, atom_name));
}
libXApp convenience functions¶
The following functions work on GtkWindows:
You can also use XAppGtkWindow and use its methods set_window_progress and set_window_progress_pulse.
See also the blog post introducing this feature for examples.