add dropbox screenshot script, change locker to slock

auto-flake-update
Yorick van Pelt 2013-05-18 17:55:16 +02:00
parent e6dce61f24
commit a4f962063e
3 changed files with 27 additions and 3 deletions

View File

@ -122,7 +122,7 @@ myappsmenu = {
}
-- system
mysystemmenu = {
{ "lock", function () awful.util.spawn("xscreensaver-command -lock") end },
{ "lock", function () awful.util.spawn("/home/yorick/dotfiles/bin/lock.sh") end },
{ "Suspend", "systemctl suspend" },
{ "Restart", "systemctl reboot" },
{ "Shutdown", "systemctl poweroff" },
@ -421,6 +421,7 @@ end
-- {{{ Mouse bindings
root.buttons(awful.util.table.join(
awful.button({ }, 1, function () mymainmenu:hide() end),
awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
@ -491,13 +492,15 @@ globalkeys = awful.util.table.join(
awful.util.getdir("cache") .. "/history_eval")
end),
-- locking
awful.key({ modkey, "Control", "Shift" }, "l", function () awful.util.spawn("xscreensaver-command -lock") end),
awful.key({ modkey, "Control", "Shift" }, "l", function () awful.util.spawn("/home/yorick/dotfiles/bin/lock.sh") end),
-- brightness adjustment
awful.key({ }, "XF86MonBrightnessDown", function() awful.util.spawn("/home/yorick/dotfiles/bin/brightne.sh down") end),
awful.key({ }, "XF86MonBrightnessUp", function() awful.util.spawn("/home/yorick/dotfiles/bin/brightne.sh up") end),
awful.key({ }, "XF86AudioMute", function() awful.util.spawn("/home/yorick/dotfiles/bin/mute_toggle.sh") end),
awful.key({ }, "XF86AudioLowerVolume", function() awful.util.spawn("/home/yorick/dotfiles/bin/vol_down.sh") end),
awful.key({ }, "XF86AudioRaiseVolume", function() awful.util.spawn("/home/yorick/dotfiles/bin/vol_up.sh") end)
awful.key({ }, "XF86AudioRaiseVolume", function() awful.util.spawn("/home/yorick/dotfiles/bin/vol_up.sh") end),
-- awesome screenshotness
awful.key({ modkey }, "s", function() awful.util.spawn("/home/yorick/dotfiles/bin/screenshot_dropbox.sh") end)
)
clientkeys = awful.util.table.join(

4
bin/lock.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
xset dpms 0 0 10
( sleep 1s; xset dpms force off) &
( slock && xset dpms 0 0 600 )

17
bin/screenshot_dropbox.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# Setup filename for the screenshot
myfile=$(date +%Y%m%d%S).png
#Setup paths to dropbox & full url to new screenshot
dropboxwebpath='http://dl.dropbox.com/u/22989236/temp/' # PUT YOUR DROPBOX USERID HERE
dropboxfileurl=$dropboxwebpath$myfile
# see: http://code.google.com/p/xmonad/issues/detail?id=476
sleep 0.2
# Use scrot to take a screenshot and stick it in your dropbox screenshots folder
scrot $myfile -e 'mv $f ~/Dropbox/Public/temp/' -s
# Put full URL to new screenshot into clipboard
echo $dropboxfileurl | xclip -selection c