diff --git a/README.md b/README.md index a34a59e..c4bc9a7 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ # TKG-Installer 🐸 -#### Commandline tool to assist with the installation and configuration of the powerful TKG packages from the repositories of the [Frogging-Family](https://github.com/Frogging-Family). +#### All-in one build of the powerful TKG packages from the repositories of the [Frogging-Family](https://github.com/Frogging-Family). -##### Thanks to their flexible configuration and powerful settings functions, TKG packages can be precisely tailored to different systems and personal requirements. +##### Thanks to their flexible configuration and powerful settings, TKG packages can be precisely tailored to different systems and personal preferences. ##### I've been using this script successfully for quite a while—maybe it will help you too! @@ -20,16 +20,12 @@ ## Features -- **Dual Mode Operation**: Use either an interactive `fzf`-menu or fast direct `command-line` mode. -- **Advanced Package Configuration**: This script can create and manage external configuration files for all TKG packages and tools. -- **Multi-Distro Support**: Works seamlessly on Arch-based systems and most other Linux distributions support by the Frogging-Family. +- **Dual-Mode**: Use either an interactive `fzf` menu or a fast, direct command-line mode. +- **Manage `customization.cfg`**: Create, edit, and compare `customization.cfg` files. +- **Multi-Distribution**: Works seamlessly on Arch-based systems and on most other Linux distributions supported by the Frogging-Family. [![tkginstaller-fzf](images/fzf.png)](images/fzf.png) [![tkginstaller-fzf2](images/fzf2.png)](images/fzf2.png) -[![tkginstaller-fzfconfig](images/config.png)](images/config.png) -[![tkginstaller-linuxdirect](images/linux.png)](images/linux.png) -[![tkginstaller-winedirect](images/wine.png)](images/wine.png) -[![tkginstaller-protondirect](images/proton.png)](images/proton.png) --- @@ -97,6 +93,7 @@ > - **`fzf`**: Powers the interactive menu. > - **`glow`**: For preview markdown files in the terminal. > - **`nano`, `micro`, `vim`, etc.** The script uses the `$EDITOR` environment variable. +> - **`wdiff`** For comparing `customization.cfg` files. #### Individual TKG packages have their own dependencies: [https://github.com/Frogging-Family](https://github.com/Frogging-Family) diff --git a/docs/clean.md b/docs/clean.md index 89efc0c..5001c9f 100644 --- a/docs/clean.md +++ b/docs/clean.md @@ -1,4 +1,4 @@ -## 🧹 TKG-Installer - Cleaning +## TKG-Installer - Cleaning --- diff --git a/docs/exit.md b/docs/close.md similarity index 97% rename from docs/exit.md rename to docs/close.md index 32ff2a5..f9ec53a 100644 --- a/docs/exit.md +++ b/docs/close.md @@ -1,4 +1,4 @@ -## 👋 TKG-Installer - Exit +## TKG-Installer - Close --- diff --git a/docs/config.md b/docs/config.md index 6ceabfe..201687a 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1,4 +1,4 @@ -## 🛠️ TKG-Installer - Config menu +## TKG-Installer - Config menu --- diff --git a/docs/help.md b/docs/help.md index fc67c8e..2cfb917 100644 --- a/docs/help.md +++ b/docs/help.md @@ -1,4 +1,4 @@ -## ❓ TKG-Installer - Help +## TKG-Installer - Help --- diff --git a/docs/linux.md b/docs/linux.md index 2a21499..7ccc108 100644 --- a/docs/linux.md +++ b/docs/linux.md @@ -1,4 +1,4 @@ -## 🧠 Linux-TKG ─ Custom Linux kernels +## Linux-TKG ─ Custom Linux kernels --- diff --git a/docs/mesa.md b/docs/mesa.md index dd378b0..ce13fb3 100644 --- a/docs/mesa.md +++ b/docs/mesa.md @@ -1,4 +1,4 @@ -## 🧩 Mesa-TKG ─ Open-Source graphics driver for AMD and Intel +## Mesa-TKG ─ Open-Source graphics driver for AMD and Intel --- diff --git a/docs/nvidia.md b/docs/nvidia.md index 1a1ec26..4f80206 100644 --- a/docs/nvidia.md +++ b/docs/nvidia.md @@ -1,4 +1,4 @@ -## 🖥️ Nvidia-TKG ─ Open-Source or proprietary graphics driver +## Nvidia-TKG ─ Open-Source or proprietary graphics driver --- diff --git a/docs/proton.md b/docs/proton.md index 4f9e8bd..a78a735 100644 --- a/docs/proton.md +++ b/docs/proton.md @@ -1,4 +1,4 @@ -## 🎮 Proton-TKG ─ Windows compatibility layer for Steam / Gaming +## Proton-TKG ─ Windows compatibility layer for Steam / Gaming --- diff --git a/docs/return.md b/docs/return.md index 9e5224c..383f919 100644 --- a/docs/return.md +++ b/docs/return.md @@ -1,4 +1,4 @@ -## ⏪ Return - Exit editor menu +## Return - Exit editor menu --- diff --git a/docs/wine.md b/docs/wine.md index 8c44c7a..9fbdbdd 100644 --- a/docs/wine.md +++ b/docs/wine.md @@ -1,4 +1,4 @@ -## 🍷 Wine-TKG ─ Windows compatibility layer +## Wine-TKG ─ Windows compatibility layer --- diff --git a/tkginstaller.sh b/tkginstaller.sh index e2f7f59..6dd9c7d 100755 --- a/tkginstaller.sh +++ b/tkginstaller.sh @@ -57,7 +57,7 @@ # shellcheck disable=SC2218 # Allow usage of printf with variable format strings # TKG-Installer VERSION definition -export _tkg_version="v0.22.5" +export _tkg_version="v0.22.6" # Lock file to prevent concurrent execution of the script export _lock_file="/tmp/tkginstaller.lock" @@ -245,13 +245,17 @@ __msg_pkg() { local _pkg_name="${1:-TKG package}" local _config_url="${2:-${_frog_repo_url}}" - __msg_info "${_break}${_green_neon}${_uline_on}NOTICE:${_uline_off}${_reset}${_green_light} customization.cfg${_reset}${_break}" - __msg_plain " A wide range of options are available." - __msg_plain " Thanks to their flexible configuration and powerful settings functions, TKG packages" - __msg_plain " can be precisely tailored to different systems and personal requirements." - __msg_plain " The${_gray} customization.cfg${_reset} files can be set up using a short setup guide via the interactive menu or with${_reset}${_gray} ‘tkginstaller ${_pkg_name,,} config’${_reset}." - __msg_plain " The tool then offers you the option to make the adjustments in your preferred text editor." - __msg_plain " Please make sure to adjust the settings correctly." + __msg_info "${_break}${_green_neon}${_uline_on}NOTICE:${_uline_off}${_reset}${_green_light} Create, edit, and compare${_gray} customization.cfg${_reset}${_green_light} files${_reset}${_break}" + __msg_plain " A wide range of options are available!" + __msg_plain " Thanks to their flexible configuration and powerful settings, TKG packages" + __msg_plain " can be precisely tailored to different systems and personal preferences.${_break}" + __msg_plain " The${_gray} customization.cfg${_reset} files can be set up by using a short process:" + __msg_plain " 1) ${_gray} Interactive menu -> Config -> ${_pkg_name,,}" + __msg_plain " 2) ${_gray} tkginstaller ${_pkg_name,,} config${_break}" + __msg_plain " The file(s) are saved in the ${_gray} ~/.config/frogminer/${_reset} directory according to the standard specifications." + __msg_plain " Once the setup is complete, the configs are immediately ready to be edited and compared" + __msg_plain " The tool offers the option to make the adjustments in your preferred text editor." + __msg_plain " ${_uline_on}Please make sure to adjust the settings correctly.${_uline_off}" __msg_plain " Refer to the${_gray} customization.cfg${_reset} documentation for detailed configuration options." __msg_plain " Location:${_reset}${_gray} ${_config_url}" } @@ -370,7 +374,7 @@ __prepare() { local _dep=(git onefetch) if [[ "$_load_preview" == "true" ]]; then # Add optional dependencies for interactive mode - _dep+=(bat curl glow fzf) + _dep+=(bat curl glow fzf wdiff) fi # Define package names per distro for missing dependencies installation mapping @@ -381,6 +385,7 @@ __prepare() { [glow]=glow [fzf]=fzf [onefetch]=onefetch + [wdiff]=wdiff ) # Set install command based on detected Linux distribution @@ -402,6 +407,7 @@ __prepare() { [glow]=app-text/glow [fzf]=app-misc/fzf [onefetch]=app-misc/onefetch + [wdiff]=app-text/wdiff ) _install_cmd_dep="emerge" ;; @@ -555,9 +561,8 @@ __fzf_menu() { local _header_text="$3" # Header text (string) local _footer_text="$4" # Footer text (string) local _border_label_text="${5:-$_tkg_version}" # Border label text (string, optional) - local _preview_window_settings="${6:-right:nowrap:60%}" # Preview window settings (string, optional) - # Fuzzy finder key bindings for preview toggle and config edit (open) - local _fzf_bind="ctrl-p:toggle-preview" + local _preview_window_settings="${6:-right:wrap:60%,right:wrap:90%}" # start: 60%, then 90%, then hidden + local _fzf_bind="${7:-ctrl-p:toggle-preview}" # Key binding for fzf (optional) # Run fzf with provided parameters and predefined settings fzf \ @@ -1016,16 +1021,13 @@ __edit_config() { local _error_config_not_exist="${_orange} No external configuration file found.${_reset}${_break}${_break}${_green_light} This configuration file is required for customizing TKG builds and options.${_break}${_green_light} Select and confirm a option to download the missing${_reset}${_gray} customization.cfg${_reset}${_green_light} file now, or create your own later.${_reset}${_break}${_green_dark}${_line}${_break}" # Define a reusable bat command for the preview window - local _bat_cmd="bat --style=plain --language=cfg --force-colorization --theme='Visual Studio Dark+'" - - # Define a reusable diff command for the preview window - local _cols - _cols=$(tput cols 2>/dev/null || echo 120) - - #local _diff_cmd="git diff --compact-summary --color=always --word-diff=color --unified=3 --ignore-all-space --ignore-blank-lines" - #local _diff_cmd="colordiff --color=yes --side-by-side" - local _diff_cmd="diff --color=always --side-by-side" - + local _bat_cmd="LC_ALL=C bat --style=plain --language=cfg --wrap character --terminal-width ${_cols} --force-colorization --theme='Visual Studio Dark+'" + + #local _diff_cmd="LC_ALL=C git diff --compact-summary --color=always --word-diff=color --unified=3 --ignore-all-space --ignore-blank-lines" + #local _diff_cmd="LC_ALL=C colordiff --color=yes --side-by-side" + #local _diff_cmd="LC_ALL=C diff --color=always --side-by-side" + local _diff_cmd="LC_ALL=C wdiff --terminal --start-delete='${_red}' --end-delete='${_reset}' --start-insert='${_green_light}' --end-insert='${_reset}'" + # Define preview command for fzf menu to show config file content or diff vs remote default # It fetches the remote default config file and compares it with the local one if it exists local _preview_command=' @@ -1061,12 +1063,12 @@ __edit_config() { # Define header, footer, border label, and preview window settings for fzf menu local _header_text="🐸${_green_neon} TKG-Installer ─ Config menu${_reset}${_break}${_break}${_green_light} Adjust external configuration file${_break} Default directory:${_reset}${_gray} ~/.config/frogminer/ " - local _footer_text="${_green_light} Use arrow keys ⌨️ or 🖱️ mouse to navigate, Enter to select, ESC to exit${_break} Press${_reset}${_gray} Ctrl+P${_reset}${_green_light} to toggle the preview window${_break}${_green_light} Info:${_reset}${_gray} https://github.com/Frogging-Family${_reset}${_break}${_gray} https://github.com/damachine/tkginstaller" + local _footer_text="${_green_light} Use arrow keys ⌨️ or 🖱️ mouse to navigate, Enter to select, ESC to exit${_break} Press${_reset}${_gray} [Ctrl+P]${_reset}${_green_light} to toggle the preview window${_break}${_green_light} Info:${_reset}${_gray} https://github.com/Frogging-Family${_reset}${_break}${_gray} https://github.com/damachine/tkginstaller" local _border_label_text="${_tkg_version}" - local _preview_window_settings='right:nowrap:70%' + local _preview_window_settings='right:wrap:75%' # Show fzf menu and get user selection for configuration file editing - _config_choice=$(__fzf_menu "$_menu_content" "$_preview_command" "$_header_text" "$_footer_text" "$_border_label_text" "$_preview_window_settings") + _config_choice=$(__fzf_menu "$_menu_content" "$_preview_command" "$_header_text" "$_footer_text" "$_border_label_text" "$_preview_window_settings" "$_fzf_bind" ) # Handle cancelled selection (ESC key) or empty choice to exit editor menu gracefully if [[ -z "$_config_choice" ]]; then @@ -1325,31 +1327,43 @@ __menu() { key=$(echo {} | cut -d"|" -f1 | xargs) case $key in Linux*) - glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/linux.md" ;; + glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/linux.md" + glow --pager --width 80 --style "${_glow_style:-dark}" "${_frog_raw_url}/linux-tkg/refs/heads/master/README.md" + ;; Nvidia*) - glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/nvidia.md" ;; + glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/nvidia.md" + glow --pager --width 80 --style "${_glow_style:-dark}" "${_frog_raw_url}/nvidia-all/refs/heads/master/README.md" + ;; Mesa*) - glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/mesa.md" ;; + glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/mesa.md" + glow --pager --width 80 --style "${_glow_style:-dark}" "${_frog_raw_url}/mesa-git/refs/heads/master/README.md" + ;; Wine*) - glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/wine.md" ;; + glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/wine.md" + glow --pager --width 80 --style "${_glow_style:-dark}" "${_frog_raw_url}/wine-tkg-git/refs/heads/master/wine-tkg-git/README.md" + ;; Proton*) - glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/proton.md" ;; + glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/proton.md" + glow --pager --width 80 --style "${_glow_style:-dark}" "${_frog_raw_url}/wine-tkg-git/refs/heads/master/proton-tkg/README.md" + ;; Config*) - glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/config.md" ;; + glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/config.md" + glow --pager --width 80 --style "${_glow_style:-dark}" "${_frog_raw_url}/config-tkg/refs/heads/master/README.md" + ;; Clean*) glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/clean.md" ;; Help*) glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/help.md" ;; Close*) - glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/exit.md" ;; + glow --pager --width 80 --style "${_glow_style:-dark}" "${_tkg_raw_url}/close.md" ;; esac ' # Define header and footer texts for fzf menu display with TKG version info and instructions local _header_text="🐸${_green_neon} TKG-Installer ─ Main menu${_reset}${_break}${_break}${_green_light} Adjust, download, build, and install -TKG- packages${_break} Select an option below" - local _footer_text="${_green_light} Use arrow keys ⌨️ or 🖱️ mouse to navigate, Enter to select, ESC to exit${_break} Press${_reset}${_gray} Ctrl+P${_reset}${_green_light} to toggle the preview window${_break}${_green_light} Info:${_reset}${_gray} https://github.com/Frogging-Family${_reset}${_break}${_gray} https://github.com/damachine/tkginstaller" + local _footer_text="${_green_light} Use arrow keys ⌨️ or 🖱️ mouse to navigate, Enter to select, ESC to exit${_break} Press${_reset}${_gray} [Ctrl+P]${_reset}${_green_light} to toggle the preview window${_break}${_green_light} Info:${_reset}${_gray} https://github.com/Frogging-Family${_reset}${_break}${_gray} https://github.com/damachine/tkginstaller" local _border_label_text="${_tkg_version}" - local _preview_window_settings='right:wrap:60%' #:hidden + local _preview_window_settings='right:nowrap:55%' # Show fzf menu and get user selection for main menu options using defined parameters and preview command local _main_choice diff --git a/tkginstaller.sh.sha256sum b/tkginstaller.sh.sha256sum index a21ed52..210d999 100644 --- a/tkginstaller.sh.sha256sum +++ b/tkginstaller.sh.sha256sum @@ -1 +1 @@ -5d86cecb22eea5302c52b725fdd190a195f7a3cc22295bb4515d501d2c7ca158 \ No newline at end of file +30dceeaa4d55753e02df72000c41d5b58b3f0cb6a8a708f064deaf9c3603c404 \ No newline at end of file