0

I am trying to create a telnet shortcut. I cant seem to find a way to do this. Any ideas?

Alex Jones
  • 7,982
  • 9
  • 55
  • 94
Josh
  • 15
  • Assuming the telnet shortcut actually is a command, are you familiar with creating a .desktop file with a complicated command? In other words: what is the command you want to make the shortcut run? – Jacob Vlijm Aug 17 '15 at 16:22
  • Yes the shortcut is a command. All I am running is telnet so telnet server 10025. I tried to create a .desktop file. But I had no luck. did it from the GUI and SSH. – Josh Aug 17 '15 at 16:48
  • See this: http://askubuntu.com/a/527787/72216 further below, in the "complicated commands" -section. – Jacob Vlijm Aug 17 '15 at 16:58
  • 2
  • Please let me know if it actually solves the problem (or not). – Jacob Vlijm Aug 17 '15 at 17:00
  • @JacobVlijm Am I actually creating a script here? I think thats where im confused. Would I create a telnet.sh file, and then link it to the .Desktop file? – Josh Aug 17 '15 at 17:19
  • Nono, like this: Exec=/bin/bash -c "your-usual-command-to-run-telnet" should be the Exec= line. If you make the .desktop file executable, you can just double click on it to run the command inside it. – Jacob Vlijm Aug 17 '15 at 17:23
  • @JacobVlijm. I created a simple file that just has Exec=/bin/bash -c "telnet-link" and put it in a telnet.desktop file. I then did chmod +x telnet desktop. Then I ran it and it says:

    There was an error launching the application.

    – Josh Aug 17 '15 at 17:40
  • Not sure what it sais :) . Re- reading, your question is not a literal dupe. The use of the .desktop file as a standalone launcher or as a Unity launcher makes no difference however. Let me know if you manage :) – Jacob Vlijm Aug 17 '15 at 17:48
  • It doesnt seem to be working. I must be missing something. I have tried several times with the .desktop launcher. I just want to create the link so the user doesnt have to remember the string and type it in every time. – Josh Aug 17 '15 at 17:50
  • Could you post a link to the complete .desktop file you created? (We'llremove some comments afterwards). Does it need to run in a terminal btw? – Jacob Vlijm Aug 17 '15 at 17:51
  • just curious, why didn't you post your .desktop file? – Jacob Vlijm Aug 17 '15 at 19:11
  • @JacobVlijm I was getting to that but I got side tracked and saw his post first. :) The only thing that was different was under Exec I had a link to the file (/home/user/files/telnet.sh) and in users files telnet.sh was there. Which was probably my issue! – Josh Aug 17 '15 at 19:17

1 Answers1

0

Using a simple desktop file:

  • Create a new file in ~/.local/share/applications

    nano ~/.local/share/applications/telnet.desktop
    
  • Add the lines below

    [Desktop Entry]
    Name=Telnet localhost
    Comment=Telnet client
    Exec=telnet localhost
    Icon=terminal
    Type=Application
    Terminal=true
    Categories=Utility;
    StartupNotify=true
    StartupWMClass=telnet
    
  • The line Exec= …, two possibilities

    1. Exec=telnet localhost

      I'm using localhost as target host. replace localhost with your target host.

    OR

    1. Exec=/full/path/to/your/telnet_script

      Use your own script if you want, eg

      #!/bin/bash
      telnet localhost
      

      Make the script executable and add the full path to your script to the Exec= property


enter image description here

A.B.
  • 90,397
  • @JacobVlijm You mean, I should remove my answer? – A.B. Aug 17 '15 at 18:53
  • @A.B. Please dont remove it worked nicely. I was able to create it without the script. I justr executed the telnet string. As I agree it seems like its covered alot(because I probably ready every post) After spending hours trying to create it. It wa s not working.

    JacobVlijm thank you as well for your help. I consider myself a noob. But am willing to learn. Becuase who likes Windows :)

    Thanks again!!!

    – Josh Aug 17 '15 at 18:56