Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.71 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. my @windows = `wmctrl -l | cut -d ' ' -f1`;
  4. my @desktops = `wmctrl -l | cut -d ' ' -f3`;
  5.  
  6. #my @windows2 = ("0x01600029","0x01400003","0x00c00126","0x0180000d","0x02000003");
  7.  
  8. my $j_atual = `xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)" | cut -d ' ' -f5`;
  9. my $d_atual = `xprop -root | grep "_NET_CURRENT_DESKTOP(CARDINAL)" | cut -d ' ' -f3`;
  10.  
  11. $j_num = @windows;
  12. $ind = "0";
  13. $g_to = @windows[$ind];
  14.  
  15. if ( $j_atual ne $g_to )
  16. {
  17.     print "ne\n";
  18.     print "Indo Para $g_to\n";
  19.     system("xdotool windowactivate $g_to");
  20.     exit;
  21. }
  22.  
  23. if ( $j_atual eq $g_to )
  24. {
  25.     print "le\n";
  26.     $ind = ++$ind;
  27.     $g_to = @windows[$ind];
  28.     print "Indo Para $g_to\n";
  29.     system("xdotool windowactivate $g_to");
  30.     exit;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement