]> git.sev.monster Git - dotfiles.git/blame - bin/dmenu_runsmart
user-dirs: fix XDG_PUBLICSHARE_DIR
[dotfiles.git] / bin / dmenu_runsmart
CommitLineData
1390d028 1#!/bin/sh
2cmd=$(dmenu_path | ~/bin/dmenu "$@")
3if [ -n "$cmd" ]; then
a58ad2f0 4 # NOTE: only tested with zsh and sh, and has issues with expansion; zsh
dcac60d9 5 # SH_WORD_SPLIT is unset by default, `=' flag is required to expand it.
6 # XXX: probably has issues with single quotes
7 # XXX: does not perform any(!) shell expansion
1390d028 8 echo "alias sudo='sudo -Ak'
9cmd='$(echo "$cmd" | sed "s/'/'\\\\''/g")'" '
10if [ -n "$ZSH_VERSION" ]; then
11 out="$(${=cmd} 2>&1)"
12else
13 out="$($cmd 2>&1)"
14fi
15code=$?
16out="$(echo "$out" | tail -n 3)"
17notify-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"}
18fi
This page took 0.038403 seconds and 4 git commands to generate.