update with binaries for bg and screenshot
authorMart Lubbers <mart@martlubbers.net>
Fri, 8 Jan 2016 13:01:01 +0000 (14:01 +0100)
committerMart Lubbers <mart@martlubbers.net>
Fri, 8 Jan 2016 13:01:01 +0000 (14:01 +0100)
misc_binaries/.local/bin/scr [deleted file]
x/.config/i3/config
x/.local/bin/bg [new file with mode: 0755]
x/.local/bin/scr [new file with mode: 0755]

diff --git a/misc_binaries/.local/bin/scr b/misc_binaries/.local/bin/scr
deleted file mode 100755 (executable)
index 0ebc22b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-set -e
-f=$(scrot -s -e 'echo $f')
-curl -s \
-       -u "ftp@martlubbers.net:$(pass ftp.martlubbers.net/ftp@martlubbers.net)"\
-       -T $f ftp://martlubbers.net/public_html/scr/$f
-echo http://martlubbers.net/scr/$f | xclip
-rm -v $f
-notify-send http://martlubbers.net/scr/$f
index ed731a8..c25afcb 100644 (file)
 set $mod Mod4
 
 # lock the screen after 10 minutes
-exec xautolock -locker 'sudo -K; echo RELOADAGENT | gpg-connect-agent; i3lock -c ccff00'
+exec xautolock -locker 'echo RELOADAGENT | gpg-connect-agent; i3lock'
 # set a background
-exec convert -size 1600x900 plasma:fractal -modulate 20,100,10 png:- | display -window root
-# set the backlight
-exec xbacklight -set 50
+exec ~/.local/bin/bg
 # set the network switcher
 exec netctltray
 
+# Toggle music playback
 bindsym Pause exec mpc toggle
+# Printscreen current window
+bindsym Shift+Print exec ~/.local/bin/scr window
+# Printscreen
 bindsym Print exec ~/.local/bin/scr
-
 # lock the screen
 bindsym $mod+l exec xautolock -locknow
-
 # put a password in the clipboard
 bindsym $mod+p exec ~/.local/bin/passmenu
 
diff --git a/x/.local/bin/bg b/x/.local/bin/bg
new file mode 100755 (executable)
index 0000000..08dbe89
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/bash
+xbacklight -set 50 || true
+convert -size "$(xrandr | grep -Po "(?<=connected )\\d+x\\d+")" \
+       plasma:fractal -modulate 20,100,10 png:- | display -window root
diff --git a/x/.local/bin/scr b/x/.local/bin/scr
new file mode 100755 (executable)
index 0000000..85bca85
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+[[ "$#" -eq 0 ]] && WINDOW=root || WINDOW="$(xdotool getwindowfocus -f)"
+URL="$(date +%F_%H-%M-%S).png"
+import -window "$WINDOW" -quality 90 png:- | curl -s\
+       -u "ftp@martlubbers.net:$(pass ftp.martlubbers.net/ftp@martlubbers.net)"\
+       -T- "ftp://martlubbers.net/public_html/scr/$URL"
+echo "http://martlubbers.net/scr/$URL" | pee \
+       "xclip -selection clipboard" "xclip"\
+       "xargs -I{} notify-send {}"