OSDN Git Service

remove pacdiff (for now)
[instantos/instantOS.git] / programs / instanthotkeys
1 #!/bin/bash
2
3 # Show a list of available key bindings
4
5 dlbinds() {
6     if checkinternet; then
7         curl -s 'https://raw.githubusercontent.com/instantOS/instantos.github.io/master/youtube/hotkeys.md' |
8             sed 's/^\([^|#]\)/    \1/g' |
9             sed 's/^##*[ ]*/ /g' >~/.cache/instantos/hotkeys.md
10     else
11         cp /usr/share/instantutils/keybinds .cache/instantos/hotkeys.md
12     fi
13 }
14
15 if ! [ -e ~/.cache/instantos/hotkeys.md ]; then
16     mkdir -p ~/.cache/instantos
17     dlbinds
18 fi
19
20 cat ~/.cache/instantos/hotkeys.md >/tmp/hotkeys
21
22 # allow user to add to the list
23 if [ -e ~/.config/instantos/hotkeys ]; then
24     echo "user generated notes: 
25 " >>/tmp/hotkeys
26     cat ~/.config/instantos/hotkeys >>/tmp/hotkeys
27 fi
28
29 dlbinds &
30
31 # optional GUI mode
32 if [ -z "$1" ]; then
33     less --mouse --wheel-lines=3 /tmp/hotkeys
34 else
35     sed 's/^/>/g' </tmp/hotkeys | instantmenu -c -l 35 -fn "Fira Code Nerd Font:pixelsize=13" -bw 3
36 fi