Re: [i3] Get list of workspaces

  • From: Anders Bo Rasmussen <fuzz@xxxxxxx>
  • To: "Discussions/Questions about the i3 window manager" <i3-discuss@xxxxxxxxxxxxx>
  • Date: Wed, 25 Jul 2012 13:31:36 +0200

Thanks. It works well using JSON::PP in perl.

My next small project to migrate is to make alt-<letter> jump to the
last selected workspace beginning with <letter> and the next workspace
beginning with letter if already on that workspace. The mechanism
therefore has to know both about workspace changes as well as key
presses. To not get too many perl modules to install all the places I
need to run i3, I think it looks like the easiest way is to have one
script monitoring workspace changes with AnyEvent::I3 and save the
changes to a file in /tmp and another script that is referenced in a
bind in .i3/config that receives the letter, reads the file in /tmp
and then select the right workspace with i3-msg. This way perl
shouldn't need to know about X.

Is there a more easy way to do this?


On Tue, Jul 24, 2012 at 2:20 PM, Michael Stapelberg <michael@xxxxxxxx> wrote:

Hi Anders,

Quoting Anders Bo Rasmussen (2012-07-24 14:07:34)
of currently available workspaces. Is there a way I can get this list?
i3-msg -t get_workspaces

And PLEASE don’t use shell to parse this. It’s SO easy to do it in any
scripting language (Perl, Python, Ruby, …).

See also http://i3wm.org/docs/ipc.html

Best regards,
Michael

Other related posts: