Swap Desktops

This weekend’s hacking efforts:

What it does:

I like to have my “workspace” in virtual desktop 1, where I have 3 emacs windows, and 4 urxvt windows (bash shells). Sometimes, however, it’s a bit of a pain to swap back and forth between client work and DedaSys work. One obvious approach is to replicate the window setup in a different virtual desktop. However, I’m used to having everything “just so”, so that I can quickly move to the desktop south of the main one to have my browser, east to get to the shells that connect to host things run on, and so on. And if I put my ‘local’ workspace on a different virtual desktop, it would screw all that up, so I wrote the above code. It utilizes the wmctl program to swap virtual desktop N with virtual desktop M, meaning it takes all windows from N, and puts them on M, and all the windows from M and puts them on N. If I have a bit more time, perhaps I’ll take a stab at the C code in wmctl and add a new option to swap virtual desktops.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s