cboxdoerfer / fsearch

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

Shortcut for "copy as text path + name" #405

Open danielkrajnik opened 2 years ago

danielkrajnik commented 2 years ago

It would be helpful if there was a shortcut to copy the path and name of a file/folder from the fsearch results. It would save switching to mouse keeping the hands on the keyboard.

On KDE's Dolphin Ctrl+Alt+C is assigned for that.

This function already exists in fsearch under right click menu "copy as text" => "path + name".

There wasn't any option to assign custom shortcuts for that in preferences menu.

I've tried "Menu" key, as well, but it didn't seem to bring up the context menu.

YMan84 commented 2 years ago

+1 on this!

In the meantime, one of the recent releases added a keyboard shortcut to open up the context menu, so you can hook into that with a bash script and xdotool . I execute the following script with a keymapper shortcut.

# Open context menu and Copy Path + Name as text.
xdotool key shift+F10
sleep .25
xdotool key Down + Down + Down + Down + Down
xdotool key Right
xdotool key Down + Down
xdotool key Enter
danielkrajnik commented 2 years ago

@YMan84 thanks, but shift+f10 didn't seem to do anything on my machine:

FSearch 0.2alpha (PPA-nightly) Ubuntu 22.04.1 LTS WM: KWin DE: KDE

cboxdoerfer commented 2 years ago

In the long term this should be covered by the custom shortcut settings, where you'll be able to assign shortcuts for practically any action in FSearch.

In the meantime I'll think about adding the shortcut manually. Are there any other file managers, other than Dolphin, which have a shortcut for copying the file path as text? So we can pick a sane default.

but shift+f10 didn't seem to do anything on my machine:

FSearch 0.2alpha (PPA-nightly)

This sounds like your FSearch package hasn't been updated in a while and might be missing the shift+f10 shortcut. The current dev builds should show: FSearch 0.3.alpha0 (PPA-nightly)

danielkrajnik commented 2 years ago

@cboxdoerfer you are right, I have add-apt-repository'd fsearch's ppa again and updated 0.3 version had shift+f10 working. Thanks

Custom shortcuts feature sounds exciting!