-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwfinfo
executable file
·79 lines (65 loc) · 1.84 KB
/
wfinfo
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/fish
cd (dirname (realpath (status filename))) || exit
set script_name (basename (status filename))
count $argv >/dev/null || set no_args
argparse -n $script_name -X 0 -x 'h,q,t,g,reload-css,update-dbs' \
'h/help' \
'q/quit' \
't/trigger' \
'g/toggle-gui' \
'reload-css' \
'update-dbs' \
-- $argv
or exit
if set -q _flag_h
echo 'Usage:'
echo ' '$script_name
echo ' '$script_name' (-h | --help)'
echo ' '$script_name' (-q | --quit)'
echo ' '$script_name' (-t | --trigger)'
echo ' '$script_name' (-g | --toggle-gui)'
echo ' '$script_name' --reload-css'
echo ' '$script_name' --update-dbs'
echo
echo 'Options:'
echo ' -h, --help Print this help message and exit'
echo ' -q, --quit Quit the application'
echo ' -t, --trigger Trigger manual fissure rewards detection'
echo ' -g, --toggle-gui Toggle GUI overlay layers'
echo ' --reload-css Reload GUI styles'
echo ' --update-dbs Update relic, item and price databases'
exit
end
# Start if no args
if set -q no_args
if ! test -d .venv
python -m venv .venv
. .venv/bin/activate.fish
pip install -r requirements.txt
end
ags -b wfinfo -c ./ags/config.js
exit
end
# Exit if not running
dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames \
| grep 'com.github.Aylur.ags.wfinfo' >/dev/null || exit 0
# Quit arg
if set -q _flag_q
ags -b wfinfo -q
end
# Args just call AGS functions
function run -a fn
ags -b wfinfo -r "$fn()" >/dev/null
end
if set -q _flag_t
run trigger
end
if set -q _flag_g
run toggleGui
end
if set -q _flag_reload_css
run reloadCss
end
if set -q _flag_update_dbs
.venv/bin/python src/database.py
end