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

Install module from command line #377

Open
danielporto opened this issue Feb 20, 2020 · 1 comment
Open

Install module from command line #377

danielporto opened this issue Feb 20, 2020 · 1 comment

Comments

@danielporto
Copy link

Is it possible to install a zmodule with a command line instead of editing a file then calling update?
it would be nice to have something like:
zmodule install url bla and the zimrc file be updated ?
I know people like to annotate config files it but adding that line at the end of the file automatically might be useful.

@Zakaroo222
Copy link

Sorry, I know this is two years old, butI wrote this function (two variations of, actually) for myself to accomplish just that (I'm using OSX Ventura):

adding module from most recent contents of clipboard

zim_mod_pb() {gsed -i "$azmodule pbpaste" $ZDOTDIR/.zimrc && zimfw install}
and

adding module from string given on command line

zim_mod_cl() {gsed -i "\$azmodule $1" $ZDOTDIR/.zimrc && zimfw install}

I also wrote one for removing modules:

zim_rm() {rm -r -f $ZIM_HOME/modules/$1 && gsed -i "/$1\$/d" $ZDOTDIR/.zimrc}

I also ALSO made a MacOS shortcut for installing a module, if you'd be interested. It uses BetterTouchTools 'Get Selected Text' action, but could be modified to run with all native actions too. Hopefully this finds you well enough two years late!

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