salman-abedin / devour

X11 window swallower
GNU General Public License v2.0
415 stars 30 forks source link

Recognize shell aliases #3

Closed AriaMoradi closed 4 years ago

AriaMoradi commented 4 years ago
$("$@") > /dev/null 2>&1

doesn't recognize shell aliases how about this?

SHELL=$(awk -F: -v user=$USER '$1 == user {print $NF}' /etc/passwd)
echo "$@" | $SHELL -i 
AriaMoradi commented 4 years ago

and about -i, all POSIX compliant shells should have it so it's safe and portable

salman-abedin commented 4 years ago

Frankly, even though that's a great feature, I need devour to be as fast as possible as this is literally the thing that launches stuff. In fact, that's why I've kept the script as minimal as humanly possible. Running a program like awk (or any other for no dire reason) before each launch is surely gonna slow it down. But if enough people want this feature, I am willing to build it into the script so I'm gonna leave this issue open. It's not like everyone is so broke as me and runs crappy machines. lol.

AriaMoradi commented 4 years ago

this has problems if there are spaces in path names

salman-abedin commented 4 years ago

Surely that can be easily handled if the need arises for this to be merged.

taladar commented 4 years ago

I don't see the use-case where you want to hide one terminal per command but where the delay of a single awk call would matter. It is not as if you do that in a tight loop.

salman-abedin commented 4 years ago

lol. Maybe you are right and It's just my autism. I'll see what I can do to merge this successfully. No promises though. =)

salman-abedin commented 4 years ago

All done. Adding AriaMoradi as a contributor.