changed edit command to reflect changes in dwm
[tools.git] / edit
1 #!/bin/bash
2 # Copyright (c) 2015, 2016 Gabriel PĂ©rez-Cerezo
3 # This file is, as far as legally possible, in the public domain.
4
5 # Edit files with emacsclient. Depends heavily on special patched dwm
6 # (see https://git.gpcf.eu/dwm.git)
7
8 [ "$*" ] || { echo "$0: No files given" > /dev/stderr ; exit 1; }
9 if [ -n "$DISPLAY" ]
10 then
11 xdotool key super+e # focus emacs on screen
12 exec emacsclient --alternate-editor="" -c "$@"
13 else
14 exec emacsclient --alternate-editor="" -t -c "$@"
15 fi