How to get the workspace number from the command line?

View: New views
8 Messages — Rating Filter:   Alert me  

How to get the workspace number from the command line?

by Peng Yu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm wondering if there is a way to get the workspace name from the
command line. This would be useful when I send an email when a program
finish in a terminal. Based on the workspace name, I can find out the
terminal more easily.

Regards,
Peng

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
IceWM-user mailing list
IceWM-user@...
https://lists.sourceforge.net/lists/listinfo/icewm-user

Re: How to get the workspace number from the command line?

by monoped :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Peng Yu schrieb:

> I'm wondering if there is a way to get the workspace name from the
> command line. This would be useful when I send an email when a program
> finish in a terminal. Based on the workspace name, I can find out the
> terminal more easily.

This prints the workspace number:

     wmctrl -d | awk '$2 == "*" { print $1 }'

If you need the workspace name, try this little script:

============================================================
#!/bin/bash

no=$(wmctrl -d | awk '$2 == "*" { print $1 }')
line=$(grep '^WorkspaceNames=' ~/.icewm/preferences)
IFS=,
names=($line)
name=${names[no]}
name=${name#?}
echo ${name%?}
============================================================

Regards,
Bernd

--
Bernd Eggink
http://sudrala.de

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
IceWM-user mailing list
IceWM-user@...
https://lists.sourceforge.net/lists/listinfo/icewm-user

Re: How to get the workspace number from the command line?

by Peng Yu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Sep 28, 2009 at 3:11 AM, Bernd Eggink <monoped@...> wrote:

> Peng Yu schrieb:
>
>> I'm wondering if there is a way to get the workspace name from the
>> command line. This would be useful when I send an email when a program
>> finish in a terminal. Based on the workspace name, I can find out the
>> terminal more easily.
>
> This prints the workspace number:
>
>    wmctrl -d | awk '$2 == "*" { print $1 }'

I don't find wmctrl on my machine. Where can I download the source so
that I can compile it?

> If you need the workspace name, try this little script:
>
> ============================================================
> #!/bin/bash
>
> no=$(wmctrl -d | awk '$2 == "*" { print $1 }')
> line=$(grep '^WorkspaceNames=' ~/.icewm/preferences)
> IFS=,
> names=($line)
> name=${names[no]}
> name=${name#?}
> echo ${name%?}
> ============================================================
>
> Regards,
> Bernd
>
> --
> Bernd Eggink
> http://sudrala.de
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
IceWM-user mailing list
IceWM-user@...
https://lists.sourceforge.net/lists/listinfo/icewm-user

Re: How to get the workspace number from the command line?

by monoped :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Peng Yu schrieb:

> On Mon, Sep 28, 2009 at 3:11 AM, Bernd Eggink <monoped@...> wrote:
>> Peng Yu schrieb:
>>
>>> I'm wondering if there is a way to get the workspace name from the
>>> command line. This would be useful when I send an email when a program
>>> finish in a terminal. Based on the workspace name, I can find out the
>>> terminal more easily.
>> This prints the workspace number:
>>
>>    wmctrl -d | awk '$2 == "*" { print $1 }'
>
> I don't find wmctrl on my machine. Where can I download the source so
> that I can compile it?

http://tripie.sweb.cz/utils/wmctrl/

Regards,
Bernd

--
Bernd Eggink
http://sudrala.de

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
IceWM-user mailing list
IceWM-user@...
https://lists.sourceforge.net/lists/listinfo/icewm-user

RE: How to get the workspace number from the command line?

by Hart, Corey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Peng Yu,

Please try google or use your favorite search engine before posting to the mailing list.  A simple search of "wmctrl" would have gotten you exactly what you needed.  You have had multiple postings where a quick search would have yielded you exactly what you needed.  

The unspoken law of mailing list etiquette is to search before posting.  

Please understand I'm just trying to educate and not "flame" you.

Thanks,

...corey

-----Original Message-----
From: Peng Yu [mailto:pengyu.ut@...]
Sent: Monday, September 28, 2009 8:36 PM
To: icewm-user@...
Subject: Re: How to get the workspace number from the command line?

On Mon, Sep 28, 2009 at 3:11 AM, Bernd Eggink <monoped@...> wrote:

> Peng Yu schrieb:
>
>> I'm wondering if there is a way to get the workspace name from the
>> command line. This would be useful when I send an email when a program
>> finish in a terminal. Based on the workspace name, I can find out the
>> terminal more easily.
>
> This prints the workspace number:
>
>    wmctrl -d | awk '$2 == "*" { print $1 }'

I don't find wmctrl on my machine. Where can I download the source so
that I can compile it?

> If you need the workspace name, try this little script:
>
> ============================================================
> #!/bin/bash
>
> no=$(wmctrl -d | awk '$2 == "*" { print $1 }')
> line=$(grep '^WorkspaceNames=' ~/.icewm/preferences)
> IFS=,
> names=($line)
> name=${names[no]}
> name=${name#?}
> echo ${name%?}
> ============================================================
>
> Regards,
> Bernd
>
> --
> Bernd Eggink
> http://sudrala.de
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
IceWM-user mailing list
IceWM-user@...
https://lists.sourceforge.net/lists/listinfo/icewm-user



------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
IceWM-user mailing list
IceWM-user@...
https://lists.sourceforge.net/lists/listinfo/icewm-user

Re: How to get the workspace number from the command line?

by Peng Yu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Sep 29, 2009 at 8:31 AM, Hart, Corey <Corey.Hart@...> wrote:
> Peng Yu,
>
> Please try google or use your favorite search engine before posting to the mailing list.  A simple search of "wmctrl" would have gotten you exactly what you needed.  You have had multiple postings where a quick search would have yielded you exactly what you needed.
>
> The unspoken law of mailing list etiquette is to search before posting.
>
> Please understand I'm just trying to educate and not "flame" you.

I didn't know that I should use the first one. I thought the entry
"X11::WMCtrl Download - Softpedia" is relevant. I finally figured out
that it is not working. Thank you for your reply!

Regards,
Peng

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
IceWM-user mailing list
IceWM-user@...
https://lists.sourceforge.net/lists/listinfo/icewm-user

Re: How to get the workspace number from the command line?

by Peng Yu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Sep 28, 2009 at 3:11 AM, Bernd Eggink <monoped@...> wrote:

> Peng Yu schrieb:
>
>> I'm wondering if there is a way to get the workspace name from the
>> command line. This would be useful when I send an email when a program
>> finish in a terminal. Based on the workspace name, I can find out the
>> terminal more easily.
>
> This prints the workspace number:
>
>    wmctrl -d | awk '$2 == "*" { print $1 }'
>
> If you need the workspace name, try this little script:
>
> ============================================================
> #!/bin/bash
>
> no=$(wmctrl -d | awk '$2 == "*" { print $1 }')
> line=$(grep '^WorkspaceNames=' ~/.icewm/preferences)
> IFS=,
> names=($line)
> name=${names[no]}
> name=${name#?}
> echo ${name%?}
> ============================================================

I use gnome-terminal in icewm.

Under
Edit->Current Profile->Title and Command->Run a custom command instead
of my shell

I have 'ssh hostname' for "Custom command".

Under this setting, wmctrl does not work. I'm wondering if there is a
walk-around for this problem.

Regards,
Peng

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
IceWM-user mailing list
IceWM-user@...
https://lists.sourceforge.net/lists/listinfo/icewm-user

Re: How to get the workspace number from the command line?

by Keith Edmunds-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 10 Oct 2009 20:13:43 -0500, pengyu.ut@... said:

> Under this setting, wmctrl does not work. I'm wondering if there is a
> walk-around for this problem.

Probably.

Exactly how do you expect someone to give you a workaround for something
that "does not work"? When you visit your doctor, do you just sit there
and wait for his diagnosis or do you tell him what the symptoms are?

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
IceWM-user mailing list
IceWM-user@...
https://lists.sourceforge.net/lists/listinfo/icewm-user