LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-27-2007, 05:54 AM   #1
hraposo
Member
 
Registered: Aug 2004
Posts: 370

Rep: Reputation: 30
Execute a script with double click of mouse?


I made a scrip:
Code:
#!/bin/bash
echo -e "\033[32m
\033[34;1;7;5m AGORA VAI CONFIGURAR O READ-WRITE DOS DISCOS... Espere um momento!
\033[0m"
echo
apt-get update
apt-get install libfuse2 fuse-utils pmount
echo 'feito'
wget http://kent.dl.sourceforge.net/sourceforge/fuse/fuse-2.6.1.tar.gz
tar zxvf fuse-2.6.1.tar.gz
cd fuse-2.6.1
./configure --prefix=/usr --sysconfdir=/etc
make
make install
wget http://www.ntfs-3g.org/ntfs-3g-1.810.tgz
tar xzvf ntfs-3g-1.810.tgz
cd /home/user/Desktop/ntfs-3g-1.810
./configure --prefix=/usr --sysconfdir=/etc
make
make install
cd..
echo "fuse" >> /etc/modules
modprobe fuse
sed -i '/sda1/ s/^/#/' /etc/fstab
echo "/dev/sda1 /media/Windows ntfs-3g defaults,silent,user,auto,umask=0,locale=pt_PT.utf8 0 0" >> /etc/fstab
umount -a
mount -a
echo
echo -e "\033[32m
\033[34;1;7;5m TERMINOU A CONFIGURAÇÃO... AGUARDE UM POUCO!
\033[0m"
echo TERMINOU A CONFIGURAÇÃO... AGUARDE UM POUCO
sleep 10
What I want is that the script runs in console with only a double click, as an executable program. Whats the commands I must put in the begin of the script for it run with a double click of mouse?
 
Old 08-27-2007, 07:32 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
If you are using KDE (Why do you not list your distro / window manager?) this is what to do:
(Your script needs to be "executable")

R-Click your desktop
Create New .... Link to application
Click the gear icon, and then choose a more appropriate one

Application Tab
In Command box put /full/path/to/yourscript

Click Advanced options
Click to "Run in terminal"
Click OK
Try it out.
 
Old 08-27-2007, 07:42 AM   #3
hraposo
Member
 
Registered: Aug 2004
Posts: 370

Original Poster
Rep: Reputation: 30
This is an hipotese!
But is not possible that the script, itself, have a command thans make its run for itself by click with the mouse on it?
 
Old 08-27-2007, 07:49 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
This is an hipotese!
????????
Quote:
But is not possible that the script, itself, have a command thans make its run for itself by click with the mouse on it?
If you just want the script to run when you double-click it in your file manager, you just need to make the script executable, like this
chmod +x your_script_name
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to execute a shell script in GUI by double click kamesh156 Programming 1 10-18-2005 05:25 AM
mouse: single-click becomes double-click kinzlaw Linux - Hardware 2 08-24-2005 07:55 PM
mouse unwanted double-click Darshbot Debian 1 10-10-2004 09:02 PM
How to get Konqueror to execute shell scripts in a new console on double click nitrambass Mandriva 0 06-22-2004 10:38 AM
Logitech First Mouse+ PS2 double click jang Linux - General 2 12-11-2002 01:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration