-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlule_colors
executable file
·46 lines (43 loc) · 1.47 KB
/
lule_colors
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
#sent color sequences to all ppts (most important piece of this script)
colors_to_tty(){
for tt in /dev/pts/*; do
re='^[0-9]+$'; [[ $(basename $tt) =~ $re ]] && cat $HOME/.cache/wal/sequences > $tt;
done
}
colors_to_tty &
#apply all colors (or specific command) to nvim needs 'pip install neovim-remote' and 'lsof'
colors_to_nvim(){
if command -v nvr &> /dev/null ; then
for i in `pidof nvim`; do
for e in `lsof -p "$i" | grep LISTEN | awk -v N=$9 '{print $9}'`; do
nvr --nostart --servername $e -c ":lua mycolors(\"$(cat $HOME/.cache/wal/theme)\")" &
done
done
else
1>&2 printf "executable nvr is not fond in your \$PATH, install it with 'pip install neovim-remote'\n"
fi
}
# colors_to_nvim &
run_hooks() {
if [ -d $XDG_CONFIG_DIR/lule/hooks ]; then
for hook in `find $XDG_CONFIG_DIR/lule/hooks -type f`; do
echo Running "$hook"
$hook;
done
elif [ -d ~/.config/lule/hooks ]; then
for hook in `find ~/.config/lule/hooks -type f`; do
echo Running "$hook"
$hook;
done
elif [ -d /usr/share/lule/generators ]; then
for hook in `find /usr/share/lule/generators -type f`; do
echo Running "$hook"
$hook;
done
else
echo "No hook directory found";
fi
}
run_hooks &
#apply all colors to firefox needs 'pip install pywalfox'
# python $HOME/.local/bin/pywalfox update &