summaryrefslogtreecommitdiff
path: root/bin/debian-ftp-master-cut-note
blob: 435ba9c894430d8fdca75d9a4bdbd3d301c53dc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# note this script may not work if triggered using a keybinding that
# involves a modifier key, because the script will run before the
# modifier key has been released (the first 'sleep' ought to mitigate
# this problem at least somewhat)

set -e

emacsclient -eval '(with-current-buffer "*NEW notes*"
                         (gui-set-selection nil (buffer-string))
                         (erase-buffer))'
# select this window ready for processing the next package
wmctrl -a "ftp-master GNU mc session"
sleep 0.2
wmctrl -a "ftp-master dak command session"
sleep 0.2
xdotool getactivewindow mousemove --window %1 --polar 0 0 click 2