diff --git a/conf.d/80_modules.fish b/conf.d/80_modules.fish new file mode 100644 index 0000000..a175ead --- /dev/null +++ b/conf.d/80_modules.fish @@ -0,0 +1,8 @@ +# List of modules to load + +set -g FISH_MODULES \ + login_x11 + +for module in $FISH_MODULES + fish_enable_module $module +end \ No newline at end of file diff --git a/functions/fish_enable_module.fish b/functions/fish_enable_module.fish new file mode 100644 index 0000000..64ff96c --- /dev/null +++ b/functions/fish_enable_module.fish @@ -0,0 +1,21 @@ +function fish_enable_module + set -l module $argv[1] + set -l dir $__fish_sysconf_dir/modules/$module + + test -d $dir + or return 1 + + if test -d $dir/functions + set -ga fish_function_path $dir/functions + end + + if test -d $dir/completions + set -ga fish_complete_path $dir/completions + end + + if test -d $dir/conf.d + for file in (path sort $dir/conf.d/*.fish) + source $file + end + end +end \ No newline at end of file diff --git a/modules/login_x11/conf.d/10_startx.fish b/modules/login_x11/conf.d/10_startx.fish new file mode 100644 index 0000000..df49f2b --- /dev/null +++ b/modules/login_x11/conf.d/10_startx.fish @@ -0,0 +1,7 @@ +# Start X automatically on tty1. + +if status is-login + and test -z "$DISPLAY" + and test "$XDG_VTNR" = 1 + exec startx +end \ No newline at end of file