Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 35 lines (30 sloc) 1.121 kB
#!/bin/sh
#
# dmenu-edit: Use dmenu to open and edit a file from a given list.
#
# Copyright 2010 Tom Vincent <http://www.tlvince.com/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Global variables:
FILES="$HOME/.config/dmenu/edit-list"
BASE="$(dirname "$(readlink -f "$0")")"
# Imports:
. "$BASE/lib/isSet.sh"
. "$BASE/lib/isTerminal.sh"
isTerminal
choice="$(tty -s && dmenu < "$FILES")"
if [[ $choice ]]; then
isSet "EDITOR" "Editor: "
$EDITOR $(eval "echo $choice") # Expand tilde XXX: can it be done w/o eval?
fi
Jump to Line
Something went wrong with that request. Please try again.