We can open Nautilus with given directory in Terminal like:
nautilus /home/jeeeyul/workspace
However, I want to open "/home/jeeeyul" and select "workspace" and reveal it rather than open "workspace" directory. Can I do this from Terminal?
Nautilus can open the parent folder of workspace
, but includes no option to control selection.
The only possible option I can think of is xdotool
, which can emulate mouse and keyboard events within a window.
For mouse, if you can predict where the workspace
icon or list item will be located within the Nautilus window, you can open the window with specific dimensions using --geometry
, then use xdotool
to cause a mouse click at that location. If you have trouble predicting the location, you can perhaps rename workspace
to something that will appear at the top of a list, and have Nautilus sort items by name ... then rename it back after the click.
Keyboard might be a better option. You could use xdotool
to send keyboard commands and/or type things in the Nautilus window that would force the selection. You'd need to experiment as to how. (I don't know what version of Nautilus you're using, or what other files might be in that folder.)
These solutions are hardly ideal. With any luck, someone else with more in-depth knowledge of Gnome will post something exceeding clever.