Files execution

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
mosktmp
Posts: 1
Joined: Tue Sep 08, 2020 5:53 pm

Files execution

Post by mosktmp »

Hi buddy, Is there a way to remember the execution choice of a file?
For example, by default every time I click on something like File Manager or Chromium or anything else it asks me what I want to do with it.
Is it possible to just Execute it every time?

Regards,
Connie R. Lawson
User avatar
WarHawk
Posts: 621
Joined: Thu Jul 20, 2017 8:55 am

Re: Files execution

Post by WarHawk »

add as sudo or root

Code: Select all

chmod +x 
to the file and it will make it executable
User avatar
Joulinar
Posts: 2287
Joined: Sat Nov 16, 2019 12:49 am

Re: Files execution

Post by Joulinar »

I guess the requester is running a desktop environment. And as soon as he is clicking on a desktop icon, he gets the question what to do ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
Joulinar
Posts: 2287
Joined: Sat Nov 16, 2019 12:49 am

Re: Files execution

Post by Joulinar »

ok I found where the issue is. Basically all items on Desktop are sym links to the original file and this is causing the question what to do with it every time you double click on.

Code: Select all

root@DietPi3:~# ls -la /root/Desktop/
total 12
drwxr-xr-x  2 root root 4096 Oct 16 12:21 .
drwx------ 13 root root 4096 Oct 16 13:17 ..
lrwxrwxrwx  1 root root   45 Oct 16 12:17 dietpi-config.desktop -> /usr/share/applications/dietpi-config.desktop
lrwxrwxrwx  1 root root   47 Oct 16 12:17 dietpi-launcher.desktop -> /usr/share/applications/dietpi-launcher.desktop
lrwxrwxrwx  1 root root   47 Oct 16 12:17 dietpi-software.desktop -> /usr/share/applications/dietpi-software.desktop
lrwxrwxrwx  1 root root   36 Oct 16 12:17 htop.desktop -> /usr/share/applications/htop.desktop
lrwxrwxrwx  1 root root   39 Oct 16 12:17 pcmanfm.desktop -> /usr/share/applications/pcmanfm.desktop
root@DietPi3:~#
But I found a workaround to avoid this question and to open the application strait without asking. You would need to replace the sym link with a file. This file need to contain the information about the app and where to find it. For testing, I created a 2nd dietpi-software shortcut

Code: Select all

nano /root/Desktop/dietpi-software.desktop2
Add following

Code: Select all

[Desktop Entry]
Type=Link
Name=DietPi-Software
Icon=/var/lib/dietpi/dietpi-software/installed/desktop/icons/dietpi-icon.png
URL=/usr/share/applications/dietpi-software.desktop
Save and exit the file. You now have the 2nd dietpi-software shortcut, that can be used with being ask anything :)

Some Github discussion: https://github.com/MichaIng/DietPi/issues/3833

EDIT: In meantime we found other solutions as well. So good chance to have an offical fix soon.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply