Ulauncher: Allow executing shortcuts without specifying an argument

Created on 9 Jan 2018  路  16Comments  路  Source: Ulauncher/Ulauncher

This enhancement requires changes in Preferences UI and in Python code.

Technical details

  • In UI, add a new checkbox "Run without arguments" under "Default search" checkbox
  • In Python code save that flag to the ShortcutsDb
  • When user selects a shortcut from the result list and it has "Run without arguments" flag checked, run the action
JS Python VueJS enhancement size-S

Most helpful comment

Almost done.
What do you guys think?
gifine

All 16 comments

This would be great, currently the launcher can't seem to detect my install of slick edit, (I've checked that it isn't under black listed dirs), so being able to add a shortcut for times like these without the need for specifying an argument would be great.

Unfortunately, although I do like ulauncher otherwise, without this functionality, I cannot run my scripts with ulauncher which is where it ends for me. I will check out you guys later.

Creating a minimal desktop entry really isn't that hard.

printf '[Desktop Entry]
Name=My script name
Comment=This is what my script does
Exec=command-to-run
# To use a different icon see https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html (or your icon theme)
Icon=text-x-script
Terminal=false
Type=Application' > ~/.local/share/applications/my-script-name.desktop

Having said that, I don't think this is something users should have to deal with. But at least it is a is a viable alternative if you really critically need to run custom commands without arguments. They will show in all other launchers and menu apps using desktop entries though, which may or may not not be something you want.

This seems nice.
May I do it?

@IgorMael yeah, absolutely

@IgorMael Oh yes, please! You would be my hero!

Almost done.
What do you guys think?
gifine

Nice!

One possible alternative would be to check the "Query or Script". If it contains %s it has an argument, otherwise not. Not sure this is "better" or simpler for end users, but I imagine it would be less code added and less to document and explain?

It's a bit of a "breaking" change I believe, but v5 is coming so the timing for that is good.

@IgorMael looks good to me :+1:

@friday I don't know... That would let impossible to run a script with or without argument. Currently it will replace the %s with an empty string.

That allow you, for example, check the wikipedia shortcut as run without query and it will open wikipedia main page if no query is provided.

@IgorMael @friday I would not rely on %s because that makes behavior of shortcuts harder for understanding for users. Besides, users may put a script into that box, and there we don't use %s

I'm not sure I agree, but I don't have to. Both ways are fine, and better have this feature than argue about it 馃檪

@gornostal That makes sense. Well, I made a pull request, I hope everything is okay

Thanks for the implementation @IgorMael
This feature is now available in Ulauncher 5.2.0.r0 (dev)

I'll keep the issue open until it goes to a stable release.

Thank you @IgorMael!

Released in stable channel too. Closing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Warmuser picture Warmuser  路  3Comments

altla picture altla  路  5Comments

jonhoo picture jonhoo  路  3Comments

andersfylling picture andersfylling  路  5Comments

jbriales picture jbriales  路  6Comments