]> git.sev.monster Git - dotfiles.git/blame_incremental - bin/dmenu_runsmart
add required/useful scripts, install.sh support
[dotfiles.git] / bin / dmenu_runsmart
... / ...
CommitLineData
1#!/bin/sh
2cmd=$(dmenu_path | ~/bin/dmenu "$@")
3if [ -n "$cmd" ]; then
4 # zsh SH_WORD_SPLIT is unset by default, `=' flag is required to expand
5 echo "alias sudo='sudo -Ak'
6cmd='$(echo "$cmd" | sed "s/'/'\\\\''/g")'" '
7if [ -n "$ZSH_VERSION" ]; then
8 out="$(${=cmd} 2>&1)"
9else
10 out="$($cmd 2>&1)"
11fi
12code=$?
13out="$(echo "$out" | tail -n 3)"
14notify-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"}
15fi
This page took 0.033879 seconds and 4 git commands to generate.