Results 1 to 8 of 8

Thread: kde, docking an app in systray

  1. #1

    Default kde, docking an app in systray

    inspired from https://github.com/user-none/KDocker/issues/42



    not all app are able to minimize in systray.

    how to minimize such an app ?

    i illustrate this tutorial by docking in systray "Android Messages"

    install kdocker:

    to see what is the last revision number

    https://github.com/user-none/KDocker/releases

    search the package here https://software.opensuse.org with key "kdocker"

    search opensuse leap 15.0

    click on "display community packages"

    search the last version

    run a "one click installation"

    in kde settings > start up and shutdown > desktop session > on login > applications to be excluded from sessions
    fill with text "kdocker"

    in ~/bin/
    create dock_messages.sh then check the file property "executable"

    put in
    Code:
    #!/bin/bash
    #
    sleep 2m
    /opt/google/chrome/google-chrome --app=https://messages.android.com && sleep 5s && WID="$(wmctrl -lx | grep Messages)"; kdocker -qw "${WID%% *}"
    in kde settings > start up and shutdown > desktop session > autostart
    add the script and select run on "startup"

    to get the right icon for "Android Messages"

    create a desktop launcher of "Android Messages"

    launch "Android Messages"

    launch kdocker

    the mouse cursor becomes a kdocker cursor

    put the cursor to the window of "Android Messages" then left click

    "Android Messages" is minimized in the systray

    right click on "Android Messages" icon

    go to "options" > set icon

    go to .local/share/icons/hicolor/32x32/apps/

    select "Android Messages" icon



    that's all

    enjoy
    OpenSuse Argon 15.3 x86_64,Asus Prime 250M-A, Intel Core i5-7400, 16 GB, Intel HD Graphics 630, Plugable usb-bt4le bluetooth 4.0 usb adapter, multicard reader USB 3.0 startech.com 35fcreadbu3, Epson XP-7100, Headset bluetooth 3.0 Philips SHQ7300

  2. #2

    Default Re : kde, docking an app in systray

    Some explanations

    >> in kde settings > start up and shutdown > desktop session > on login > applications to be excluded from sessions
    fill with text "kdocker"

    kdocker is an app if you close a kde session and an app is running at the next kde opening session then kde launch kdocker. we don't want that because kdocker does not record the docked apps.


    >> sleep 2m

    opening a kde session => during about 2 mn baloo indexer slows all task startup => script kdocker statement fails

    launching "Android Messages" before or during "Google Hangouts" startup => randomly this leads to 2 google chrome and 2 google hangouts instances and fails concerning chrome , hangouts and "Android Messages"



    >>
    WID="$(wmctrl -lx | grep Messages)"

    instead of "Messages" you can put any word from your app window title or the whole title



    >> create a desktop launcher of "Android Messages"

    with chrome go to messages.android.com
    then
    in the menu go to "more tools" > create a desktop launcher" <<<< not sure of the English terms

    this also adds icons for "Android Messages"
    OpenSuse Argon 15.3 x86_64,Asus Prime 250M-A, Intel Core i5-7400, 16 GB, Intel HD Graphics 630, Plugable usb-bt4le bluetooth 4.0 usb adapter, multicard reader USB 3.0 startech.com 35fcreadbu3, Epson XP-7100, Headset bluetooth 3.0 Philips SHQ7300

  3. #3

    Default Re : kde, docking an app in systray

    i forgot this:

    right click the icon of the minimized "Android Messages"
    go to "options
    check "skip taskbar"

    explanation:

    after using "Android Messages" you minimize the window then the app is minimized but stay in task bar. another bug of kdocker.
    OpenSuse Argon 15.3 x86_64,Asus Prime 250M-A, Intel Core i5-7400, 16 GB, Intel HD Graphics 630, Plugable usb-bt4le bluetooth 4.0 usb adapter, multicard reader USB 3.0 startech.com 35fcreadbu3, Epson XP-7100, Headset bluetooth 3.0 Philips SHQ7300

  4. #4

    Default Re : kde, docking an app in systray

    >> another bug of kdocker.

    no it's not a bug. kdocker can't avoid this problem. it just can supply a workaround.


    i forgot this:

    after checking "skip taskbar" you must record this property.

    right click the icon then go to "options" > save settings then left click on " save Google-chrome only"
    OpenSuse Argon 15.3 x86_64,Asus Prime 250M-A, Intel Core i5-7400, 16 GB, Intel HD Graphics 630, Plugable usb-bt4le bluetooth 4.0 usb adapter, multicard reader USB 3.0 startech.com 35fcreadbu3, Epson XP-7100, Headset bluetooth 3.0 Philips SHQ7300

  5. #5

    Default Re : kde, docking an app in systray

    to avoid conflict with the window "Kontact Messages" i change "Messages" by "Messages pour le Web" <<<< this is the french window title you must use the title which is displayed in your language
    to avoid "manualy checking "skip taskbar" " i change "qw" by "qtw"

    then the new script is :

    Code:
    #!/bin/bash
    #
    sleep 2m
    /opt/google/chrome/google-chrome --app=https://messages.android.com && sleep 5s && WID="$(wmctrl -lx | grep "Messages pour le Web")"; kdocker -qtw "${WID%% *}"
    OpenSuse Argon 15.3 x86_64,Asus Prime 250M-A, Intel Core i5-7400, 16 GB, Intel HD Graphics 630, Plugable usb-bt4le bluetooth 4.0 usb adapter, multicard reader USB 3.0 startech.com 35fcreadbu3, Epson XP-7100, Headset bluetooth 3.0 Philips SHQ7300

  6. #6

    Default Re : kde, docking an app in systray

    If you use kdeconnect then in kdeconnect-android you must uncheck "send SMS" according to receive only sms notification from desktop android messages.
    OpenSuse Argon 15.3 x86_64,Asus Prime 250M-A, Intel Core i5-7400, 16 GB, Intel HD Graphics 630, Plugable usb-bt4le bluetooth 4.0 usb adapter, multicard reader USB 3.0 startech.com 35fcreadbu3, Epson XP-7100, Headset bluetooth 3.0 Philips SHQ7300

  7. #7

    Default Re : kde, docking an app in systray

    - sometime problem with WID then app is not minimize in the systray

    i changed
    /opt/google/chrome/google-chrome --app=https://messages.android.com

    by

    bash -c '/opt/google/chrome/google-chrome --app=https://messages.android.com &'

    then

    the new script

    Code:
    #!/bin/bash
    #
    sleep 1m 45s
    bash -c '/opt/google/chrome/google-chrome --app=https://messages.android.com &' && sleep 5s && WID="$(wmctrl -lx | grep "Messages pour le Web")"; kdocker -qtw "${WID%% *}"




    - if you dock in systray several apps then they got the same icon

    you must add the pathname to the icon for each app

    then

    the new script

    Code:
    #!/bin/bash
    #
    sleep 1m 45s
    bash -c '/opt/google/chrome/google-chrome --app=https://messages.android.com &' && sleep 5s && WID="$(wmctrl -lx | grep "Messages pour le Web")"; kdocker -qtw "${WID%% *}" -i ~/.local/share/icons/hicolor/32x32/apps/chrome-nngjipgjhfkaeimbhgmodlbhligdflei-Default.png
    OpenSuse Argon 15.3 x86_64,Asus Prime 250M-A, Intel Core i5-7400, 16 GB, Intel HD Graphics 630, Plugable usb-bt4le bluetooth 4.0 usb adapter, multicard reader USB 3.0 startech.com 35fcreadbu3, Epson XP-7100, Headset bluetooth 3.0 Philips SHQ7300

  8. #8

    Default Re : kde, docking an app in systray

    finally with the help from https://github.com/user-none/KDocker/issues/42

    to avoid problem due to:
    - slow or fast launch of app
    - conflict between several apps docked in systray with kdocker
    - icon problem

    here is the final script

    Code:
    #!/bin/bash
    bash -c '/opt/google/chrome/google-chrome --app=https://messages.android.com &'
    while [ true ]
    do
       sleep 5
       status=$(wmctrl -l | grep "Messages pour le Web")
       if [ "$status" != "" ] ; then
          break
       fi
    done
    WID="$(wmctrl -lx | grep "Messages pour le Web")"; kdocker -qtw "${WID%% *}" -i ~/.local/share/icons/hicolor/32x32/apps/chrome-nngjipgjhfkaeimbhgmodlbhligdflei-Default.png
    OpenSuse Argon 15.3 x86_64,Asus Prime 250M-A, Intel Core i5-7400, 16 GB, Intel HD Graphics 630, Plugable usb-bt4le bluetooth 4.0 usb adapter, multicard reader USB 3.0 startech.com 35fcreadbu3, Epson XP-7100, Headset bluetooth 3.0 Philips SHQ7300

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •