3

I am working on Blender recently, but the problem turns up when I set up the desktop icon file. Sometimes I need Blender to open with a terminal, but most time is "no it is not useful". Although I can open a terminal and type blender to do so, but it is not convince, I think. What I want is a desktop/launcher icon with a "Open with terminal" item. I find a tutorial on help.ubuntu, and here is my desktop file(an action is added):

#!/usr/bin/env xdg-open

[Desktop Entry]
Name=Blender
GenericName=3D modeler
Comment=3D modeling, animation, rendering and post-production
Keywords=3d;cg;modeling;animation;painting;sculpting;texturing;video editing;video tracking;rendering;render engine;cycles;game engine;python;
Exec=blender %f
Icon=blender
Terminal=false
Type=Application
Categories=Graphics;3DGraphics;
MimeType=application/x-blender;
Name[en_US]=Blender

Actions=with_terminal

[Desktop Action with_terminal]
Name=Open-With-terminal
Exec=blender %f
Terminal=true
OnlyShowIn=Unity;

But actually, when I click on the right click list, the program start but no terminal was opened. For a detail description, here are my pictures(Sorry I cannot show a picture, but superlinks in my question for less reputations). enter image description here

Also, I want a customized icon not only in my launcher but on my desktop as well. enter image description here

In short, there are two problems:

  1. Why the terminal not turn up from the right click action?

  2. Can I customize the right click item on my desktop?

muru
  • 197,895
  • 55
  • 485
  • 740
  • @MohamedSlama the terminal turns up if Terminal set to true, but do you read my requirement? I do not want the terminal if I click the main button. Also the extra right click list don't have my customized item if these lines are commented. – Page David Jun 01 '16 at 12:28
  • check this answer how to create blender .desktop file http://askubuntu.com/a/455266/464430 – Mohamed Slama Jun 01 '16 at 12:42
  • @MohamedSlama sorry, I may don't catch your idea properly, do you mean I should change exec on line 8? So where will be my add on action? – Page David Jun 01 '16 at 12:45
  • @MohamedSlama yeah, but I installed blender with adding a PPA, in order to update convinced. So my blender may not in /opt , and I can run blender in terminal without cd to the directory. also, I am not asking how to create the desktop file, but to customize it with a Open-with -terminal item. – Page David Jun 01 '16 at 12:53
  • @Mohamed Slama er...we may have misunderstanding between us, I sorry to my poor English, but please wait for a while to explain what I need on earth, hope not bother you lot. – Page David Jun 01 '16 at 12:56
  • Hi David, posted my answer. Please mention if you manage. – Jacob Vlijm Jun 01 '16 at 13:04
  • 1
    @MohamedSlama So let me tell my story. I found I can develop game in blender with Python programs, I am fond of Python as well you know. But I found if I want to debug the python file, the terminal is needed(or the error info would not show ) , so every time I need to open the terminal and type blender, and the blender will be launched with a terminal behind it. But some time, I would try model some small objects, so my game would not be too ugly. Then, you will find if I need the terminal , the shortcut on desktop would not be used, so I need a extra item in right click list. – Page David Jun 01 '16 at 13:09
  • @DavidPage you can check this answer or "Jacob Vlijm" answer may solving your problem http://askubuntu.com/a/34598/464430 – Mohamed Slama Jun 01 '16 at 13:20
  • 1
    @MohamedSlama yeah this is what I need, thank you. ...oh, he is just below my question, HAHAHA. – Page David Jun 01 '16 at 13:23

1 Answers1

1

These are actually two questions, but here we go:

  1. In a .desktop file, usually, combining Terminal=false and Terminal=true is not working out well. Most of the time, only one works well, the one in the "main" command. Alternatively, set for the command:

    Exec=gnome-terminal -e <command>
    

    In this case:

    Exec=gnome-terminal -e blender
    
  2. For your second issue, adding right-click option to the icon on your desktop: I do not have a Blender- specific solution, but you can create a small script:

    #!/bin/bash
    gnome-terminal -e blender
    

    Save it as Blender_wterminal (no extension) in

    ~/.local/share/nautilus/scripts
    

    Create the directory if it does not exist yet. Make the script executable. Subsequently, you might have to log out/in.

    Then, on right- click on any icon on your desktop, choose scripts > Blender_wterminal will open Blender in the terminal.

    enter image description here

Jacob Vlijm
  • 83,767