Is there a way to make "Open Folder"/"Show in Filemanager" to open the filepath in terminal?
I haven't been using any file manager ever since I started using i3wm (thought I've thought about getting one) and the experience has been much better in nearly all cases
My only real issue is when I'm using some GUI program or whatever (e.g. the Brave/Firefox) and none of the open folder/show in filemanager buttons ever work, since I don't have any filemanager.
If I download something with the browser then I can't just click on the button to go to where the file is located.
So I'm just wondering if maybe there's some way to make these buttons just open the terminal and enter cd /file/path
And just for the record I don't think I want any actual terminal-based file-manager, I just want to open a fish shell in terminal
About this post
- Posted
- Archived
- Score
- 9 · 92% up
- Kind
- Text
- ID
- ytnv28
18 comments
I would:
$HOME/.local/share/applicationswithName=Open terminal in directory,Type=Application,Exec=/path/to/your/script %UandMimeType=inode/directory;. Look at existing desktop files in/usr/share/applicationsfor guidance, but I don't think you need anything other than those 4 properties.xdg-mime default <desktop-file-name> inode/directory. Use the filename with.desktopextension but without the path here.xdg-open /path/to/directoryAlternatively you can skip the script part and just put the correct command in your desktop file.
There may be some details I missed here, see man pages for xdg-mime and xdg-open for more info. All of those should be run as your normal user, in a desktop session.
This seems like what I'm looking for, but I'm just wondering about one thing.
I'm using i3wm (window manager) and afaik don't use any desktop environment, so I don't have a desktop right?
Desktop files are the way to do application launchers on linux and have no relation to what general environment you're running https://wiki.archlinux.org/title/Desktop_entries
I did exactly according to instruction (I tried several), but it still doesn't work :(
> Test with xdg-open /path/to/directory
It works great! But it works only by pressing this command, when I click button "Show in folder" it still opens in Thunar.
Do you have any ideas, what do I do incorrect? Maybe the problem in firefox/telegram?
It started to work after deleting Thunar.
Thanks, this worked perfectly.
For alacritty (the terminal I use) I just had to set the command to
Exec=alacritty --working-directory %uJust mentioning this since this was the only non-obvious part (you fully explained everything else in an easy to follow step by step process) and I just couldn't figure out what else to add after
--working-directory, turns out I wasn't supposed to add anything elseUse a file manager with easy access to the terminal. e.g.
nnnHow about Dolphin . You open it and get the terminal opened in the bottom by pressing F4.
this ^
then again a lot of people hate KDE-Tools for being supposedly "Bloated"
This is such an incredibly useful feature, also present in Kate.
pcmanfm has this feature builtin. You just need to set your terminal of choice in the preferences.
I added alacritty as the terminal emulator and I can open terminal of current folder with the button in this file manager
But when I select Show In Folder in Firefox it opens the folder in the Filemanager, not in the terminal
Interesting. My Firefox always opens folder locations in the terminal though I don't ever recall setting it to do so but I also don't use a DE so I think that has something to do with it. It must look to some default gsettings value. I would look into it further but I don't currently have my computer with me to check and I'm on my way to work. I can check when I get home if you would like me to update you with what I find.
Write a shell script and name it after a file manager's binary. Stuck it in the usual bin folder for executables.