Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Choose profile before launching GNOME Terminal emulator (See related posts)

This is a small sheel scripts that uses zenity to show a dialog that lets you choose the profile you want to use before launching a GNOME terminal window.

   1  
   2  #!/bin/sh
   3  
   4  #################################################
   5  # Simple zenity script to display a dialog from #
   6  # which to choose the profile you want for a    #
   7  # GNOME terminal you want to run.               #
   8  # (C) 2007 - Antonio Ognio <gnrfan@gnrfan.org>  #
   9  # License: GPL                                  #
  10  #################################################
  11  
  12  PROFILES=`gconftool-2 --all-dirs /apps/gnome-terminal/profiles`
  13  LIST=""
  14  for p in $PROFILES; do
  15    p=`basename $p`
  16    LIST="$LIST FALSE $p "
  17  done
  18  choosen=`zenity  --title "GNOME Terminal" --window-icon /usr/share/icons/gnome/scalable/apps/gnome-terminal.svg --text "Choose one from available profiles:" --list  --radiolist  --column "" --column "Profiles" $LIST`
  19  gnome-terminal --window-with-profile=$choosen &
  20  

You need to create an account or log in to post comments to this site.


Click here to browse all 5545 code snippets

Related Posts