Сделал себе прожку. Передавать параметром номер приложения. 1 - самое последнее запущенное (отображается последним на панели), и т.д.
Сильно не пинать, я только учусь.
/*
* ctl.cpp
*
* Created on: 20.04.2011
* Author: vl
*/
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <cstdlib>
#include <string.h>
int main(int argc, char *argv[])
{
if(argc < 2)
return -1;
char test[256][256];
char finded[256][256];
char *cmd = "wmctrl -l";
int count = atoi(argv[1]);
int i = 0;
char buf[BUFSIZ];
FILE *ptr;
if ((ptr = popen(cmd, "r")) != NULL)
{
while (fgets(buf, BUFSIZ, ptr) != NULL)
{
strcpy(&test[i][0],buf);
if(strstr(test[i],"-1") == NULL)
{
strcat(&finded[i][0],"wmctrl -i -a");
strncpy(&finded[i][12],buf,10);
++i;
}
}
pclose(ptr);
system(finded[i-count]);
std::cout << finded[i-count];
}
return 0;
}