pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

urukrama private pastebin - collaborative debugging tool What's a private pastebin?


Posted by sole_terminal on Mon 5 May 10:29
report abuse | download | new post

  1. #!/bin/sh
  2.  
  3. terminal_wm_class="Terminal"
  4. terminal_exec="Terminal"
  5.  
  6. # no terminal started, so start one
  7. if [ -z "`wmctrl -lx | grep Terminal`" ]; then
  8.     $terminal_exec &
  9. else
  10.     # search for existing terminals on current desktop
  11.     current_desk=`wmctrl -d | grep '*' | cut -d ' ' -f 1`
  12.     term_on_this_desk=`wmctrl -lx | grep "$current_desk[ ]*$terminal_wm_class" | cut -d ' ' -f 1`
  13.     if [ -n "$term_on_this_desk" ]; then
  14.         wmctrl -i -a $term_on_this_desk
  15.     else
  16.         # no terminals on current desktop, so just open a new one
  17.         wmctrl -x -R $terminal_wm_class
  18.     fi;
  19. fi;

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me