thunarx-python issueshttps://gitlab.xfce.org/bindings/thunarx-python/-/issues2021-01-27T19:01:53Zhttps://gitlab.xfce.org/bindings/thunarx-python/-/issues/2Setting the current working directory from a plugin2021-01-27T19:01:53ZYann BüchauSetting the current working directory from a pluginHi @all,
Thanks very much for `thunarx-python`. I am currently writing [a set of plugins](https://gitlab.com/nobodyinperson/thunar-plugins) using `thunarx-python` and everything is great so far.
But what I can't figure out is how to se...Hi @all,
Thanks very much for `thunarx-python`. I am currently writing [a set of plugins](https://gitlab.com/nobodyinperson/thunar-plugins) using `thunarx-python` and everything is great so far.
But what I can't figure out is how to set Thunar's current directory from within a plugin. For example I'd like to have a context menu entry which when clicked changes Thunar's current working directory to a specific folder.
This is what I tried:
```python
def get_file_menu_items(window, elements):
...
window.props.current_directory # contains a ThunarFile
window.get_property("current-directory") # same
window.props.current_directory = "/path" # doesn't work, needs to be a ThunarFile
window.set_property("current-directory","/path") # same
ThunarFile = window.props.current_directory.__class__
path = ThunarFile("path") # doesn't work, constructor takes no arguments
path = ThunarFile()
path.set_path("/path") # doesn't exist
window.props.current_directory = path # crashes Thunar
```
So how does one do this? :persevere:
Any help is much appreciated!https://gitlab.xfce.org/bindings/thunarx-python/-/issues/4example thunarx-menu-plugin.py does not work with Python32024-01-12T23:08:00ZRoland Müllerexample thunarx-menu-plugin.py does not work with Python3In line #17 parentheses have to be added the print statement:
print ("Doing something")
I tried to fork repository but for some reason this failed.In line #17 parentheses have to be added the print statement:
print ("Doing something")
I tried to fork repository but for some reason this failed.