Skip to content

Instantly share code, notes, and snippets.

@Kegn
Created August 25, 2017 00:41
Show Gist options
  • Save Kegn/4e9b2bed6f19fb53bb8e35749f06fcd4 to your computer and use it in GitHub Desktop.
Save Kegn/4e9b2bed6f19fb53bb8e35749f06fcd4 to your computer and use it in GitHub Desktop.
function-pad.sh
#!/bin/bash
# authenticate over http with wget [extremely insecure, not always supported]
wauth() {
if [[-f ./cookies.txt ]]; then
wget --load-cookies cookies.txt \
-p $1
else
wget --save-cookies cookies.txt \
--post-data "user=$2&password=$3" \
$4
}
# locking i3wm with a blurry-overlay. (not using imagemagick)
ilock() {
TMPBG=/tmp/screen.png
LOCK=$HOME/lock.png
RES=$(xrandr | grep 'current' | sed -E 's/.*current\s([0-9]+)\sx\s([0-9]+).*/\1x\2/')
ffmpeg -f x11grab -video_size $RES -y -i $DISPLAY -i $LOCK -filter_complex "boxblur=5:1,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -vframes 1 $TMPBG -loglevel quiet
i3lock -i $TMPBG
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment