-
Notifications
You must be signed in to change notification settings - Fork 625
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
Support for custom aliases and functions #97
Comments
Having support for aliases would be nice.. rofi -rnow -run-command "bash -i -c '{cmd}'" Question is how (in a portable way) does rofi know about available aliasses. |
What do you mean by portable way? Does rofi provide a config file where the path to the custom aliases file could be defined? |
I do not know how different shells handle aliases? Under bash I can get a list of aliases using: 'alias' command, maybe that is the way to go? |
As far as I know, Bash and Zsh use the same format for aliases. And these two shells are the most frequently used ones. Thus, maybe starting to support these ones first with extending it to more shells, such as Fish, in the future? |
I have added a command 'run-list-command'. This can call a list that can return a list of 'extra' commands to include in the run-dialog. |
Thanks! How can I call it? Tried:
Returns no error, neither any window. |
rofi -run-list-command "path to magic script returning aliases" -rnow You might also want adjust the -run-command to execute the result using zsh. |
I begin to understand. So, given that my aliases are stored in
However, it fails finding the alias file:
|
No. I have a script alias.sh that lists all possible commands:
This only lists aliases, but you can add a list of 'functions' too. Then I execute rofi like this:
You need to do the run-command, otherwise rofi will try to execute the command, but in case of an alias this is not possible, the 'shell' should execute it. By using the run command it will call bash, and use bash to execute it. How the exact line is for zsh I do not know. |
Note to self: With history possible duplicate entries are possible. |
Strangely this command does not find all my aliases... Example of such an alias:
Output of the awk command returns nothing:
The shell, however, is able to find the alias: |
I have no idea about zsh. You do not have to use the awk line I provided. that was just an example. |
Many thanks for your dedicated help! Finally found a zsh-compatible solution.
Function to call the menu in Openbox'
With this extra feature, rofi is close to perfect. 👍 |
happy you got it working! |
Need to fix the duplicates with history still :D |
Can you outline what you mean by possible duplicates? Haven't noticed any. |
duplicate entries. It might not be there.. but I am not 100% sure, so want to double check . |
Alright. Please let me know if I can do any testing. Robert On 07.01.2015 10:12, Dave Davenport wrote:
Sharing my passion & inspiration for #sustasty lifestyles #transitions Flying is old-school and the Co-Creator of @MindfulMeerkats www.robert.orzanna.de |
I renamed my alias Screenshot: |
It is history... do shift-del to remove the old entry. |
You are great. Thank you! |
I'm attempting to do this on bash. I've written a script:
I'm running rofi in i3wm. My command to open rofi, without the
When I press mod+d, rofi opens for a split second then crashes. First, are there any log files I can look at to find the problem or give you more information? Secondly, let me know if you know the solution offhand. |
please do not resurrect an very old bug report. |
Hi there,
I was almost able to replace dmenu with rofi except for one missing functionality.
In dmenu I can source and run custom aliases and functions. Basically, I created a file
~/.zsh_aliases
which contains all my custom aliases and functions. I am using it together with a small script that sources these aliases and functions and allows me to call them from dmenu. The advantage here is that I can also source the exactly same file in my shell rc file.What do you think about including support for custom aliases and functions into rofi and what would be the best approach to do that?
Thanks for your advice!
Robert
The text was updated successfully, but these errors were encountered: