DietPi
DietPi copied to clipboard
Add dietpi aliases to Fish and change the Fish greeting
Status: Ready
Hi there! When using the Fish shell none of the dietpi scripts or functions are available through the auto-complete. I've created /etc/fish/conf.d/dietpi.fish
. This acts much like /etc/bashrc.d/dietpi.bash
. I've added all the aliases shown in the dietpi.bash and have also added the dietpi-login as the greeting.
If there is any documentation needed to be added or any extras I'm happy to add more! I think this covers all the basics I'll ever need.
Further things
The one issue I find with it is that if dietpi.bash ever changes, the dietpi.fish will also need to be updated. One way this could be mitigated is by adding /boot/dietpi/
and /boot/dietpi/funcs
to the path using
set -U fish_user_paths $fish_user_paths /boot/dietpi/
set -U fish_user_paths $fish_user_paths /boot/dietpi/funcs
instead of all the aliases. I've avoided this because this isn't what the dietpi.bash does, so I assume there's good reason! (other than to have nice names for the functions)
The next thing to do is possibly add the optional software aliases if there's need/want for them.
And that's all! Pretty simple I think and useful to at least me! :smile:
Commit list/description:
- /etc/fish/conf.d/dietpi.fish | Create aliases and add dietpi-login greeting
Many thanks for your suggestion.
dietpi-login
is not in the path and no alias created, hence it needs to be called with full path, isn't it?
/boot/dietpi/dietpi-login
instead of all the aliases. I've avoided this because this isn't what the dietpi.bash does, so I assume there's good reason!
Not all scripts are made for direct console usage, there are configuration files in these directories as well. We basically create aliases for all scripts which have a proper GUI or CLI and are meant to be used directly by end users.
To be true I'm not keen to ship a configuration file which is only used by a minority of our users to all systems 🤔. Probably we should add a shell selection/options to dietpi-software
and deploy respective configurations then for the installed one?
Is fish
definitely incompatible with bash
so that a symlink /etc/fish/conf.d/dietpi.fish => /etc/bashrc.d/dietpi.bash
does not work? Else does it have a bash
compatibility mode, like zsh
?
dietpi-login
is not in the path and no alias created, hence it needs to be called with full path, isn't it?
Ah good spot! In my testing I had added /boot/dietpi into my Fish path (5 times I must say...) which saves across sessions. Fixed!
Probably we should add a shell selection/options to
dietpi-software
and deploy respective configurations then for the installed one?
Good point! I do think adding a change shell option there would work nice for most, I assume most people who want to change shells would probably go for zsh. This could also means that https://github.com/MichaIng/DietPi/issues/180 could have a custom solution.
Is
fish
definitely incompatible withbash
so that a symlink/etc/fish/conf.d/dietpi.fish => /etc/bashrc.d/dietpi.bash
does not work? Else does it have abash
compatibility mode, likezsh
?
I don't think it has a compatibility mode, the closet thing I could find was https://github.com/edc/bass but it didn't do much... I will look into this more however, but it does feel like a "native" solution would be fastest in terms of logging in to usable terminal.
Thanks for taking the time in reading my first comment! I love DietPi :smile:
I'll mark this as closed. As said, first step would be to implement a fish install option, respectively shell selection in dietpi-software
, to then add adapted login scripts to. Same for zsh. It's hard to find the time for this. If anyone does a start, I'll be happy to assist, even if it is an install option only for a single alternative shell, without a selection menu, as a first step.
We have a wiki page about how to add new software options: https://github.com/MichaIng/DietPi/wiki/How-to-add-a-new-software-title
Request opened as a discussion, which reference to this pull request, where people can vote for it: https://github.com/MichaIng/DietPi/discussions/6118