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

Modified to save aliases in one Flatpak specific alias file #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wilee8
Copy link

@wilee8 wilee8 commented Sep 9, 2023

I saw your project in a comment on Lemmy, and I liked the thought of making easy commands for my Flatpak applications. However, I already like putting all my aliases in a separate file from ~/.bashrc (I use ~/.bash_aliases) and then sourcing it into ~/.bashrc. So I modified your script to write all the Flatpak alias commands to one file, and then it sources that file into the shell config files if they exist.

And I also make a change to the initial flatpak command, since it wasn't working for me without specifying the columns.

@boredsquirrel
Copy link
Owner

thanks, great idea! Yes I think the column was a bug

Does this also work in fish? It has a different syntax, and its RC is stored as ~/.config/fish/config.fish (dont ask me why)

If this works, I would like to merge this

@wilee8
Copy link
Author

wilee8 commented Sep 14, 2023

I do not know if it works in fish - I hadn't even heard of fish before, and don't know how to test it. Feel free to change it to format it correctly for that. It might really break my code - it had some loops assuming that the alias line for all three shells was the same.

@boredsquirrel
Copy link
Owner

fish is a shell, an alternative to bash. It has its own syntax which kinda makes more sense, but noone uses it.

Its best use case is for general shell things, as it has autocomplete, a custom greeting, better dir display, git integration and all. When copypasting a big bash logic function thing into the terminal I just use bash.

You run the shell simply by entering "fish", switch to bash by entering "bash".

The only "problem" here is that the fish config, which I directly edit instead of placing some executeables in a directory, has a different syntax than the bash one.

So if you modify the script to outsoure the flatpak aliases to a different file, these files need to be in the right dir (for fish it would be ~/.config/fish/) and have the correct syntax. In fish its simply source FILENAME.fish.

Currently yes it writes all aliases to one file, but its very small. If you outsource this:

beginning of (bash,zsh,fish) loop:

  1. create the file in the fitting dir
  2. append the alias to that file
  3. loop breaks

add the source command to the main config

and this for the three loops so that all three shells work

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

Successfully merging this pull request may close these issues.

None yet

2 participants