5
lorentz
5y

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

Comments
  • 0
    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.
  • 1
    It took a bit of hacking (as seen on the picture) because dmenu2 locks the keyboard, but here you go. Didn't populate it yet, just with three different use cases I wanted to test. (basic program, terminal, flatpak)
  • 0
    Tbh I think this would be far easier done in something like Python
    Perhaps a bit wordier but way easier to read and write
  • 0
    @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.
Add Comment