From 8059050aa92db9efdc05e0f56ce6341cb2eae707 Mon Sep 17 00:00:00 2001 From: candifloss Date: Tue, 21 Jul 2026 13:03:44 +0530 Subject: [PATCH] Begin adding modules --- conf.d/80_modules.fish | 8 ++++++++ functions/fish_enable_module.fish | 21 +++++++++++++++++++++ modules/login_x11/conf.d/10_startx.fish | 7 +++++++ 3 files changed, 36 insertions(+) create mode 100644 conf.d/80_modules.fish create mode 100644 functions/fish_enable_module.fish create mode 100644 modules/login_x11/conf.d/10_startx.fish 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