Closed mushchlo closed 4 years ago
I personally think this would be a better script idea.
You might be able to make a script with the name f
and put this in it, since dmenu supports passing args to commands.
#!/bin/sh
firefox "https://duckduckgo.com/?q=$*"
then you can do f this is what i want to search
I personally think this would be a better script idea.
You might be able to make a script with the name
f
and put this in it, since dmenu supports passing args to commands.#!/bin/sh firefox "https://duckduckgo.com/?q=$*"
then you can do
f this is what i want to search
this is much simpler and better, I'll make a full script in a sec, thanks gk!
made a small addition, sometimes I like to open with a specific web address, so I'm using
#!/bin/sh [ -z "$(echo $* | grep \\.)" ] && firefox "https://duckduckgo.com/?q=$*" || firefox "$*"
thanks gk!
Might I suggest this instead?
grep -q makes grep not output anything and just return a success or failure and exec replaces the script'd pid so if firefox fails it doesn't continue on to run firefox a second time.
#!/bin/sh
echo $* | grep -q '\.' && exec firefox "$*" ||
firefox "https://duckduckgo.com/?q=$*"
Much cleaner, thanks!
So maybe an !f bang at the beginning of a string in dmenu_run to search something in a new firefox window.