#[SOLVED] How do I create a Script/Desktop Entry?

86 messages · Page 1 of 1 (latest)

frigid stag
#

Sorry for the vague title.
I am currently trying to make a desktop executable for a program called FLASHGBX on my steam deck (in desktop mode, of course).

The official repo says to start a terminal window from within the folder it has been installed to, which for me is "/home/deck/applications/FlashGBX", then use the following commands

source FlashGBX_venv/bin/activate
python3 -m FlashGBX

which will then launch the program.

I have done this, and everything is installed properly. All I want is for a desktop link to be able to open this application without me having to manually type this every time, and that's all. Preferably, I would have so the terminal itself isn't visible while this is all happening.

Thing is I have NO IDEA how to actually do this. I'm coming from windows, and even then I can barely cobble together a .bat file. I have NO IDEA how to properly make an executable or desktop entry. Trying to search any of this up has been a headache.

ember otter
#

you will have to change the exec part

#

*might

#

since there seems to be some steps you have to take

#

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=FlashGBX
Comment=Read and write DMG/CGB/AGB cartridge data with GBxCart RW
Exec=path/to/flashgbx.sh
Icon=flashgbx
Terminal=false
Categories=Utility;

#

ok. so they can make a script that does the following, unless I am missing something here : ```bash
#!/bin/bash
cd /home/deck/applications/FlashGBX
source FlashGBX_venv/bin/activate
python3 -m FlashGBX

#

don't forget to chmod +x the script as well

#

tbh you could do this as well ```
Exec=bash -c "cd /home/deck/applications/FlashGBX && source FlashGBX_venv/bin/activate && python3 -m FlashGBX"

#

whatever floats your boat

frigid stag
ember otter
#

forget the sh for now

#

see if this work when you make the .desktop file

ember otter
#

and add the stuff listed above

#

and be sure to make it executable (chmod +x)

#

the desktop file

frigid stag
#

it does nothing

#

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=FlashGBX
Comment=Read and write DMG/CGB/AGB cartridge data with GBxCart RW
Exec=bash -c "cd /home/deck/applications/FlashGBX && source FlashGBX_venv/bin/activate && python3 -m FlashGBX"
Icon=flashgbx
Terminal=false
Categories=Utility;

ember otter
frigid stag
#

ok, where do I put this script. Just right on the desktop?

#

or like, in the flashgbx folder

ember otter
#

ideally I think you want to go into .config and make a script folder

#

and put it there

#

and then refrence it like /home/user/.conifg/scripts/flashgbx.sh

#

or whatever the file path is

#

I don't have steam deck lol

#

do you have a .config folder? @frigid stag

frigid stag
#

yeah, but the scripts folder I had to make

ember otter
frigid stag
#

There was no scripts folder in .config so I had to make one

ember otter
#

oh uhh yeah you could named that folder whatever. you just needed to make one

frigid stag
#

OK, So the .sh file is made, in the scripts folder, so now what should the .desktop file look like?

ember otter
#

or honestly stick it wherever.

#

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=FlashGBX
Comment=Read and write DMG/CGB/AGB cartridge data with GBxCart RW
Exec=path/to/flashgbx.sh
Icon=flashgbx
Terminal=false
Categories=Utility;

ember otter
#

and if you create more scripts in the future

#

be sure to paste the desktop file in here as well @frigid stag

frigid stag
#

OH! So putting that .sh file in that folder did nothing, but when placed in the flashgbx install folder it ran the program properly!

ember otter
#

woah, really?

#

nothing wrong now?

#

no errors?

frigid stag
#

ok, so now lets see if I can get the desktop file working

ember otter
#

remember to put it in ~/.local/share/applications/

#

inside the applications folder

frigid stag
#

nope, still nothing

ember otter
#

huh

#

share the contents of the desktop file

#

and the filename

#

@frigid stag

frigid stag
#

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=FlashGBX
Comment=Read and write DMG/CGB/AGB cartridge data with GBxCart RW
Exec=/home/deck/Applications/FlashGBX/flashgbx.sh
Icon=flashgbx
Terminal=false
Categories=Utility;

#

name is just gbx.desktop

ember otter
#

hmmmm

frigid stag
#

The .sh works if I go to its folder and click on it there

ember otter
#

Exec=bash -c "/home/deck/Applications/FlashGBX/flashgbx.sh"

#

try and see if that works

#

@frigid stag

frigid stag
#

nope

ember otter
#

hmm, did you chmod +x the desktop file?

#

and the script?

frigid stag
#

Both are marked under the properties>permissions tab with a checkmark on "allow executing file as program"

ember otter
#

hmmmmmmmmmm

frigid stag
#

again, sh works perfect

#

but the desktop file isnt opening it up like we want

ember otter
#

script works but the desktop file doesn't...

#

can you try chmod +x the file still? chmod +x path/to/file

#

so ig chmod +x /home/deck/Applications/FlashGBX/flashgbx.sh

#

and chmod +x ~/.local/share/applications/gbx.desktop

#

and maybe try this ```
[Desktop Entry]
Type=Application
Name=FlashGBX
Comment=Read and write DMG/CGB/AGB cartridge data with GBxCart RW
Exec=bash -c "/home/deck/Applications/FlashGBX/flashgbx.sh"
Path=/home/deck/Applications/FlashGBX
Icon=flashgbx
Terminal=false
Categories=Utility;

#

@frigid stag

frigid stag
#

THAT DID IT

#

The second one you sent did it

ember otter
#

wow

frigid stag
#

OH MY GOD

ember otter
#

lets go

frigid stag
#

Ok what was different???

ember otter
#

maybe the path variable?

frigid stag
#

oh my GOD dude thank you

ember otter
#

np

#

enjoy the games

#

have a great night/day

frigid stag
#

Lmaooo you too

hardy monolithBOT
#

#17680 📣 If there is nothing else that we can do for you, please close this thread by adding "[SOLVED]" to the title.

  • You can do this on desktop by clicking the three dots on the top right of the page, and pressing "Edit Post".
  • You can also do this on Android / iOS by long tapping your post in the text channel list, and tapping "Edit Post".

Your title should be like so: http://0x0.st/8Rt9.png
Thank you

frigid stag
#

How do I create a Script/Desktop Entry? [SOLVED]

#

whoops, sorry.