forked from GideonWolfe/Zathura-Pywal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zathura
executable file
·59 lines (49 loc) · 1.68 KB
/
zathura
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
57
58
59
#!/bin/sh
genzathurarc () {
#!/bin/sh
# Generates zathura configuration file
. $HOME/.cache/wal/colors.sh
cat <<CONF
set recolor "true"
set completion-bg "$background"
set completion-fg "$foreground"
set completion-group-bg "$background"
set completion-group-fg "$color2"
set completion-highlight-bg "$foreground"
set completion-highlight-fg "$background"
set recolor-lightcolor "$background"
set recolor-darkcolor "$foreground"
set default-bg "$background"
set inputbar-bg "$background"
set inputbar-fg "$foreground"
set notification-bg "$background"
set notification-fg "$foreground"
set notification-error-bg "$color1"
set notification-error-fg "$foreground"
set notification-warning-bg "$color1"
set notification-warning-fg "$foreground"
set statusbar-bg "$background"
set statusbar-fg "$foreground"
set index-bg "$background"
set index-fg "$foreground"
set index-active-bg "$foreground"
set index-active-fg "$background"
set render-loading-bg "$background"
set render-loading-fg "$foreground"
set window-title-home-tilde true
set statusbar-basename true
set selection-clipboard clipboard
CONF
}
# build a temporary config directory
zathura_tmp=$(mktemp -d)
# build the zathura directory
# generate a config file
echo "# temporary zathura config" > "$zathura_tmp/zathurarc"
# get original options
[ -f $XDG_CONFIG_HOME/zathura/zathurarc ] && cat "$XDG_CONFIG_HOME/zathura/zathurarc" >> "$zathura_tmp/zathurarc" || \
[ -f $HOME/.config/zathura/zathurarc ] && cat "$HOME/.config/zathura/zathurarc" >> "$zathura_tmp/zathurarc"
# add the colors
genzathurarc >> "$zathura_tmp/zathurarc"
PATH="/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/"
zathura --config-dir="$zathura_tmp" "$@" &