minimize from a script - Ubuntu

This is a discussion on minimize from a script - Ubuntu ; I am looking for a way to minimize/iconify a window from a script (actually a bash function). 'man wmctrl' didn't help. Ditto for 'apropos minimize' and similar. I tried 'wmctrl -b toggle,hidden' but it apparently does nothing. Any ideas on ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: minimize from a script

  1. minimize from a script

    I am looking for a way to minimize/iconify a window from a script
    (actually a bash function). 'man wmctrl' didn't help. Ditto for 'apropos
    minimize' and similar. I tried 'wmctrl -b toggle,hidden' but it
    apparently does nothing. Any ideas on how to do this? Here's the function.
    It switches to 4th desktop, starts the app, then moves & resizes it.
    Thanks for any ideas you may have on this.

    function start-mahjongg ()
    {
    wmctrl -s 3
    /usr/lib/kde4/bin/kmahjongg &> /dev/null &
    sleep 2
    wmctrl -r "KMahjongg" -e 0,80,50,1100,865
    }

  2. Re: minimize from a script

    On Wed, 22 Oct 2008 11:07:41 -0500, Roland Latour wrote:

    > I am looking for a way to minimize/iconify a window from a script
    > (actually a bash function). 'man wmctrl' didn't help.


    Found https://bugs.launchpad.net/ubuntu/+s...rl/+bug/260875
    reported two months ago. Confirmed, importance undecided. Oh well.

  3. Re: minimize from a script

    On Wed, 22 Oct 2008 11:07:41 -0500, Roland Latour wrote:

    > I am looking for a way to minimize/iconify a window from a script
    > (actually a bash function). 'man wmctrl' didn't help. Ditto for 'apropos
    > minimize' and similar. I tried 'wmctrl -b toggle,hidden' but it apparently
    > does nothing. Any ideas on how to do this? Here's the function. It
    > switches to 4th desktop, starts the app, then moves & resizes it. Thanks
    > for any ideas you may have on this.
    >
    > function start-mahjongg ()
    > {
    > wmctrl -s 3
    > /usr/lib/kde4/bin/kmahjongg &> /dev/null & sleep 2
    > wmctrl -r "KMahjongg" -e 0,80,50,1100,865
    > }



    That is a KDE application, so you can use dcop like this:

    for i in $(dcop | grep kmahjongg) ; do

    dcop "$i" kmahjongg-mainwindow#1 minimize

    done


    Look at the available interfaces with kdcop.

    --
    One must learn by doing the thing; for though you
    think you know it, you have no certainty until you try.

    -- Sophocles


  4. Re: minimize from a script

    On Fri, 24 Oct 2008 21:27:38 -0500, Joe User wrote:

    > On Wed, 22 Oct 2008 11:07:41 -0500, Roland Latour wrote:
    >> I am looking for a way to minimize/iconify a window from a script
    >> (actually a bash function). 'man wmctrl' didn't help. Ditto for
    >> 'apropos minimize' and similar. I tried 'wmctrl -b toggle,hidden' but
    >> it apparently does nothing. Any ideas on how to do this? Here's the
    >> function. It switches to 4th desktop, starts the app, then moves &
    >> resizes it. Thanks for any ideas you may have on this.
    >>
    >> function start-mahjongg ()
    >> {
    >> wmctrl -s 3
    >> /usr/lib/kde4/bin/kmahjongg &> /dev/null & sleep 2 wmctrl -r
    >> "KMahjongg" -e 0,80,50,1100,865
    >> }

    > ================================================== ========
    > That is a KDE application, so you can use dcop like this:
    > for i in $(dcop | grep kmahjongg) ; do
    > dcop "$i" kmahjongg-mainwindow#1 minimize
    > done
    > Look at the available interfaces with kdcop.

    ================================================== =======
    Sorry, no, that doesn't work. The app doesn't show up either under dcop
    (command line) or kdcop (GUI). My best guess as to why, is that it is a
    KDE4 app and I'm using it under KDE 3.5.10. Oh well.

+ Reply to Thread