Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. gnome-desktop-item-edit --create-new ~/Desktop
  2.  
  3. #!/bin/bash
  4.  
  5. FORM=$(zenity --forms --title="Simple shortcut maker" --text="Create new .desktop file"
  6. --add-entry="Program Name"
  7. --add-entry="Command or path to file"
  8. --add-entry="Terminal app(true/false)"
  9. --add-entry="Icon (path)")
  10.  
  11. [ $? == 0 ] || exit 1
  12.  
  13. awk -F'|' -v home="$HOME" '{
  14. FILE = home"/Desktop/"$1".desktop"
  15. print "[Desktop Entry]" >> FILE
  16. print "Type=Application" >> FILE
  17. print "Name="$1 >> FILE
  18. print "Exec="$2 >> FILE
  19. print "Terminal="$3 >> FILE
  20. if ($4 !~ /^[ ]*$/)
  21. print "Icon="$4 >> FILE ;
  22. system("chmod 755 " FILE);
  23.  
  24. }' <<< "$FORM"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement