Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Moments after posting I've realised that this would execute lines where the command would contain the chosen option, so if I were to add something like "term", every line that contains i3-sensible-terminal would run, one after the other. Now it's sorta fixed. Don't use grep unless you want exactly what it does, I guess.
I love awk, btw. -
Tbh I think this would be far easier done in something like Python
Perhaps a bit wordier but way easier to read and write -
@RememberMe I disagree, the second version is as readable as it gets knowing that awk manipulates columns, dmenu lets me choose one of the input lines and sh executes a command. The main reason why I think this is that there's nothing quite like awk for python, so I would inevitably have to write loops, which is a lot of unnecessary information.
Related Rants
I decided to try shell scripting by making myself a nice configurable menu using dmenu that I can add commands to and that isn't cluttered with desktop entries. Worked suprisingly well tbh
random
shell scripting
bash
dmenu