Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new keyboard shortcuts, like Ctrl+Enter to activate "Reveal in file browser" #1001

Closed
RedBearAK opened this issue Mar 2, 2021 · 10 comments

Comments

@RedBearAK
Copy link

I read the "Using Albert" instructions and I know that pressing Alt will show a menu of alternate actions, which includes "Reveal in file browser". Which is nice, but the actions to activate it are far more awkward than the equivalent in the launcher that I am used to.

The launcher that I am used to is of course, Spotlight. In macOS, I activate Spotlight with Cmd+Space, which on a Mac keyboard only requires me to move my thumb just to the left side of the space bar. Then, after using arrows if necessary to select the result, all I have to do is hold down Cmd again while hitting Enter, and instead of opening the file or application, Spotlight will instead reveal it in the Finder. I have gotten used to using this quite frequently over the last decade.

I use Kinto.sh by Ben Reaves to remap my modifier keys, so my keyboard in Linux basically acts like the Mac keyboard that I'm used to. Albert does a decent job giving me back the application launching and file searching I'm used to from Spotlight. But I'm really missing the muscle-memory functionality of quickly opening a file in place by just holding down the Cmd (Ctrl) key when hitting Enter. This also works when clicking on application or folder icons on the Dock in macOS, holding Cmd will take you to the location of the file. This is less relevant for Linux, obviously, but was quite convenient in macOS.

With Albert, I start with Alt+Space (mapped to Ctrl+Space by Kinto), but then have to move my thumb over to the Win key (Alt) and use the arrows to go down to "Reveal in file browser", then keep holding Win (Alt) so the menu doesn't disappear, and hit Enter.

I feel like all the (Alt)ernative actions on the menu could (and should) be usable via keyboard shortcuts. But at the very least Ctrl+Enter does not appear to interfere with any other existing Albert keyboard shortcut, and it's not any kind of system-wide shortcut that I'm aware of, so it shouldn't be short-circuited by the desktop environment. At least the one's that I'm familiar with.

For "Open terminal here", how about Ctrl+Shift+Enter? This also doesn't appear to conflict with anything. Although it would perhaps be more intuitive to use Ctrl+T. Or, you could use both. Different (key)strokes for different folks, eh? You already have multiple shortcuts to open Albert's preferences. Alt+comma or Ctrl+comma.

To finish off the set: Ctrl+F for "Copy [F]ile to clipboard" and Ctrl+P for "Copy [P]ath to clipboard".

If you display the keyboard shortcuts right there in the Alt menu they will be easy for users to learn quickly:

Open with default application [Enter]
Reveal in file browser [Ctrl+Enter]
Open [T]erminal here [Ctrl+T] or [Ctrl+Shift+Enter]
Copy [F]ile to clipboard [Ctrl+F]
Copy [P]ath to clipboard [Ctrl+P]

If this shortcut scheme were implemented all the (Alt)ernative actions would be instantly accessible without ever needing to move from one modifier key to another, and without needing to open the Alt menu except when you need a reminder of the available options. I think this would be a significant and appreciated enhancement to the productivity of using Albert to get things done in Linux.

Questions? Concerns? Discussion?

@RedBearAK
Copy link
Author

Just noticed that there is another (Alt)ernative action presented when the selected file is executable (but not an "application"), like an executable python script. "Execute file" is then shown between "Open with default application" and "Reveal in file browser".

There is a bit of a problem with this on my machine/setup, it pushes the "Copy path to clipboard" option off the display. It only shows if you scroll down with the arrow keys. I feel like this should be treated as a bug. I'm using the default setup of Albert with the Widget Box Model and Spotlight theme.

As part of the keyboard shortcut scheme from the first post, I suggest the shortcut of Ctrl+E or Ctrl+X for "Execute file". The first letter is [E] but [X] might be more intuitive to remember.

@ManuelSchneid3r
Copy link
Member

Not going to hardwire actions to modifiers since not all items are files and for most of them reveal makes no sense. Considering tmyour bug please send screenshots

