Add distrobox-exported executables

This commit is contained in:
Jeffrey Serio 2023-02-14 11:27:05 -06:00
parent 0b91239209
commit 7a089aca65
5 changed files with 97 additions and 1 deletions

24
emacs Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# distrobox_binary
# name: default
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
command="/bin/distrobox-enter -n default -- /bin/emacs "
for arg in "$@"; do
if echo "${arg}" | grep -Eq "'|\""; then
command="${command} \
$(echo "${arg}" | sed 's|\\|\\\\|g' |
sed 's| |\\ |g' |
sed 's|\$|\\\$|g' |
sed "s|'|\\\'|g" |
sed 's|"|\\\"|g')"
elif echo "${arg}" | grep -q "'"; then
command="${command} \"${arg}\""
else
command="${command} '${arg}'"
fi
done
eval ${command}
else
/bin/emacs "$@"
fi

2
gumssh
View File

@ -47,5 +47,5 @@ selection=$(printf "%s\n" "${logins[@]}" | gum choose --limit=1)
# If $selection is non-empty, pass it to the ssh -X command.
if test -n "${selection}"; then
ssh -X "${selection}"
autossh -M 0 "${selection}" -X
fi

24
nmap Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# distrobox_binary
# name: default_root
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
command="/bin/distrobox-enter --root -n default_root -- /bin/nmap "
for arg in "$@"; do
if echo "${arg}" | grep -Eq "'|\""; then
command="${command} \
$(echo "${arg}" | sed 's|\\|\\\\|g' |
sed 's| |\\ |g' |
sed 's|\$|\\\$|g' |
sed "s|'|\\\'|g" |
sed 's|"|\\\"|g')"
elif echo "${arg}" | grep -q "'"; then
command="${command} \"${arg}\""
else
command="${command} '${arg}'"
fi
done
eval ${command}
else
/bin/nmap "$@"
fi

24
offlineimap Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# distrobox_binary
# name: default_root
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
command="/bin/distrobox-enter --root -n default_root -- /bin/offlineimap "
for arg in "$@"; do
if echo "${arg}" | grep -Eq "'|\""; then
command="${command} \
$(echo "${arg}" | sed 's|\\|\\\\|g' |
sed 's| |\\ |g' |
sed 's|\$|\\\$|g' |
sed "s|'|\\\'|g" |
sed 's|"|\\\"|g')"
elif echo "${arg}" | grep -q "'"; then
command="${command} \"${arg}\""
else
command="${command} '${arg}'"
fi
done
eval ${command}
else
/bin/offlineimap "$@"
fi

24
wireshark Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# distrobox_binary
# name: default_root
if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then
command="/bin/distrobox-enter --root -n default_root -- /bin/wireshark "
for arg in "$@"; do
if echo "${arg}" | grep -Eq "'|\""; then
command="${command} \
$(echo "${arg}" | sed 's|\\|\\\\|g' |
sed 's| |\\ |g' |
sed 's|\$|\\\$|g' |
sed "s|'|\\\'|g" |
sed 's|"|\\\"|g')"
elif echo "${arg}" | grep -q "'"; then
command="${command} \"${arg}\""
else
command="${command} '${arg}'"
fi
done
eval ${command}
else
/bin/wireshark "$@"
fi