You are not logged in.
Pages: 1
Original thread: http://crunchbang.org/forums/viewtopic.php?pid=336542
Thought I'd just pop this in here, as I still use this all the time. This version is slightly different from the one in the thread linked above, in that it uses dash, not bash.
The idea here is to get the amount of time from beginning a web search to seeing the results down to as little as possible - so rather than launch a browser, wait for it to load up, navigate to the search bar or the google site or whatever, type your search query, and then wait while the results load up, this lets you instead type your search query almost instantly, and then the process of launching the browser and displaying the results is automated, and as a result just that little bit faster. I added a shortcut key (Win+G) for it in my Openbox config file for quick launching.
#!/bin/dash
gsearch="$(zenity --entry --title='Google Search' --text='Search:')"
if [ -z $gsearch ]
then
exit
else
x-www-browser "http://www.google.co.uk/search?q=$gsearch"
fi
exit
The servant lifted off a kind of ottoman a long peacock-blue drapery, rather of the nature of a domino, on the front of which was emblazoned a large golden sun, and which was splashed here and there with flaming stars and crescents. “You’re to be dressed as Thursday, sir,” said the valet somewhat affably.
Offline
Even quicker using the gmrun box instead of zenity? I have a script called "gs", so I just type "gs search terms". With just "gs" it opens the google search page.
#!/bin/bash
# Web search from gmrun box
phrase="$@"
x-www-browser "http://www.google.com/search?q=$phrase" &
exit
EDIT: I don't want this to sound like a thread-hijack though
Last edited by damo (2016-02-25 14:03:09)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
^ damo, this is just calling a script?
because gmrun has the ability to do things like that! no need for an external shell script (and btw, that should be dash, too. much faster).
just look at the default ~/.gmrunrc - it's already there. try "g:my search terms".
Offline
#!/bin/dash
In Debian, /bin/sh is already linked to /bin/dash so it may be better to simply use #!/bin/sh to increase portability (not all systems have dash installed but all systems have /bin/sh).
Offline
#!/bin/dash
In Debian, /bin/sh is already linked to /bin/dash so it may be better to simply use #!/bin/sh to increase portability (not all systems have dash installed but all systems have /bin/sh).
Ahhhhhhhh so it is good to use both: #!/bin/bash and #!/bin/sh
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Online
^ No.
#!/bin/sh and #!/bin/dash can be used interchangeably on Debian based distros.
bash has functionality that sh does not have. they are called 'bashisms'.
See this link for more info.
When you are using bashisms in a script and you put #!/bin/sh on top of the script, the script will fail.
Offline
^ damo, this is just calling a script?
because gmrun has the ability to do things like that! no need for an external shell script (and btw, that should be dash, too. much faster).
just look at the default ~/.gmrunrc - it's already there. try "g:my search terms".
Cool! I never realised that
...and I've also added
URL_d = x-www-browser 'https://duckduckgo.com/?q=%s'
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
^ No.
#!/bin/sh and #!/bin/dash can be used interchangeably on Debian based distros.
bash has functionality that sh does not have. they are called 'bashisms'.
See this link for more info.
When you are using bashisms in a script and you put #!/bin/sh on top of the script, the script will fail.
OK, sorry I didn't mean it that way. What I meant by 'both' was:
/bash for "bash" and /sh for /dash. In my noobish mind I knew what I meant to say I just didn't express myself well.
Sorry for the confusion.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Online
i try to avoid /bin/sh in my own scripts, and always specify either bash or dash, for portability.
on archlinux, bash is the default shell, but i have installed dash, too, because it's damn small & fast and thus comes handy every now and then, when a complex shell scripting language is not required.
Offline
Pages: 1