You are not logged in.
Pages: 1
Hello
When I double-click on a file with .py extension, it refuses to open it (with geany or vim...). But when I right-click and choose geany (or vim), it opens the file.
When I double-click, it says that I have the wrong permissions.
Thanks for help.
Offline
You need to open a terminal where the file is (make sure it is executable), and type:
python <yourfile>.py
Compare this similar thread about jar files. This is not a problem specific to Xfce.
MX-23 (based on Debian Stable) with our flagship Xfce 4.18.
Offline
thanks for the reply and sorry for my english, but you didn't understand my problem:
I don't want to execute the file when I double-click: I want to open it with geany. And thunar doesn't open it because of the permissions (whereas user and group are mine). But when I right-click and choose open it with geany, thunar open the file without any problem.
I've got the same pb if I want to open it with an other text editor.
This pb appears only with the .py files.
Thanks for help.
PS: I can execute the file in a console, but this is not my problem: I just want to open it with geany when I double-click
I'm on debian jessie.
Last edited by yanlolot (2016-10-31 00:37:27)
Offline
Have you tried the standard method already? Right-click the file > Open with > navigate to the geany entry and check the box > scroll down and check to always use it.
MX-23 (based on Debian Stable) with our flagship Xfce 4.18.
Offline
yes, I did that. But this didn't solve the problem.
Offline
Thunar execute by default the .py files.
I've tried to change this comportment with:
--> the hidden settings misc-exec-shell-scripts-by-default :
$ xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default --create --type bool --set false
$ cat .config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml
<?xml version="1.0" encoding="UTF-8"?>
<channel name="thunar" version="1.0">
<property name="last-view" type="string" value="ThunarIconView"/>
<property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_NORMAL"/>
<property name="last-window-maximized" type="bool" value="false"/>
<property name="last-separator-position" type="int" value="170"/>
<property name="last-window-width" type="int" value="1029"/>
<property name="last-window-height" type="int" value="508"/>
<property name="last-show-hidden" type="bool" value="false"/>
<property name="misc-single-click" type="bool" value="false"/>
<property name="misc-exec-shell-scripts-by-default" type="bool" value="false"/>
</channel>
But there is no effect: thunar tries to execute my .py files.
--> change the type mime: the default application for application/x-python-bytecode is geany.
No effect.
How can I change this comportment ? (Wich configuration file ?)
Thanks for help
Offline
create a thunar-custom-action,
example is "open terminal" in the configure user action or so by menu, add a new and give as execute geany %f
then apply this to files with *.py in next tab
restart thunar after safing and all should be fine with "right-clicking" on .py files
Offline
@yanlolot, what happens when you use exo-open in a terminal to open the *.py file, like:
exo-open FILE.py
...where FILE.py is the name of your py file? What is displayed in the terminal?
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
@ Toz
when I use exo-open in a terminal to open the *.py file, it opens it with geany without any problem. And the terminal displays nothing.
Offline
What is the exact wording of the error message that you are getting?
Edit: Can you also confirm the versions of Xfce and thunar that you are using?
xfce4-about -V
thunar -V
And finally, create a secondary account and log in using that account and test whether the same is happening there.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
@ToZ
-> with a new account: exactly the same pb.
-> The version of xfce and thunar
$ xfce4-about -V
xfce4-about 4.10.0 (Xfce 4.10)
$ thunar -V
Thunar 1.6.3 (Xfce 4.10)
->
What is the exact wording of the error message that you are getting?
The message is in french:
Échec à l'exécution du fichier « File.py »
L'exécution du processus fils « File.py » a échoué (Permission non accordée).
The reason of this message is that: - thunar try to execute the file and not to open it.
- this file is not authorised to be executed like a script (it's my choice, I just want to edit it with geany by double-click)
Last edited by yanlolot (2016-10-31 17:53:14)
Offline
If the following returns true or false:
xfconf-query -c thunar -p /misc-exec-shell-scripts-by-default
...then try this:
xfconf-query -c thunar -p /misc-exec-shell-scripts-by-default --type bool --set false
If that makes no difference, try resetting it:
xfconf-query -c thunar -p /misc-exec-shell-scripts-by-default -r
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
It seems to be the same command I did in post 6 ( the hidden settings misc-exec-shell-scripts-by-default ), but let's try:
$xfconf-query -c thunar -p /misc-exec-shell-scripts-by-default
false
$xfconf-query -c thunar -p /misc-exec-shell-scripts-by-default --type bool --set false
no effect.
Offline
Did you try the last one? Resetting it?
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Yes I tried the last one, and there is no effect.
Offline
Not sure what else to suggest. It works fine on my Jessie box so it must be a system-wide configuration somewhere on your system that is interfering.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Thanks for your help. I keep searching (I'll try to trace the double-click and see...)
Thanks again.
Offline
Just one question: When I do a "ps aux |grep Thunar", the output is:
Thunar --sm-client-id .....
I dont find this option ( sm-client-id) in the man of Thunar. What is this ?
Offline
It's related to session management. If you save your sessions, then thunar is saved with a session id and then re-opened later using the same session id so it can keep track of certain state items such as current folder. Look for the session information in ~/.cache/sessions.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
I've renamed the .py in .py3 to solve the pb. It works, thunar opens the .py3 with geany.
But look at this:
$ file --mime-type File.py
File.py: text/plain
$ file --mime-type File_bis.py3
File_bis.py3: text/x-python
So, the mime-type for .py file isn't python (??), and the mime-type for .py3 is python (???)
Strange isn't it ?
Last edited by yanlolot (2016-11-02 18:27:03)
Offline
Pages: 1
[ Generated in 0.016 seconds, 7 queries executed - Memory usage: 617.43 KiB (Peak: 634.71 KiB) ]