]> git.sev.monster Git - dotfiles.git/blame - bin/dmenu_runsmart
add screen lock `l', `share' dir, install.sh edit
[dotfiles.git] / bin / dmenu_runsmart
CommitLineData
f29cd560 1#!/bin/sh
2cmd=$(dmenu_path | ~/bin/dmenu "$@")
3if [ -n "$cmd" ]; then
de6b1600 4 # NOTE: only tested with zsh and sh, and has issues with expansion; zsh
5 # SH_WORD_SPLIT is unset by default, `=' flag is required to expand it
f29cd560 6 echo "alias sudo='sudo -Ak'
7cmd='$(echo "$cmd" | sed "s/'/'\\\\''/g")'" '
8if [ -n "$ZSH_VERSION" ]; then
9 out="$(${=cmd} 2>&1)"
10else
11 out="$($cmd 2>&1)"
12fi
13code=$?
14out="$(echo "$out" | tail -n 3)"
15notify-send -t 10000 -u $([ $code != 0 ] && echo normal || echo low) -a ' "'$(basename $0)'" ' "${cmd}$([ $code != 0 ] && echo \: $code)" "$out"' | SUDO_ASKPASS=~/bin/dpass ${SHELL:-"/bin/sh"}
16fi
This page took 0.034973 seconds and 4 git commands to generate.