Whilst I can't know that your script is running without seeing it in action, my strong suspicion is that it's running fine. You could test by adding a line that wrote to a file or similar.
Now ask yourself what you would expect to see if your script were running...
(no seriously, ask yourself this and answer it properly)
And that is the problem. If you run it from the command line, then it has a standard input and a standard output and you see the results on your terminal. When you run it from the desktop GUI, what does it have? Your script returns a value that is text but that is all. It doesn't return a window object that Gnome will display (or whatever you're using). It just returns a value that is text. Unless you're capturing that text and doing something with it, it just gets discarded.
You need to amend your script so that instead of just running and exiting, it sends the information somewhere. I would recommend using Zenity which is a very simple to use dialogue display program available on nearly all GNU/Linux distributions.
It works something like this:
Code:
zenity --info --text="Hello"
Try that. You should get an information dialogue containing the text "Hello".
So your actual bash script should be something like the below:
Code:
#!/bin/bash
INFO=$(lscpu)
echo $INFO
zenity --info --text=$INFO
Note, that wont completely work, because I think the text parameter only takes one line. You'll need to pull up the documentation for zenity and check. You might even need to write your cpu info out to a file and read it back into zenity using the text-info parameter. I don't really use Zenity so I'm not an expert. But this should get you started. Hope it helps.
EDIT: If you are simply trying to get this to run in a terminal on screen (there is possibly an option for this when you click on it on the desktop if it asks you something like "Run in Terminal - Yes / No" then there is), are you certain it's not just running and not staying on screen? Your terminal will close once the script completes and given all you're doing is querying some CPU temperatures, that's going to last about 0.2 seconds. Maybe you simply blinked and missed it. The reason it closes automatically is because that's normally what you want to happen - the script executes and finishes. If you want a terminal to open to run it in, that's normally done by, well... opening a terminal and running it. Hence why the normal approach for something like this would be to actually interact with the desktop environment by using something like Zenity.