-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.fish
More file actions
executable file
·60 lines (47 loc) · 1.38 KB
/
run.fish
File metadata and controls
executable file
·60 lines (47 loc) · 1.38 KB
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
#!/usr/bin/env fish
# determine system operating system
set -l UNAME (uname -a)
switch $UNAME
case "*omarchy*"
set -gx SYSTEM_OS omarchy
case "*Darwin*"
set -gx SYSTEM_OS darwin
case "*Ubuntu*"
set -gx SYSTEM_OS ubuntu
end
# set global dotfiles paths
set -gx DOTFILES_DIRECTORY (pwd)
set -gx DOTFILES_OS_DISTRO_DIRECTORY $DOTFILES_DIRECTORY/os/$SYSTEM_OS
set -gx DOTFILES_OS_COMMON_DIRECTORY $DOTFILES_DIRECTORY/os/common
# set global home paths
set -gx HOME_CONFIG_DIRECTORY $HOME/.config
set -gx HOME_FISH_DIRECTORY $HOME_CONFIG_DIRECTORY/fish
# parse flags
argparse l/launcher r/reboot u/update -- $argv
or return
# set run reboot flag
if set -q _flag_reboot
set -gx RUN_DOTFILES_REBOOT true
end
# set run update flag
if set -q _flag_update
set -gx RUN_DOTFILES_UPDATE true
end
# source fish functions
set -l OS_PATHS $DOTFILES_OS_DISTRO_DIRECTORY $DOTFILES_OS_DISTRO_DIRECTORY/**/ $DOTFILES_OS_COMMON_DIRECTORY $DOTFILES_OS_COMMON_DIRECTORY/**/
for dir in $OS_PATHS
if test -d $dir
if not contains $dir $fish_function_path
set -gp fish_function_path $dir
end
end
end
run-$SYSTEM_OS-pre
run-common-pre
header-message "welcome to sethen's dot-launcher for fish shell"
if set -q _flag_launcher
dot-launcher
else
run-$SYSTEM_OS-all
end
header-message "thank you for using sethen's dot-launcher for fish shell"