budlabs / i3ass

A collection of shell scripts to ease the use of i3wm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[i3run] pass command to execute after -- instead of --command

budRich opened this issue · comments

I think this is a much better practice and eliminates some awkward quoting situations for both the user and the program.

Before:
i3run --instance irssi --command 'urxvtc -name irssi -e bash -c '\''printf "\033[5 q\r"'\'' ; irssi'

After:
i3run --instance irssi -- urxvtc -name irssi -e bash -c 'printf "\033[5 q\r" ; irssi'

--

Implement this and deprecate, --command (print a warning whenever it is used). I guess, --command will have priority till its dropped:

if [[ ${__o[command]} ]] ; then
    eval "${__o[command]}" > /dev/null 2>&1 &
elif [[ -n "$*" ]]; then
    "${@}" > /dev/null 2>&1 &
fi

something like that, notice that we also dont have to use eval with the new method, which could result in nasty stuff here..


I am also thinking that maybe we shouldn't supress stderr for the commands, at least give an option not to?
(--verbose or --silent)

implemented in #104