Skip to content

Instantly share code, notes, and snippets.

@BinToss
Created April 30, 2026 05:06
Show Gist options
  • Select an option

  • Save BinToss/8d534f3efe4e555fef5adeb11cd03076 to your computer and use it in GitHub Desktop.

Select an option

Save BinToss/8d534f3efe4e555fef5adeb11cd03076 to your computer and use it in GitHub Desktop.
#!/usr/bin/fish
set -l desc_mods_dir "(Optional) Specify the directory to manage mods. Defaults to Rustique's mod_dir."
complete -c rustique_list_disabled -s m -l mods-dir -d "$desc_mods_dir"
function rustique_list_disabled
argparse -S h/help 'm/mods-dir=!test' -- $argv
or return
# cache the output of `rustique config list` so it is never executed more than once if at all.
set -l rustiqueConfigList ''
function __get_rustique_config_list
[ -z "$rustiqueConfigList" ] && set rustiqueConfigList "$(rustique config list)"
echo "$rustiqueConfigList"
end
# -m/--mods-dir
set -f mods_dir ''
if set -ql _flag_m
set mods_dir $_flag_m[1]
else
set mods_dir "$(grep -oP '(?<=mod_dir = ").+(?=")' ~/.config/rustique/config.toml)"
or set mods_dir "$(__get_rustique_config_list | grep -oP '(?<=mod_dir).+(?=│$)' | string trim)"
end
[ -d "$mods_dir" ]
or set_color brred && echo 'Mods directory not found or not a directory!' && return 1
set jqout "$(jq '.stringListSettings.disabledMods[]' $(realpath "$mods_dir/../clientsettings.json"))"
if string match -r '^$' "$jqout";
echo $jqout
return;
end;
echo $jqout |
sort |
grep -oE --color=never '[a-zA-Z]+@.[-0-9.a-z]+'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment