add some dmenu scripts, like run, calc and a window selector

auto-flake-update
Yorick van Pelt 2012-11-22 23:41:06 +01:00
parent 921a651c36
commit d7205a7469
4 changed files with 18 additions and 0 deletions

View File

@ -514,6 +514,11 @@ globalkeys = awful.util.table.join(
-- Prompt
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
-- dmenu launcher
awful.key({ modkey }, "e", function () awful.util.spawn("/home/yorick/dotfiles/bin/dlaunch.sh") end),
awful.key({ modkey }, "=", function () awful.util.spawn("/home/yorick/dotfiles/bin/dcalc.sh") end),
awful.key({ modkey }, "z", function () awful.util.spawn("/home/yorick/dotfiles/bin/dwinpick.sh") end),
awful.key({ modkey }, "x",
function ()
awful.prompt.run({ prompt = "Run Lua code: " },

4
bin/dcalc.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
dmenu_args="-fn -*-termsyn-medium-*-*-*-12-*-*-*-*-*-*-* -nb #1D1E24 -nf #8DA893 -sb #1D1E24 -sf #C18E44 $@"
xsel -o | dmenu $dmenu_args -p Calculate: | xargs echo | calc -p | dmenu $dmenu_args -p "Answer:" | xsel -i

2
bin/dlaunch.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
exec dmenu_run -fn "-*-termsyn-medium-*-*-*-12-*-*-*-*-*-*-*" -p "run: " -i -f -nb "#1D1E24" -nf "#8DA893" -sb "#1D1E24" -sf "#C18E44" $@

7
bin/dwinpick.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
dmenu_args="-fn -*-termsyn-medium-*-*-*-12-*-*-*-*-*-*-* -nb #1D1E24 -nf #8DA893 -sb #1D1E24 -sf #C18E44 $@"
winlist=`echo "local q = \"\"; for i,c in ipairs(client.get()) do q=q..c.name..\"\\n\" end; return q" | awesome-client | tail -c +12 | head -c -2`
choice=`echo "$winlist" | dmenu -i -l 7 $dmenu_args`
if [ -n "$choice" ]; then
wmctrl -a "$choice"
fi