LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices


Reply
  Search this Thread
Old 12-30-2019, 11:19 AM   #1
doomitmayconcern
LQ Newbie
 
Registered: Feb 2019
Posts: 7

Rep: Reputation: Disabled
Is it possible to run a shell script by clicking on a file icon?


Is there a way to save a shell script in a file and then set the file up so that clicking (or double-clicking) on its icon executes the original script?

Alternatively (or perhaps additionally), is there any software available for Linux for running user-created scripts in a quick and convenient way?

At the moment I'm looking mainly for a way to open a folder window and set its size and position, although there are obviously many other useful actions that I may eventually want to set up in the same way.
 
Old 12-30-2019, 11:23 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,320

Rep: Reputation: 6026Reputation: 6026Reputation: 6026Reputation: 6026Reputation: 6026Reputation: 6026Reputation: 6026Reputation: 6026Reputation: 6026Reputation: 6026Reputation: 6026
Quote:
Originally Posted by doomitmayconcern View Post
Is there a way to save a shell script in a file and then set the file up so that clicking (or double-clicking) on its icon executes the original script?

Alternatively (or perhaps additionally), is there any software available for Linux for running user-created scripts in a quick and convenient way?

At the moment I'm looking mainly for a way to open a folder window and set its size and position, although there are obviously many other useful actions that I may eventually want to set up in the same way.
Thought you weren't going to use Linux at all, based on your last thread:
https://www.linuxquestions.org/quest...ml#post5960469

And unless you provide details, like version/distro of Linux, what desktop GUI you're using, etc., no one is going to be able to suggest much of anything for you. Past the obvious answer of "yes, you can".
 
Old 12-30-2019, 11:33 AM   #3
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,436

Rep: Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781Reputation: 1781
Quote:
Originally Posted by doomitmayconcern View Post
Is there a way to save a shell script in a file and then set the file up so that clicking (or double-clicking) on its icon executes the original script?

Alternatively (or perhaps additionally), is there any software available for Linux for running user-created scripts in a quick and convenient way?

At the moment I'm looking mainly for a way to open a folder window and set its size and position, although there are obviously many other useful actions that I may eventually want to set up in the same way.
I think you are talking about a desktop shortcut, in that case, yes you can do that. While there is a common standard for desktop shortcuts in Linux, it depends on which graphical environment you're using as to exactly how you would create the actual shortcut/desktop icon itself. You could manually type out the required syntax and save it into a .desktop file, or you could use whichever graphical environment to do it instead.

Since Puppy Linux is a "live" distribution, you would need to have persistence so that your desktop shortcut doesn't disappear when you shutdown/restart the system. Since I don't use Puppy Linux myself, it's hard for me to say much more when it comes to Puppy Linux.

You can point the "Exec=" line in the example linked below to your script.

https://wiki.archlinux.org/index.php...s#File_example
 
1 members found this post helpful.
Old 12-30-2019, 12:01 PM   #4
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware, OpenBSD
Posts: 4,039
Blog Entries: 11

Rep: Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233Reputation: 2233
Most create menus for desktop shortcuts include an entry for whether or not the program requires a terminal. For a script, answer yes.
 
Old 01-06-2020, 08:55 PM   #5
Mike_Walsh
Member
 
Registered: Jul 2017
Location: King's Lynn, UK
Distribution: Nowt but Puppies....
Posts: 424

Rep: Reputation: 225Reputation: 225Reputation: 225
@ doomitmayconcern:-

Most Pups use JWM & the ROX-Filer 'pinboard'. Easiest way to do what you want is to place the script itself into /root/my-applications/bin. Then simply drag'n'drop to the desktop.

You can dress the script up with an icon, if you wish. Google or DuckDuckGo for a suitable icon; something along the lines of 'PNG icons for xxxxx'. (PNG icons are ideal for this, since their background transparency attribute means no 'white' surround.)

Open ROX-Filer at the location of your PNG icon. Leave this window open. Right-click on your script->File'xxxxx'->Set icon. A small window opens. Drag the PNG icon you wish to use across to this small window, and drop.

It's as simple as that.

If you want your script to run automatically at boot, open one ROX-Filer window at /root/my-applications/bin, followed by a second at /root/Startup. Drag from the first, drop in the second. In the wee window that opens, you get 4 choices:-

Copy
Move
Link (relative)
Link (absolute)

No. 3's your boy - Link (relative). You've just created your first Puppy 'sym-link'.....which in Puppy, is a very powerful function.

-------------------------------

@ TB0ne:- I know, I know; I'm 'spoon-feeding'. I do so much of this on the Murga-Linux 'Puppy' forums, it kinda gets 'automatic' after a while.....

But with Pup at least, you can make the assumption that most Pups are using JWM/Rox by default. Probably less than 5% of the 5000+ 'spins'/re-masters of Pup use alternatives like XFCE or LXDE, etc.....

They're quite rare, comparatively speaking.


Mike.

Last edited by Mike_Walsh; 01-06-2020 at 09:06 PM.
 
  


Reply

Tags
automation, scripts


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script should run clicking on desktop icon on openbox beaglebone black. sd.israr@gmail.com Linux - Embedded & Single-board computer 2 01-03-2015 07:04 AM
Execute a shell script when clicking on a certain file extension antlarac Linux - Newbie 2 01-30-2013 10:55 AM
How does clicking on a desktop icon run a program ? davidbow Linux - Desktop 1 09-11-2008 03:51 AM
Launch a ncftpput script clicking on desktop icon jmanjohn61 Linux - Newbie 3 03-08-2005 01:04 AM
getting the path of a file by clicking on its icon using glade2 chaits Linux - Software 1 02-04-2004 08:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy

All times are GMT -5. The time now is 02:30 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration