forked from cknadler/vim-anywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall
executable file
·56 lines (44 loc) · 1.15 KB
/
uninstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#
# vim-anywhere - use Vim whenever, wherever
# Author: Chris Knadler
# Homepage: https://www.github.com/cknadler/vim-anywhere
#
# Uninstalls vim-anywhere
set -e
###
# opts
###
while getopts ":v" opt; do
case "$opt" in
v) set -x ;;
\?) echo "Invalid option: -$OPTARG" >&2 ;;
esac
done
###
# defs
###
check_installed() { hash $1 &> /dev/null; }
AW_PATH=$HOME/.vim-anywhere
DOC_PATH=/tmp/vim-anywhere
###
# uninstall
###
rm -rf $AW_PATH $DOC_PATH
# Linux uninstall
if [[ $OSTYPE == "linux-gnu" ]]; then
if check_installed gconftool; then
kbd_path=/desktop/gnome/keybindings/vim-anywhere
gconftool --unset $kbd_path/name
gconftool --unset $kbd_path/binding
gconftool --unset $kbd_path/action
else # gsettings must be installed
custom_kbd=org.gnome.settings-daemon.plugins.media-keys.custom-keybinding
kbd_path=/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/vim-anywhere/
gsettings reset-recursively $custom_kbd:$kbd_path
fi
# OSX uninstall
elif [[ $OSTYPE == "darwin"* ]]; then
rm -rf $HOME/Library/Services/VimAnywhere.workflow
fi
echo "vim-anywhere has been successfully uninstalled!"