DZone 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

Snippets has posted 5883 posts at DZone. View Full User Profile

Choose Profile Before Launching GNOME Terminal Emulator

09.25.2007
| 6365 views |
  • submit to reddit
        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. 

#!/bin/sh

#################################################
# Simple zenity script to display a dialog from #
# which to choose the profile you want for a    #
# GNOME terminal you want to run.               #
# (C) 2007 - Antonio Ognio <gnrfan@gnrfan.org>  #
# License: GPL                                  #
#################################################

PROFILES=`gconftool-2 --all-dirs /apps/gnome-terminal/profiles`
LIST=""
for p in $PROFILES; do
  p=`basename $p`
  LIST="$LIST FALSE $p "
done
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`
gnome-terminal --window-with-profile=$choosen &