OSDN Git Service

131bc47f94cbf6be55ec6e342557d28a21927675
[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     fi
11 }
12
13 if ! [ -e ~/.cache/instantos/hotkeys.md ]; then
14     mkdir -p ~/.cache/instantos
15     dlbinds
16 fi
17
18 cat ~/.cache/instantos/hotkeys.md >/tmp/hotkeys
19 dlbinds &
20
21 # optional GUI mode
22 if [ -z "$1" ]; then
23     less --mouse --wheel-lines=3 /tmp/hotkeys
24 else
25     cat /tmp/hotkeys | sed 's/^/>/g' | instantmenu -c -l 35 -fn "Fira Code Nerd Font:pixelsize=13" -bw 3
26 fi