Last active
December 26, 2015 13:49
-
-
Save rejuvyesh/7161330 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- search | |
awful.key({modkey }, "g", function() | |
awful.prompt.run({ prompt = "<span foreground='#7f9f7f'>Google Search:</span> "}, | |
promptbox[mouse.screen].widget, | |
function(input) | |
awful.util.spawn_with_shell("searchGoogle.sh " .. input) | |
end, nil | |
) | |
end), | |
awful.key({modkey }, "s", function() | |
awful.prompt.run({ prompt = "<span foreground='#7f9f7f'>Scholar Search:</span> "}, | |
promptbox[mouse.screen].widget, | |
function(input) | |
awful.util.spawn_with_shell("searchScholar.sh " .. input) | |
end, nil | |
) | |
end), | |
awful.key({modkey, "Shift" }, "g", function() | |
local f = io.popen("xsel -o") | |
local input = f:read("*a") | |
f:close() | |
awful.util.spawn_with_shell("searchGoogle.sh " .. input) | |
end), | |
awful.key({modkey, "Shift" }, "y", function() | |
local f = io.popen("xsel -o") | |
local input = f:read("*a") | |
f:close() | |
awful.util.spawn_with_shell("searchScholar.sh " .. input) | |
end), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
term=$@ | |
foo='' | |
#search with surfraw | |
sr google $term | |
#wait until the window exists and registers with the WM | |
while [ -z "$foo" ]; do | |
foo=$(wmctrl -l |grep -i "$term - Google Search") | |
sleep .5 | |
done | |
#could use wmctrl -a, but it's not always reliable in awesome with dual screens | |
wmctrl -r "$term - Google Search" -b add,demands_attention |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
term=$@ | |
foo='' | |
#search with surfraw | |
sr scholar $term | |
#wait until the window exists and registers with the WM | |
while [ -z "$foo" ]; do | |
foo=$(wmctrl -l |grep -i "$term - Scholar Search") | |
sleep .5 | |
done | |
#could use wmctrl -a, but it's not always reliable in awesome with dual screens | |
wmctrl -r "$term - Scholar Search" -b add,demands_attention |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
xmonad selectSearch and promptSearch in awesome-wm using Surfraw.