6

I try my best to be more clear.

When we open an application, it will be shown in dock. Is it possible to open an application without make it appear in dock.

For example:

I should be able to open chrome (for example), but it should not be in dock.


EDIT 1:

What I have tried so far:

I opened gedit for test.

The part of output of wmctrl -l is 0x03800049 0 ravan Untitled Document 1 - gedit

The command:

wmctrl -r "Untitled Document 1 - gedit" -b add,skip_taskbar

do the job of skipping from dock.

The problem is, I can't get it back if its minimized (win + H).

8
+50

It is possible not to show the task list in the dock.

  1. Hold Control and right-click anywhere on the dock
  2. Select "Preferences"
  3. Select the "Behavior" tab
  4. Under the heading "Item Management", disable "Show Unpinned"

Running, but unpinned items will no longer show in the dock.

Be aware that dock items act as the minimize/unminimize mechanism. If you've modified your window decoration layout to include a minimize button, you'll no longer have an easy way to unminimize windows. However, minimized windows are still accessible from the multitasking view.

  • Hey Daniel, hidden features o_O – Ravan Dec 8 '15 at 1:30
  • 2
    Well, how can I get it back, if its minimized? – Ravan Dec 8 '15 at 1:32
6

The dock of elementary os is plank. So i analyzed the plank source and found the reason why it could not process skip taskbar option of windows. So i modified two parts of the plank to do it.

First, it gets the number of windows of the application includes skip taskbar optioned windows.

We can find exact source function from the plank source. It's get_num_windows function of lib/Services/WindowControl.vala . At following, I added a condition to check is_skip_tasklist.

public static uint get_num_windows (Bamf.Application app)
{
    Wnck.Screen.get_default ();
    Array<uint32>? xids = app.get_xids ();

    warn_if_fail (xids != null);

    uint count = 0;

    for (var i = 0; xids != null && i < xids.length; i++) {
        unowned Wnck.Window window = Wnck.Window.@get (xids.index (i));
        if (window != null && window.get_transient () == null && !window.is_skip_tasklist ()) /* LOOK, should be added && !window.is_skip_tasklist() */
            count++;
    }

    return count;
}

Second, it could not process indicator when the skip taskbar option of the windows is changed. The related part of the source is handle_user_visible_changed function of lib/Items/ApplicationDockItem.vala . I added a line at the function as following.

void handle_user_visible_changed (bool user_visible)
{
    update_indicator (); /* LOOK, should be called */
    if (user_visible) {
        app_window_added ();
        return;
    }

    if (this is TransientDockItem)
        App = null;

    app_closed ();
}

Following simple python script is what visible/invisible special application on the plank. Before run this script, you should install python wnck module with the command, $ sudo apt-get install python-wnck

#!/usr/bin/python

import wnck
import sys

if __name__ == "__main__":
    if len(sys.argv) != 3:
        print "Usage: appvisible <appname> <1|0>"
        sys.exit(0)

    processname = sys.argv[1]
    visible = sys.argv[2]

    screen = wnck.screen_get_default()
    screen.force_update()

    for window in screen.get_windows():
        if window.get_class_group().get_name() == processname:
            if visible == "1":
                window.set_skip_tasklist(True)
            else:
                window.set_skip_tasklist(False)

It can be used as following way. $ appvisible gedit 0 - visible gedit on plank, $ appvisible gedit 1 - invisible gedit on plank.

Additional edit for un-minimize the skipped & minimized window.

#!/usr/bin/python

import gtk
import wnck
import sys
import time

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print "Usage: unminimize <-l|appname>"
        sys.exit(0)

    appname = sys.argv[1]

    screen = wnck.screen_get_default()
    screen.force_update()

    for window in screen.get_windows():
        if not window.is_minimized():
            continue
        if not window.is_skip_tasklist():
            continue
        if appname == '-l':
            print window.get_class_group().get_name()
        elif window.get_class_group().get_name() == appname:
            window.unminimize(gtk.gdk.x11_get_server_time(gtk.gdk.get_default_root_window()))

You can use it as ./unminimize -l - list skipped & minimized windows, ./unminimize appname.

  • Well, good work +1 , I will let you know after I tested it :) – Ravan Dec 7 '15 at 7:12
  • 2
    I would feel better if you could more aptly point out that editing system files may break a system. In the future, changes and updates could result in this effectively bricking a system, you just don't know. – Lewis Goddard Dec 7 '15 at 20:09
  • @Ravan please look the additional script to unminimize. – xiaodongjie Dec 9 '15 at 2:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.