Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
27
rated 0 times [  27] [ 0]  / answers: 1 / hits: 4022  / 1 Year ago, tue, may 30, 2023, 11:32:12

I've added the following line to the .bashrc file:



alias midos="sh /home/erkanmdr/Belgeler/midos/midos.sh"


This command works fine in the terminal and tty.
But not working in my .desktop shortcut file.



midos.desktop file:



[Desktop Entry]
Name=MiDoS
Exec=midos
Icon=/home/erkanmdr/Belgeler/midos-128.png
Terminal=true


How do I execute my midos command in the .desktop shortcut file?


More From » .desktop

 Answers
1

While the other answers offer a good workaround for your problem, to answer your question, the right way to use an alias inside a .desktop file is, in your case:



Exec=bash -ic "midos"


That's because aliases from ~/.bashrc file will work only
in a bash interactive shell (-i option is used in this case to start bash interactive).



If another user wants to use the same .desktop file, then he must to have defined as well that alias.


[#24101] Wednesday, May 31, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oleard

Total Points: 344
Total Questions: 105
Total Answers: 113

Location: Bonaire
Member since Tue, Sep 20, 2022
2 Years ago
oleard questions
Mon, Sep 26, 22, 18:21, 2 Years ago
Mon, Nov 1, 21, 21:27, 3 Years ago
Sat, May 7, 22, 20:47, 2 Years ago
Sun, Oct 2, 22, 01:10, 2 Years ago
;