@RedBearAK
Copy link
Author

@ManuelSchneid3r

Not going to hardwire actions to modifiers since not all items are files and for most of them reveal makes no sense.

I feel like this is something that must have a relatively simple solution for 99% of use cases, and that solution is partially implemented already due to the fact that Albert knows the difference between "applications" and other files. For results that Albert considers "applications" there is only the "Run" option displayed in the Alt menu. So Albert would already know to refuse to "Reveal in file browser" the application file, which I agree on Linux would typically make no sense. You must also be thinking of other types of non-files but I can't immediately think of any examples of those that would be relevant to the typical result list I would ever see.

Surely this function (and its shortcut) can just be applied only to regular files? Perhaps even restricted just to files in the user's home folder? Isn't that where the file search is restricted to by default anyway?

I had a thought that the shortcut keys could be displayed (in a lighter font color) on the right side of the result box, showing the user which (Alt)ernative actions are actually available (relevant) for each result. Like, for an executable python file, you'd see this on the right side of the box: X ^↵ T F P.

Let's say for the sake of argument we abandon the idea of copying Spotlight and instead use Ctrl+R for "Reveal". Then it could be even simpler, and very intuitive: X R T F P. A non-executable normal file would just show: R T F P, since the "Execute" action would not apply. Albert already knows this.

You could even make the letters clickable (for those who love to use the mouse) or allow the user to choose one by selecting the item with up-down and then selecting an alternative action via left-right arrow keys. This is analogous to the hidden Alt menu except the available options are always visible.

Obviously for result items that don't have alternative actions available, nothing would be displayed. Thus telling the user that those actions are not relevant.

I really feel you're not giving this idea a fair shake. It could make Albert feel far more smoothly powerful for actually doing what the user wants quickly. And for me, I know that means frequently wanting to actually go to where a file is, or open a terminal at that location, and I want a quick keyboard method for doing that. I doubt that I would be alone in finding that very helpful.

Considering tmyour bug please send screenshots

Executable file (Alt) menu only showing five items at a time:

alt_menu_cutuff1

Scrolling down to reveal last item, the first item "Open with" disappears at the top:

alt_menu_cutuff2

@ManuelSchneid3r
Copy link
Member

ManuelSchneid3r commented Mar 2, 2021

Ssh hosts, snippets, bookmarks, hashes, dates, units, translations, any kind of online resources... Every item which is not a result of the files or locate extension. There are dozens of them.

Seriously maybe you are into cryptic usage patterns but most people like intuitive uis.

Still I agree on effectivity. Maybe mnemonics (actually pretty good idea since is plays well with the following) . Or even another feature request "sort actions by usage" may help you. But not this letters in search box. Also the first action should be removed, since it's not alternative. Future work.

Screenies: I see. well there is a scroll bar, how do you handle hundreds of actions then?

@RedBearAK
Copy link
Author

@ManuelSchneid3r

Well, stupidly like any noob I keep thinking of Albert as primarily a Spotlight replacement, since it was the closest I could find to the user experience I’ve been used to in macOS for many years. I keep forgetting that it is actually far more extensible to do other things besides finding files and launching applications.

But, this gets back to what I was saying before, which is, doesn’t Albert already understand that the common alternative actions I’m talking about adding as default shortcuts don’t apply to all those “not a file” examples?

Obviously no application can ever have simple keyboard shortcuts available for every possible action it can perform. In my ignorance I was thinking we’re talking about just the few primary actions that the average person using a desktop environment would want to use when interacting with their files. I know there are a lot of more advanced power users of Albert but I am coming at it from the perspective of the basic usefulness of Spotlight.

@RedBearAK
Copy link
Author

@ManuelSchneid3r

Accidentally submitted before I meant to. Continuing.

Screenies: I see. well there is a scroll bar, how do you handle hundreds of actions then?

