-
Notifications
You must be signed in to change notification settings - Fork 3
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
Get rid of remaining wrappers #23
Comments
I was exploring a possible solution in zsh preexec, something like this but we'd need to distinguish between different types of wrappers (or better yet, chain processing of different types of wrappers). Ie. Environment variables, additional flags, ... The implementation of the chains seems quite straight forward, but It'd be zsh-dependent. Personally, I'm okay-ish with this, but if a shell-independent solution comes by, I won't complain. Ideally I'd like something I can source, find the available binaries and wrap them (probably using functions); I wouldn't mind having zsh-magic to update the wrappers on runtime without resourcing the file (or maybe source an optimized version of it). |
And that's the main issue for me ^^ |
What about having a login hook that creates a "profile" directory containing symlinks to 'activated' wrapper scripts?. Move the wrappers into something like .local/wrappers and add .local/run/bin to $PATH ? |
Not sure if I understood that correctly, but that would only check at login time, and if any of those applications are added at runtime, I'd run into unwrapped commands? Or I would require some process or filesystem hook that is triggered and correctly adds/removes a wrapper whenever that becomes necessary—which I feel would be a little overkill. I have come to the conclusion that wrapper scripts shouldn't be necessary in the first place, as their purpose is to circumvent shortcomings of upstream, so this should be fixed there instead. A little imperfection with the handling of such (hopefully temporary) workarounds is therefore acceptable for me. I have now added a checklist to this issue (a bit like in #7) to track this progress. |
I was thinking something that checks only at llogin time, but checking at runtime with an fs hook wouldn't be a bad idea IMO I do agree that they shouldn't be necessay, but some upstream modifications will never see the light of day. As a fixup for the original problem,
We could use this to have zsh ignore the wrappers directory. It's still ugly to have such dir though :/ |
So, I was tinkering a little bit and I came up with something I feel more confortable with. It's very experimental, but does not clutter #!/bin/sh
set -x
wrap()
(
APP="$1"
read PREPEND
read INTERPOSE
read APPEND
printf "alias %s='%s \\%s %s %s'" "$APP" "$PREPEND" "$APP" "$INTERPOSE" "$APPEND"
)
eval $(wrap darktable <<- dsa
--configdir "$XDG_DATA_HOME/darktable"
dsa
)
eval $(wrap tst <<- dsa
echo
--
blabla
dsa
)
set +x Instead of I'm open to suggestions, but I kinda like the structure bellow, it makes me think of mkWrapper target <<- end
$PREPEND
$INTERPOSE
$APPEND
end |
Nice. Actually rbenv uses a similar method. Rehash regenerates a wrapper over rbenv exec. (basically We need in this case which and exec can be a single command. |
Using wrapper scripts is a really ugly workaround. On systems that don't have the wrapped programs installed (I mean...
,claws-mail
darktable
,,firefox
pidgin
on a server?) the commands still show up in the auto-complete.As this is really just workarounds for upstream fixing their software, this merits another todo-list:
claws-mail
: Sets--alternate-config-dir
toXDG_DATA_HOME/claws-mail/
[SOLVED: b7d08db]darktable
: Sets--configdir
toXDG_DATA_HOME/darktable/
[SOLVED: af3a4a2]firefox
: Have it use an alternativeHOME
directory (also decribed here: Get rid of remaining dotfile clutter in ~/ #7)[SOLVED: a7bea7f]irssi
: Has irssi (somewhat) respect the XDG basedir spec + generating the configuration with the password intoXDG_RUNTIME_DIR
through use ofpass
.mbsync
: Has mbsync useXDG_CONFIG_HOME/mbsync/mbsyncrc
.minecraft
: Has Minecraft put its data intoXDG_STATE_HOME/minecraft
.msmtp
: Has msmtp useXDG_CONFIG_HOME/msmtp/msmtprc
.pidgin
: Has pidgin useXDG_STATE_HOME/purple/
.quilt
: Has quilt useXDG_CONFIG_HOME/quilt/quiltrc
[SOLVED: ccd9c02]qutebrowser
: Adds dwb-like session handling to qutebrowser.sbt
: Has ivy2 and sbt useXDG_STATE_HOME/{ivy2,sbt}
[Bug report]sendmail
: Symlink tomsmtp
wrapper.shellcheck
: Disables a few warnings [SOLVED: fd4f786].sloccount
: Dump cache data inXDG_CACHE_HOME
and setLANG=C
because sloccount otherwise spits out all sorts of errors.sudo
: Pass-E
for launching vim (TODO: this is ugly as hell—find a better way to edit files as root).tmux
: Has tmux useXDG_CONFIG_HOME/tmux/config
.The text was updated successfully, but these errors were encountered: