cboxdoerfer / fsearch

A fast file search utility for Unix-like systems based on GTK3
GNU General Public License v2.0
3.27k stars 207 forks source link

Open files and folders with `open` on MacOS. #410

Closed DUOLabs333 closed 2 years ago

DUOLabs333 commented 2 years ago

Is your feature request related to a problem? Please describe. FSearch mostly works on MacOs with native gtk3 --- you can search, sort, etc. However, you can't open files/folders --- you get Operation not supported for the current backend. This is most likely because MacOS doesn't have desktop files.

Describe the solution you'd like Add a special case for MacOS (probably as a preprocessor macro) that hardcodes /usr/bin/open as the command to open files (folder_open_cmd doesn't work)

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

cboxdoerfer commented 2 years ago

It seems the macOS glib backend doesn't implement the launch_uris_async interface yet. I don't have a macOS system to test it, so maybe you could try the following workaround:

What happens when we always use the #else branch in this conditional on macOS? In case you're not familiar with C, you just need to replace GLIB_CHECK_VERSION(2,60,0) with 0.

Alternatively you can also remove all the lines from #if GLIB_CHECK_VERSION(2, 60, 0) up to (and including) the #else line and also the single #endif line.

DUOLabs333 commented 2 years ago

It worked (I'll just add a condition for MacOS) --- there's also the problem of file type images not showing, but I can fix that later. Do you want me to start a PR to accept this change along with some other compatibility fixes for MacOS?

cboxdoerfer commented 2 years ago

Do you want me to start a PR to accept this change along with some other compatibility fixes for MacOS?

Sure that would be great.

DUOLabs333 commented 2 years ago

411