Yeah, I was thinking about 12 actions would be the maximum possible number of alternative actions. Hundreds or even dozens is sort of an alien concept to me at the moment. If that’s possible, isn’t that really getting into territory where scrolling is already a less-than-optimal solution? The Alt menu would need its own search field for that to be efficient.

I thought that it would be reasonable to expect at least seven to ten actions always be visible on the menu, if there are that many relevant to the item. “They” say most people can handle seven choices before getting overwhelmed, so that seems like a good minimum to show before resorting to scrolling.

Also the scroll bar on my UI was virtually invisible, and may have actually been invisible entirely before I started scrolling. Which is a development in many modern UIs that I have long had a distaste for. It creates situations where it is very difficult to tell visually that there is any additional content below the end of the window.

Seriously maybe you are into cryptic usage patterns but most people like intuitive uis.

I would disagree that having the Alt action menu hidden away unless I happen to try the Alt key or read the user instructions is an “intuitive” UI. I have a bias toward things being visible and therefore more easily discoverable with reading the user manual. I mean, there is reason you keep the preferences “gear” icon visible in the corner of the query box, right? Even though it also has two keyboard shortcuts available?

I don’t know what cryptic usage patterns you’re referring to. I’m literally just trying to replicate the basic functions of Spotlight. Which is, search for files, launch applications, open file locations. And while Albert is a pretty good launcher because of its ability to learn, Spotlight works a little more fluidly out of the box due to grouping applications first by default. I have not discovered a way to prioritize applications before other results in Albert yet. Albert kind of has similar “categories” of results corresponding to the activated plugins, but with Spotlight you can customize the order of the returned result groups. But by default it shows matching applications first so it tends to be a very quick launcher right off the bat. In Albert, “Applications” is only at the top of the plugin list because it’s alphabetically first. Unless I’m missing something, as usual.

Still I agree on effectivity. Maybe mnemonics (actually pretty good idea since is plays well with the following) . Or even another feature request "sort actions by usage" may help you. But not this letters in search box.

Can you expand on this? Is it like what I just described with re-ordering Spotlight categories? That would be very welcome.

Also the first action should be removed, since it's not alternative. Future work.

I would agree with that. Seems redundant.

@RedBearAK
Copy link
Author

@ManuelSchneid3r

Is it at least possible to add "hooks" into Albert so that I could assign keyboard shortcuts to the most common (Alt)ernative action menu options? Or is there a way to assign keyboard shortcuts to these functions without changing any code in Albert?

Other than changing the primary hotkey, I don't see any command-line options for telling Albert what action to take. So I don't see a way to assign a custom keyboard shortcut via my DEs keyboard shortcuts preferences app.

@ManuelSchneid3r
Copy link
Member

#502 vote it

@RedBearAK
Copy link
Author

@ManuelSchneid3r

#502 vote it

I threw a like at it, but it seems to be more about using alternative keyboard shortcuts for moving around, to avoid needing to use the arrow keys. That seems only peripherally related to my idea of being able to assign shortcuts to specific common file-related actions so that the (Alt) menu wouldn't even need to be opened most of the time.

Am I right in thinking that if someone were to add key bindings for things like "Reveal in file browser", it would need to be implemented within the Files plugin, since that is where those file-specific actions originate?

@stale stale bot added the Stale Stale issue, closing soon. label Mar 6, 2022
@stale stale bot closed this as completed Sep 4, 2022
@stale stale bot removed the Stale Stale issue, closing soon. label Sep 4, 2022
@albertlauncher albertlauncher deleted a comment from stale bot Oct 8, 2022
@ManuelSchneid3r
Copy link
Member

@RedBearAK I try to get stuff done. This issue is somewhat vague and contains several issues. Please open new ones for other ideas besides the ctrl+enter. I appreciate your time but please keep it concise. I have to skim through dozens of issue with spare time

I'll close this one because i see no concrete solution. Each ext has its own alternative actions. I cant hardcode modifiers (especially not to specific actions) since this issue is also subject to #502 and #499.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants