Mobian .desktop file creation
#1
I'm trying to write a temporary installer for a program I'm working on, and none of the .desktop files I have created have shown up on Phosh on Mobian
I've tried:

~/.local/share/applications/
and
/home/mobian/.local/share/applications

as locations for the .desktop files, and it *still* doesn't show up..

I've made desktop files before on Manjaro Phosh, and didn't have any of these struggles, any help would be appreciated, i've been working on this for hooooooours @_@
  Reply
#2
Since those paths looks okay could you paste what is inside your .desktop file Smile?
  Reply
#3
#!/bin/bash
[Desktop Entry]
Type=Application
NoDisplay=false
Version=0.1.9
Type=Application
Terminal=true
Exec=/home/mobian/MyWaydroidManager/MyWaydroidManager.py
X-Purism-FormFactor=Workstation;Mobile;
Name=My Waydroid Manager
Comment=Manage Waydroid installations easily
Icon=/home/mobian/MyWaydroidManager/icons/icon.svg
Categories=utility
(07-20-2023, 01:14 PM)alaraajavamma Wrote: Since those paths looks okay could you paste what is inside your .desktop file Smile?
  Reply
#4
(07-20-2023, 03:05 PM)MadameMalady Wrote: #!/bin/bash
[Desktop Entry]
Type=Application
NoDisplay=false
Version=0.1.9
Type=Application
Terminal=true
Exec=/home/mobian/MyWaydroidManager/MyWaydroidManager.py
X-Purism-FormFactor=Workstation;Mobile;
Name=My Waydroid Manager
Comment=Manage Waydroid installations easily
Icon=/home/mobian/MyWaydroidManager/icons/icon.svg
Categories=utility

Remove the bin bash Smile
  Reply
#5
(07-20-2023, 03:24 PM)alaraajavamma Wrote:
(07-20-2023, 03:05 PM)MadameMalady Wrote: #!/bin/bash
[Desktop Entry]
Type=Application
NoDisplay=false
Version=0.1.9
Type=Application
Terminal=true
Exec=/home/mobian/MyWaydroidManager/MyWaydroidManager.py
X-Purism-FormFactor=Workstation;Mobile;
Name=My Waydroid Manager
Comment=Manage Waydroid installations easily
Icon=/home/mobian/MyWaydroidManager/icons/icon.svg
Categories=utility

Remove the bin bash Smile
I've tried that too and I didn't have luck Sad
Here's the whole option in the script, maybe i'm messing something up..?


if [ $(hostname) = 'mobian' ]; then
 
  notify-send "My Waydroid Manager" "Check Your Terminal"
 
  # copy application directory
  cd ..
  sudo mkdir -p /home/mobian/MyWaydroidManager
  sudo cp My_Waydroid_Manager.py /home/mobian/MyWaydroidManager
  sudo cp -r icons /home/mobian/MyWaydroidManager
  sudo cp -r scripts /home/mobian/MyWaydroidManager
  cd  ~/.local/share/applications/
  sudo touch MyWaydroidManager.desktop
  echo "#!/bin/bash
[Desktop Entry]
Type=Application
NoDisplay=false
Version=0.1.9
Type=Application
Terminal=true
Exec=/home/mobian/MyWaydroidManager/MyWaydroidManager.py
X-Purism-FormFactor=Workstation;Mobile;
Name=My Waydroid Manager
Comment=Manage Waydroid installations easily
Icon=/home/mobian/MyWaydroidManager/icons/icon.svg
Categories=utility">MyWaydroidManager.desktop

 
 
this option is in a directory called scripts, since the program is in 'scripts' when this option is ran, I have it cd .. back up a directory to start.
  Reply
#6
The #!/bin/bash definitely does not make sense, use #!/usr/bin/xdg-open or #!/usr/bin/env xdg-open or no #! at all.
  Reply
#7
(07-21-2023, 07:32 AM)Kevin Kofler Wrote: The #!/bin/bash definitely does not make sense, use #!/usr/bin/xdg-open or #!/usr/bin/env xdg-open or no #! at all.

Tried without any shebang at all (still no luck at all) , what's xdg-open do? / what/s xdg?
  Reply
#8
Code:
[Desktop Entry]
Version=0.1.9
Name=My Waydroid Manager
Comment=Manage Waydroid installations easily
Exec=/home/mobian/MyWaydroidManager/MyWaydroidManager.py
Icon=/home/mobian/MyWaydroidManager/icons/icon.svg
Terminal=true
Type=Application
X-Purism-FormFactor=Workstation;Mobile;

Try if this works. Also make sure that you have written the file name correctly like mywaydroidmanager.desktop
  Reply
#9
(07-21-2023, 10:22 AM)alaraajavamma Wrote:
Code:
[Desktop Entry]
Version=0.1.9
Name=My Waydroid Manager
Comment=Manage Waydroid installations easily
Exec=/home/mobian/MyWaydroidManager/MyWaydroidManager.py
Icon=/home/mobian/MyWaydroidManager/icons/icon.svg
Terminal=true
Type=Application
X-Purism-FormFactor=Workstation;Mobile;

Try if this works. Also make sure that you have written the file name correctly like mywaydroidmanager.desktop
I ended up putting the X-purism line right after the icon like, but that worked, thanks!
now to figure out how to prevent it from making the buttons smaller bc it opened the terminal first.. ?

So, that does make the icon show up correctly, but it doesn't run any of the commands in the opened terminal bc it's read-only, is that related at all or a different issue?
  Reply
#10
xdg-open opens a document with the document opening tool provided by your desktop environment. (xdg stands for "Cross-Desktop Group".) This works for files such as word processor documents or spreadsheets, but also for .desktop files. So if you want to make the .desktop file executable as a script, that is the tool for it. But there is generally no need to make .desktop files directly executable at all.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  bookworm vs trixie discussion for mobian in pinephone pro. zetabeta 14 1,870 Today, 05:40 AM
Last Post: diederik
  Disable the GDM service in Mobian. mburns 0 467 11-25-2023, 10:19 PM
Last Post: mburns
  The Mobian Phosh Experience mburns 1 889 11-18-2023, 08:21 AM
Last Post: crocspot
  "failed to start simple desktop display manager" PinePhonePro / Plasma Beta15 RC4 OhMeadhbh 1 657 11-09-2023, 07:39 AM
Last Post: mburns
  Fix the Mobian Weather App mburns 0 500 11-07-2023, 10:01 AM
Last Post: mburns
  Megapixels on Mobian Bookworm on PinePhone Pro - Not Launching X0X0X0X0X0 1 710 11-07-2023, 09:44 AM
Last Post: mburns
  Mobian Phosh Gnome Software Is Recommending A Broken Update. mburns 0 602 10-14-2023, 11:57 AM
Last Post: mburns
  Mobian libnotify custom notifications MadameMalady 5 1,404 08-01-2023, 08:51 AM
Last Post: MadameMalady
  XFCE mobian running nicely but some oddities grump_fiddle_reinstall 0 804 07-01-2023, 08:18 AM
Last Post: grump_fiddle_reinstall
  [Mobian] : Battery consumption and OS compatibility freelectro 2 1,082 06-02-2023, 06:55 AM
Last Post: Fred Zyphal

Forum Jump:


Users browsing this thread: 1 Guest(s)