#!/bin/sh
cmd=$(dmenu_path | ~/bin/dmenu "$@")
if [ -n "$cmd" ]; then
- # zsh SH_WORD_SPLIT is unset by default, `=' flag is required to expand
+ # NOTE: only tested with zsh and sh, and has issues with expansion; zsh
+ # SH_WORD_SPLIT is unset by default, `=' flag is required to expand it
echo "alias sudo='sudo -Ak'
cmd='$(echo "$cmd" | sed "s/'/'\\\\''/g")'" '
if [ -n "$ZSH_VERSION" ]; then
--- /dev/null
+#!/bin/sh
+
+# term lock
+if [ -z "$DISPLAY" ]; then
+ lock -npv
+ exit
+fi
+
+# xorg lock
+img=~/tmp/lock.png
+if [ -f "$img" ]; then
+ # rudimentary attempt to prevent multiple locks
+ # XXX: could block lock and replace with malicious locker
+ echo "Lock file exists at '$img', exiting"
+ exit 1
+fi
+res="$(xdpyinfo | grep dimensions | awk '{print $2}')"
+scale=0.07
+ffmpeg -y -loglevel 0 \
+ -s "$res" -f x11grab -i $DISPLAY -i ~/share/l/overlay.png \
+ -filter_complex "
+ [0]
+ scale=iw * $scale:ih * $scale,
+ noise=alls=2,
+ scale=`echo $res | tr x :`:flags=neighbor,
+ noise=alls=5,
+ gblur=8
+ [composite];
+ [composite]
+ [1] overlay=x=(main_w - overlay_w) / 2 + 0.5:
+ y=(main_h - overlay_h) / 2
+ [out]" \
+ -map "[out]" -vframes 1 "$img"
+# pause dunst
+killall -USR1 dunst
+i3lock -nefi "$img"
+rm "$img"
+killall -USR2 dunst
l() {
# TODO: use install?
- [ -L "$1" -o \! -e "$1" ] && ln -sFhvw "$x" "$1"
+ [ -L "$1" -o \! -e "$1" ] && ln -sFhvw "${2:-$x}" "$1"
}
find "$PWD/base" -depth 1 | while read -r x; do
l "$HOME/`basename "$x"`"
done
-mkdir "$HOME/bin"
-find "$PWD/bin" -depth 1 | while read -r x; do
- l "$HOME/bin/`basename "$x"`"
+mkdir "$HOME/bin" "$HOME/share" > /dev/null 2>&1
+find bin share -depth 1 | while read -r x; do
+ l "$HOME/$x" "$PWD/$x"
done
find "$PWD/xdg" -depth 1 | while read -r x; do
l "${XDG_CONFIG_HOME:-$HOME/.config}/`basename "$x"`"
done
-mkdir -p "$HOME/.urxvt/ext"
+mkdir -p "$HOME/.urxvt/ext" > /dev/null 2>&1
find "$PWD/urxvt-ext" -type f -perm -ugo=x -mindepth 1 -maxdepth 2 | while read -r x; do
l "$HOME/.urxvt/ext/`basename $x`"
done