2

I've downloaded from the USC an app that grabs colors with the mouse (result shows in the terminal) and I'm trying to add a unity launcher app to run that command in the gnome-terminal.

Here is the code:

#!/usr/bin/bash
[Desktop Entry]
Type=Application
Name=Grab Color
Exec=gnome-terminal -x grabc
Categories=Development;
Icon=/home/diogo/.local/share/applications/colorline.png

The problem is that when I click the icon the terminal opens and closes. I just want it to be open in order to see the grabbed color.

Can someone help me? :(

1

You can create a simple shell script to grab the color and copy the output to clipboard and using that in the desktop file

Here is the shell script. I have named it as grab.sh

#!/bin/bash
OUT=`grabc`
echo ${OUT} | xclip -sel clip

Change your .desktop contents

[Desktop Entry]
Type=Application
Name=Grab Color
Exec= sh /home/user/grab.sh
Categories=Development;
Icon=/home/diogo/.local/share/applications/colorline.png

This will copy the output to clipboard. You need to have xclip installed. If its not installed. Install it using command.

sudo apt-get install xclip
  • Glad that it helped you. – devav2 Nov 26 '12 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.