Running a script via a desktop icon?

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
Jasper
Posts: 1686
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 716 times
Been thanked: 384 times

Running a script via a desktop icon?

Post by Jasper »

Hi there

I want to be able to place a script on my desktop and assign it an icon.

I am unsure as how I can make it executable as I need to get terminal to open and then run the script.

Can someone advise me how I can do this please?

williwaw
Posts: 1718
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 152 times
Been thanked: 311 times

Re: Running a script via a desktop icon?

Post by williwaw »

your script should run the command something like

xterm -hold -e /root/Downloads/clearRAM.sh

the hold option keeps the terminal window open until you close it, useful if there is a error reported

User avatar
Jasper
Posts: 1686
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 716 times
Been thanked: 384 times

Re: Running a script via a desktop icon?

Post by Jasper »

Hi williwaw

Thanks for sharing the tip :thumbup:

Unfortunately, it doesn't appear to run. After adding your line, I am clicking on the "OK" button to set it.

Sorry for being a pain :lol:

This is what I see when I run the script in terminal manually.

williwaw
Posts: 1718
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 152 times
Been thanked: 311 times

Re: Running a script via a desktop icon?

Post by williwaw »

sorry, its late here.

your script command should run the command script something like

xterm -hold -e /root/Downloads/clearRAM.sh

where xterm is on the first line
and the argument -hold -e /root/Downloads/clearRAM.sh is on the second.

this presumes clearRAM.sh is executable, should you actually want it to run from your downloads folder.

I would be more inclined to have the xterm -hold -e inside the clearRAM script, and locate clearRAM.sh someplace rather than your downloads folder, perhaps someplace dedicated to your scripts?

just drag a relative link from clearRAM.sh to your desktop and just click on it when you want it to run it

User avatar
mikewalsh
Moderator
Posts: 5725
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 627 times
Been thanked: 1771 times

Re: Running a script via a desktop icon?

Post by mikewalsh »

@Jasper :-

/root/my-applications/bin is a good place to put personal scripts, etc. It's a non-standard location for any other Linux distro, but for Puppy it is actually in the $PATH.

Place your script there. Having done this, then drag'n'drop the script to the desktop. I'm busy ATM, but can advise about icons later on, if necessary.

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

User avatar
Jasper
Posts: 1686
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 716 times
Been thanked: 384 times

Re: Running a script via a desktop icon?

Post by Jasper »

Thank you both for you suggestions.

I still could not get it to work. It's no big deal just a few extra clicks to action.

Post Reply

Return to “Users”