2

I am working on a desktop shortcut for my users that will ask for a password and decrypt all files in a specific directory. I am using Ubuntu 20.04. I have a .desktop file written:

[Desktop Entry]
Name=Decrypt Files
Exec=gnome-terminal --working-directory="/home/user/Desktop/Encrypted Files" -- ccrypt -d `ls`
Terminal=False
Icon=utilities-terminal

The .desktop file is located in the users' ~/Desktop directory, and has been made executable with chmod +x decryptfiles.desktop. But this file does nothing when clicked on. There is no option to 'allow launching' when right clicked.

How do I create a desktop icon which launches a terminal program in Ubuntu 20.04?

I have a test environment that I can use graphical applications to test, but for the final product I can only work in a terminal. This is because I am using Cubic to create a custom .iso.

  • 1
    Change your line of Terminal=False to Terminal=True to have it run in the terminal. – Terrance Jun 15 '21 at 00:35
  • @Terrance This answer says different. gnome-terminal takes care of that. – ambitiose_sed_ineptum Jun 15 '21 at 03:52
  • Fair enough, but it appears as you have missed adding ;$SHELL to the end of your command to keep the terminal open. – Terrance Jun 15 '21 at 13:06
  • @Terrance Thank you for your concern, but I am well aware of how the commands I have are supposed to run. My only question is in regards to how to get the .desktop file to run when clicked. – ambitiose_sed_ineptum Jun 15 '21 at 14:27
  • Doing the chmod +x will make it run. It probably is running, but happening so fast it closes and doesn't appear to do anything. You will need to maybe add a second command at the end that maybe echos out the date and time to a log file so that you know that it ran. Also, adding the ;$SHELL will allow you to see if it actually ran properly. – Terrance Jun 15 '21 at 14:31
  • @Terrance. I tried your solution, it did not work. Again, I know how the commands I am using work. If I run the command directly in terminal, a new terminal window opens, prompts the user for the password to decrypt the files, then decrypts them and closes.

    The desktop file does not run at all, that is my only question.

    – ambitiose_sed_ineptum Jun 15 '21 at 14:40
  • 3
    Actually, I think that you are missing some stuff in your desktop file. I just created one and have a couple of lines that you are missing. I removed them from mine as a test and it did not run until the lines were added back. You are missing Version=1.0 and Type=Application, which if you look in your linked answer those lines are there as well. – Terrance Jun 15 '21 at 14:44
  • Did @Terrance’s solution work for you? If so, please let us know, and Terrance should post his solution as an “Answer” which you can accept. If it didn’t work, please edit your question and include what you tired, so folks can suggest a different approach. – Enterprise Jul 09 '21 at 19:12

0 Answers0