Executable script can't run directly from desktop in Arch Linux
If that isn't working then you can create a .desktop
file for your script. It would look something like this:
# $Id: vbox-starter.desktop 22 $
[Desktop Entry]
Name=Custom Virtualbox Starter
GenericName=VBox
Comment=VBox
Exec=VBoxSDL --startvm virtualmachine
Terminal=true
Type=Application
Icon=Virtualbox
Categories=GNOME;GTK;Utility;
Note that since your script contains only one single line, you can put that directly in the Exec
value:
Exec=VBoxSDL --startvm virtualmachine
In case you, your script was very long with multiple lines of code, then just put it this way:
Exec=~/Desktop/myscript
Related videos on Youtube
Comments
-
Mas Bagol over 1 year
Before, I was using Linux Mint and I can run bash script directly from desktop just with
chmod
the script to executable. For example, I have a script like this:#!/bin/bash VBoxSDL --startvm virtualmachine
then:
chmod +x myscript
In desktop. I just need to double click the script that I've created.
Now, I'm using Arch Linux with gnome-shell. The same way doesn't work. Instead, double clicking only runs text editor. Right click, too, show only gvim editor to launch the script and open with other applications option which doesn't have run script directly. So, how can I launch the script directly from desktop environtment without terminal?
-
TomTom about 9 yearsYou probably need to have an entry in your right click context menu that runs the script. In XFCE that is fairly easy, you just create an action, but I don't know about GNOME.
-
don_crissti about 9 yearsThis has nothing to do with gnome-shell or your text editor (or archlinux), it's a file manager feature. In
nautilus
Preferences > Behavior > checkRun executable text files when they are opened
. -
Matthias almost 5 yearsIf you're using GNOME 3, see the solutions on this question: askubuntu.com/questions/138908/…
-
-
Mas Bagol about 9 yearsdoesn't work. I've tried that
-
Mas Bagol about 9 yearsBut, what I'm asking is about launching script, not desktop entry.
-
shivams about 9 yearsPerhaps Arch Linux doesn't support running scripts by double clicking. I don't really know. Never used it. But this solution does solve your problem. Moreover, your script is just one line of code, you can just put it in
Exec
part above. -
shivams about 9 yearsWhich windows manager and desktop manager are you running, btw?
-
Mas Bagol about 9 years
gdm
andgnome3
-
shivams about 9 yearsWell, did this solution work for you? : askubuntu.com/questions/138908/…
-
Mas Bagol about 9 yearsNot working. Maybe I should stik with desktop entry file