summaryrefslogtreecommitdiff
path: root/util/convert_keys.sh
blob: 3c33e70a16c16958ba455de95eab31d22ad89cb3 (plain)
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
#!/bin/bash


declare -A map

INPUT="$XDG_CONFIG_HOME/dwb/keys"
[ "$1" ] && INPUT="$1"


map=(
[open_url]=Open 
[tabopen]=open_nv 
[tabopen_url]=Open_nv 
[winopen]=open_nw 
[winopen_url]=Open_nw 
[tab_hist_back]=history_back_nv
[tab_hist_forward]=history_forward_nv
[win_hist_back]=history_back_nw 
[win_hist_forward]=history_forward_nw
[hints]=hint_mode
[hints_tab]=hint_mode_nv
[hints_win]=hint_mode_nw
[hints_links]=hint_mode_links
[hints_images]=hint_mode_images
[hints_images_tab]=hint_mode_images_nv
[hints_editable]=hint_mode_editable
[hints_url]=hint_mode_url
[hints_url_tab]=hint_mode_url_nv
[hints_download]=hint_mode_download
[hints_clipboard]=hint_mode_clipboard
[hints_primary]=hint_mode_primary
[hints_rapid]=hint_mode_rapid
[hints_rapid_win]=hint_mode_rapid_nw
[tab_bookmarks]=bookmarks_nv
[win_bookmarks]=bookmarks_nw
[quickmark]=open_quickmark
[tab_quickmark]=open_quickmark_nv
[win_quickmark]=open_quickmark_nw
[start_page]=open_start_page
[tab_new]=add_view
[close_tab]=remove_view
[focus_tab]=focus_nth_view
[tab_paste]=past_nv
[win_paste]=paste_nw
[tab_paste_primary]=paste_primary_nw
[win_paste_primary]=paste_primary_nv
[new_tab]=new_view
[new_win]=new_window
)

for key in ${!map[@]}; do 
  sed -i "s/${map[$key]}/$key/" "${INPUT}"
done