From 073eee7bba542a66c0c446ac340e342046e8320e Mon Sep 17 00:00:00 2001 From: redsh4de Date: Mon, 3 Feb 2025 01:58:05 +0200 Subject: [PATCH 1/8] change: use options.sh to install browser/filemanager --- bin/ml4w-hyprland-setup | 12 +++-- lib/options/options.sh | 46 +++++++++++-------- lib/options/options/browser.sh | 6 ++- lib/options/options/filemanager.sh | 6 ++- lib/options/options/other.sh | 6 ++- lib/options/options/pywalfox.sh | 6 ++- lib/options/options/sddm.sh | 6 ++- lib/options/options/shell.sh | 6 ++- lib/options/options/system-monitor.sh | 6 ++- lib/options/options/terminal.sh | 6 ++- lib/options/options/xdg-desktop-portal-gtk.sh | 6 ++- .../dotfiles/.config/ml4w/settings/browser.sh | 2 +- .../.config/ml4w/settings/filemanager.sh | 2 +- .../ml4w/settings/waybar-quicklinks.json | 6 +-- share/packages/arch/profiles/default.sh | 3 -- share/packages/fedora/profiles/default.sh | 4 +- 16 files changed, 88 insertions(+), 41 deletions(-) diff --git a/bin/ml4w-hyprland-setup b/bin/ml4w-hyprland-setup index 359e0df8b..22e565653 100755 --- a/bin/ml4w-hyprland-setup +++ b/bin/ml4w-hyprland-setup @@ -136,7 +136,7 @@ _run_dotfiles() { } # ----------------------------------------------------- -# Run unstaller +# Run options wizard # ----------------------------------------------------- _run_options() { source $options_directory/options.sh @@ -182,7 +182,13 @@ _run_activate() { # ----------------------------------------------------- while getopts "m:p:vh" opt; do case $opt in - m) install_mode="$OPTARG";; + m) + install_mode="$OPTARG" + if [[ "$install_mode" == "options" ]]; then + shift $((OPTIND-1)) + options_argument="$1" + fi + ;; p) install_platform="$OPTARG";; v) echo ":: ML4W Dotfiles for Hyprland Version $version" @@ -196,7 +202,7 @@ while getopts "m:p:vh" opt; do echo "-m nvidia: Run full installation with NVIDA Driver installation" echo "-m packages: Run installation of packages only" echo "-m dotfiles: Run the setup of the dotfiles only" - echo "-m options: Install package options" + echo "-m options : Install package options" echo "-m diagnosis: Run diagnosis" echo "-m update: Check for new updates" echo "-m uninstall: Will uninstall the dotfiles" diff --git a/lib/options/options.sh b/lib/options/options.sh index 211da7918..ae2f26893 100644 --- a/lib/options/options.sh +++ b/lib/options/options.sh @@ -54,24 +54,8 @@ _checkPywalfox() { fi } -_selectCategory() { - clear - echo -e "${GREEN}" - figlet -f smslant "Options" - echo -e "${NONE}" - echo "Platform: $install_platform" - echo "This script will help you to install some pre-defined package options." - echo "If your desired package is not listed, you can install it with your package manager " - echo "and set it as default application in the ML4W Settings App." - echo - echo "- SDDM:" $(_checkSddm) "/ SDDM Theme:" $(_checkSddmTheme) - echo "- Shell: "$SHELL "/ Terminal:" $(_checkCurrent terminal.sh) - echo "- File manager:" $(_checkCurrent filemanager.sh) - echo "- Browser:" $(_checkCurrent browser.sh) - echo "- System monitor:" $(_checkCurrent system-monitor.sh) - echo - category=$(gum choose "shell" "terminal" "file manager" "browser" "pywalfox" "system monitor" "more" "REBOOT" "CANCEL") - case ${category} in +_handleCategorySelection() { + case $1 in terminal) source $options_directory/options/terminal.sh ;; @@ -105,4 +89,30 @@ _selectCategory() { esac } +_selectCategory() { + if [[ -n "$options_argument" ]]; then + echo "Options argument: $options_argument" + _handleCategorySelection "$options_argument" + exit + fi + + clear + echo -e "${GREEN}" + figlet -f smslant "Options" + echo -e "${NONE}" + echo "Platform: $install_platform" + echo "This script will help you to install some pre-defined package options." + echo "If your desired package is not listed, you can install it with your package manager " + echo "and set it as default application in the ML4W Settings App." + echo + echo "- SDDM:" $(_checkSddm) "/ SDDM Theme:" $(_checkSddmTheme) + echo "- Shell: "$SHELL "/ Terminal:" $(_checkCurrent terminal.sh) + echo "- File manager:" $(_checkCurrent filemanager.sh) + echo "- Browser:" $(_checkCurrent browser.sh) + echo "- System monitor:" $(_checkCurrent system-monitor.sh) + echo + category=$(gum choose "shell" "terminal" "file manager" "browser" "pywalfox" "system monitor" "more" "REBOOT" "CANCEL") + _handleCategorySelection "$category" +} + _selectCategory \ No newline at end of file diff --git a/lib/options/options/browser.sh b/lib/options/options/browser.sh index 4413a381c..68989d9a5 100644 --- a/lib/options/options/browser.sh +++ b/lib/options/options/browser.sh @@ -14,7 +14,11 @@ optionalSelect=$(gum choose $toInstall "CANCEL") if [ -z "$optionalSelect" ] ;then _selectCategory elif [ $optionalSelect == "CANCEL" ]; then - _selectCategory + if [ -z "$options_argument" ]; then + _selectCategory + else + exit + fi else if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then _installPackage $optionalSelect diff --git a/lib/options/options/filemanager.sh b/lib/options/options/filemanager.sh index 0434398ef..a6c418027 100644 --- a/lib/options/options/filemanager.sh +++ b/lib/options/options/filemanager.sh @@ -14,7 +14,11 @@ optionalSelect=$(gum choose $toInstall "CANCEL") if [ -z "$optionalSelect" ] ;then _selectCategory elif [ $optionalSelect == "CANCEL" ]; then - _selectCategory + if [ -z "$options_argument" ]; then + _selectCategory + else + exit + fi else if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then _installPackage $optionalSelect diff --git a/lib/options/options/other.sh b/lib/options/options/other.sh index dedda8448..3f59a2484 100644 --- a/lib/options/options/other.sh +++ b/lib/options/options/other.sh @@ -13,7 +13,11 @@ optionalSelect=$(gum choose $toInstall "CANCEL") if [ -z "$optionalSelect" ] ;then _selectCategory elif [ $optionalSelect == "CANCEL" ]; then - _selectCategory + if [ -z "$options_argument" ]; then + _selectCategory + else + exit + fi else if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then _installPackage $optionalSelect diff --git a/lib/options/options/pywalfox.sh b/lib/options/options/pywalfox.sh index c95d54da1..7b3842503 100644 --- a/lib/options/options/pywalfox.sh +++ b/lib/options/options/pywalfox.sh @@ -13,4 +13,8 @@ if [[ ! $(_isInstalled "python-pywalfox") == 0 ]]; then else gum spin --spinner dot --title "Pywalfox is already installed" -- sleep 3 fi -_selectCategory \ No newline at end of file +if [ -z "$options_argument" ]; then + _selectCategory +else + exit +fi \ No newline at end of file diff --git a/lib/options/options/sddm.sh b/lib/options/options/sddm.sh index fc8074fcd..8ecab9d15 100644 --- a/lib/options/options/sddm.sh +++ b/lib/options/options/sddm.sh @@ -25,4 +25,8 @@ else gum spin --spinner dot --title "Please reboot your system." -- sleep 3 fi fi -_selectCategory +if [ -z "$options_argument" ]; then + _selectCategory +else + exit +fi diff --git a/lib/options/options/shell.sh b/lib/options/options/shell.sh index fe2c70a0c..040136648 100644 --- a/lib/options/options/shell.sh +++ b/lib/options/options/shell.sh @@ -72,5 +72,9 @@ elif [[ $shell == "zsh" ]] ;then # ----------------------------------------------------- else _writeMessage "Changing shell canceled" - _selectCategory + if [ -z "$options_argument" ]; then + _selectCategory + else + exit + fi fi diff --git a/lib/options/options/system-monitor.sh b/lib/options/options/system-monitor.sh index 66412f208..211af6026 100644 --- a/lib/options/options/system-monitor.sh +++ b/lib/options/options/system-monitor.sh @@ -14,7 +14,11 @@ optionalSelect=$(gum choose $toInstall "CANCEL") if [ -z "$optionalSelect" ] ;then _selectCategory elif [ $optionalSelect == "CANCEL" ]; then - _selectCategory + if [ -z "$options_argument" ]; then + _selectCategory + else + exit + fi else if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then _installPackage $optionalSelect diff --git a/lib/options/options/terminal.sh b/lib/options/options/terminal.sh index 8fe0e7d65..4722636d1 100644 --- a/lib/options/options/terminal.sh +++ b/lib/options/options/terminal.sh @@ -14,7 +14,11 @@ optionalSelect=$(gum choose $toInstall "CANCEL") if [ -z "$optionalSelect" ] ;then _selectCategory elif [ $optionalSelect == "CANCEL" ]; then - _selectCategory + if [ -z "$options_argument" ]; then + _selectCategory + else + exit + fi else if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then _installPackage $optionalSelect diff --git a/lib/options/options/xdg-desktop-portal-gtk.sh b/lib/options/options/xdg-desktop-portal-gtk.sh index 9fe5c8f9f..15b8c6b5e 100644 --- a/lib/options/options/xdg-desktop-portal-gtk.sh +++ b/lib/options/options/xdg-desktop-portal-gtk.sh @@ -8,4 +8,8 @@ if gum confirm "Do you want to install it now?" ;then _installPackage "xdg-desktop-portal-gtk" gum spin --spinner dot --title "Please reboot your system." -- sleep 3 fi -_selectCategory \ No newline at end of file +if [ -z "$options_argument" ]; then + _selectCategory +else + exit +fi \ No newline at end of file diff --git a/share/dotfiles/.config/ml4w/settings/browser.sh b/share/dotfiles/.config/ml4w/settings/browser.sh index dbfb8f931..8016c56a2 100755 --- a/share/dotfiles/.config/ml4w/settings/browser.sh +++ b/share/dotfiles/.config/ml4w/settings/browser.sh @@ -1 +1 @@ -firefox +$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e ml4w-hyprland-setup -m options browser diff --git a/share/dotfiles/.config/ml4w/settings/filemanager.sh b/share/dotfiles/.config/ml4w/settings/filemanager.sh index 9f0175d68..456369288 100755 --- a/share/dotfiles/.config/ml4w/settings/filemanager.sh +++ b/share/dotfiles/.config/ml4w/settings/filemanager.sh @@ -1 +1 @@ -nautilus \ No newline at end of file +$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e ml4w-hyprland-setup -m options filemanager diff --git a/share/dotfiles/.config/ml4w/settings/waybar-quicklinks.json b/share/dotfiles/.config/ml4w/settings/waybar-quicklinks.json index 7d619061b..2c47208b8 100644 --- a/share/dotfiles/.config/ml4w/settings/waybar-quicklinks.json +++ b/share/dotfiles/.config/ml4w/settings/waybar-quicklinks.json @@ -5,14 +5,14 @@ "tooltip-format": "Open Chromium" }, "custom/quicklink2": { - "format": "", + "format": "󰖟", "on-click": "~/.config/ml4w/settings/browser.sh", - "tooltip-format": "Open Firefox" + "tooltip-format": "Open Browser" }, "custom/quicklink3": { "format": "", "on-click": "~/.config/ml4w/settings/filemanager.sh", - "tooltip-format": "Open filemanager" + "tooltip-format": "Open File Manager" }, "custom/quicklink4": { "format": "", diff --git a/share/packages/arch/profiles/default.sh b/share/packages/arch/profiles/default.sh index 5b7e949b9..f497242e5 100644 --- a/share/packages/arch/profiles/default.sh +++ b/share/packages/arch/profiles/default.sh @@ -15,12 +15,9 @@ packages=( "imagemagick" "jq" "xclip" - "firefox" "kitty" "neovim" "htop" - "nautilus" - "nautilus-open-any-terminal" "python-pywal" "pinta" "blueman" diff --git a/share/packages/fedora/profiles/default.sh b/share/packages/fedora/profiles/default.sh index b886e6b51..2e1aeb35a 100644 --- a/share/packages/fedora/profiles/default.sh +++ b/share/packages/fedora/profiles/default.sh @@ -14,12 +14,10 @@ packages=( "fuse" "ImageMagick" "jq" - "xclip" - "firefox" + "xclip" "kitty" "neovim" "htop" - "nautilus" "python-pywal" "pinta" "blueman" From 38e6601aeaee88c7490b5879c699bcaa2292813a Mon Sep 17 00:00:00 2001 From: redsh4de Date: Mon, 3 Feb 2025 17:57:39 +0200 Subject: [PATCH 2/8] update: automatically update browser icon/name based on the browser installed - allowed Ctrl+C to exit the scripts when launched directory --- lib/options/options/browser.sh | 81 +++++++++++++++++++++++---- lib/options/options/filemanager.sh | 4 +- lib/options/options/other.sh | 4 +- lib/options/options/system-monitor.sh | 4 +- lib/options/options/terminal.sh | 4 +- 5 files changed, 73 insertions(+), 24 deletions(-) diff --git a/lib/options/options/browser.sh b/lib/options/options/browser.sh index 68989d9a5..df2f761de 100644 --- a/lib/options/options/browser.sh +++ b/lib/options/options/browser.sh @@ -10,10 +10,47 @@ selectedInstall="" _checkPackages _checkDefault "browser.sh" +_updateWaybarBrowserQuicklink() { + local new_icon="$1" + local new_name="$2" + + local waybar_ql="$HOME/.config/ml4w/settings/waybar-quicklinks.json" + local browser_sh="~/.config/ml4w/settings/browser.sh" + + if [ -f "$waybar_ql" ]; then + local quicklink + quicklink=$(grep -m1 -B 2 "$browser_sh" "$waybar_ql" \ + | grep -oE '"custom/[^"]+":' \ + | head -n1 \ + | tr -d '":') + if [ -n "$quicklink" ]; then + local escaped_quicklink=$(printf '%s' "$quicklink" | sed 's/\//\\\//g') + + _updateQuicklinkProperty() { + local property="$1" + local new_value="$2" + sed -i.bak -E "/\"$escaped_quicklink\": *\{/,/^\s*\}/ s|([[:space:]]*\"$property\"[[:space:]]*:[[:space:]]*\").*(\")|\1$new_value\2|" "$waybar_ql" + rm -f "$waybar_ql.bak" + } + + _updateQuicklinkProperty "format" "$new_icon" + [ -z "$new_name" ] && new_name="Browser" + _updateQuicklinkProperty "tooltip-format" "Open $new_name" + + unset -f _updateQuicklinkProperty + else + echo "No waybar quicklink found for '$browser_sh'" + sleep 1 + fi + else + echo "No waybar-quicklinks.json file found" + sleep 1 + fi +} + + optionalSelect=$(gum choose $toInstall "CANCEL") -if [ -z "$optionalSelect" ] ;then - _selectCategory -elif [ $optionalSelect == "CANCEL" ]; then +if [ -z "$optionalSelect" ] || [ "$optionalSelect" = "CANCEL" ]; then if [ -z "$options_argument" ]; then _selectCategory else @@ -23,14 +60,34 @@ else if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then _installPackage $optionalSelect fi - if [ $optionalSelect == "brave-bin" ]; then - echo 'brave' > "$HOME/.config/ml4w/settings/browser.sh" - elif [ $optionalSelect == "brave-browser" ]; then - echo 'brave' > "$HOME/.config/ml4w/settings/browser.sh" - elif [ $optionalSelect == "zen-browser-bin" ]; then - echo 'zen-browser' > "$HOME/.config/ml4w/settings/browser.sh" - else - echo "$optionalSelect" > "$HOME/.config/ml4w/settings/browser.sh" - fi + + case $optionalSelect in + firefox) + echo 'firefox' > "$HOME/.config/ml4w/settings/browser.sh" + _updateWaybarBrowserQuicklink "" "Firefox" + break + ;; + chromium) + echo 'chromium' > "$HOME/.config/ml4w/settings/browser.sh" + _updateWaybarBrowserQuicklink "" "Chromium" + break + ;; + brave|brave-bin|brave-browser) + echo 'brave' > "$HOME/.config/ml4w/settings/browser.sh" + _updateWaybarBrowserQuicklink "" "Brave" + break + ;; + zen-browser-bin|zen-browser) + echo 'zen-browser' > "$HOME/.config/ml4w/settings/browser.sh" + _updateWaybarBrowserQuicklink "" "Zen Browser" + break + ;; + *) + echo "$optionalSelect" > "$HOME/.config/ml4w/settings/browser.sh" + _updateWaybarBrowserQuicklink "" "Browser" + break + ;; + esac + _selectCategory fi diff --git a/lib/options/options/filemanager.sh b/lib/options/options/filemanager.sh index a6c418027..47eceb9ff 100644 --- a/lib/options/options/filemanager.sh +++ b/lib/options/options/filemanager.sh @@ -11,9 +11,7 @@ _checkPackages _checkDefault "filemanager.sh" optionalSelect=$(gum choose $toInstall "CANCEL") -if [ -z "$optionalSelect" ] ;then - _selectCategory -elif [ $optionalSelect == "CANCEL" ]; then +if [ -z "$optionalSelect" ] || [ "$optionalSelect" = "CANCEL" ]; then if [ -z "$options_argument" ]; then _selectCategory else diff --git a/lib/options/options/other.sh b/lib/options/options/other.sh index 3f59a2484..a324b0c42 100644 --- a/lib/options/options/other.sh +++ b/lib/options/options/other.sh @@ -10,9 +10,7 @@ selectedInstall="" _checkPackages optionalSelect=$(gum choose $toInstall "CANCEL") -if [ -z "$optionalSelect" ] ;then - _selectCategory -elif [ $optionalSelect == "CANCEL" ]; then +if [ -z "$optionalSelect" ] || [ "$optionalSelect" = "CANCEL" ]; then if [ -z "$options_argument" ]; then _selectCategory else diff --git a/lib/options/options/system-monitor.sh b/lib/options/options/system-monitor.sh index 211af6026..98da7041e 100644 --- a/lib/options/options/system-monitor.sh +++ b/lib/options/options/system-monitor.sh @@ -11,9 +11,7 @@ _checkPackages _checkDefault "system-monitor.sh" optionalSelect=$(gum choose $toInstall "CANCEL") -if [ -z "$optionalSelect" ] ;then - _selectCategory -elif [ $optionalSelect == "CANCEL" ]; then +if [ -z "$optionalSelect" ] || [ "$optionalSelect" = "CANCEL" ]; then if [ -z "$options_argument" ]; then _selectCategory else diff --git a/lib/options/options/terminal.sh b/lib/options/options/terminal.sh index 4722636d1..f350a90b1 100644 --- a/lib/options/options/terminal.sh +++ b/lib/options/options/terminal.sh @@ -11,9 +11,7 @@ _checkPackages _checkDefault "terminal.sh" optionalSelect=$(gum choose $toInstall "CANCEL") -if [ -z "$optionalSelect" ] ;then - _selectCategory -elif [ $optionalSelect == "CANCEL" ]; then +if [ -z "$optionalSelect" ] || [ "$optionalSelect" = "CANCEL" ]; then if [ -z "$options_argument" ]; then _selectCategory else From a3dbc170eeb8d2a4f3e2b5d581d252be50e428ab Mon Sep 17 00:00:00 2001 From: redsh4de <25299353+redsh4de@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:11:10 +0200 Subject: [PATCH 3/8] remove 'break' statements from case --- lib/options/options/browser.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/options/options/browser.sh b/lib/options/options/browser.sh index 266ca0ef9..2ce702027 100644 --- a/lib/options/options/browser.sh +++ b/lib/options/options/browser.sh @@ -65,27 +65,22 @@ else firefox) echo 'firefox' > "$HOME/.config/ml4w/settings/browser.sh" _updateWaybarBrowserQuicklink "" "Firefox" - break ;; chromium) echo 'chromium' > "$HOME/.config/ml4w/settings/browser.sh" _updateWaybarBrowserQuicklink "" "Chromium" - break ;; brave|brave-bin|brave-browser) echo 'brave' > "$HOME/.config/ml4w/settings/browser.sh" _updateWaybarBrowserQuicklink "" "Brave" - break ;; zen-browser-bin|zen-browser) echo 'zen-browser' > "$HOME/.config/ml4w/settings/browser.sh" _updateWaybarBrowserQuicklink "" "Zen Browser" - break ;; *) echo "$optionalSelect" > "$HOME/.config/ml4w/settings/browser.sh" _updateWaybarBrowserQuicklink "" "Browser" - break ;; esac From 0d1481b982a5403f4da680c31cec5f64956231ae Mon Sep 17 00:00:00 2001 From: redsh4de Date: Wed, 5 Feb 2025 19:13:54 +0200 Subject: [PATCH 4/8] updates - add e-mail client to options menu - show (none) in defaults when no email client is defined in the setting script --- lib/options/options.sh | 14 ++++++++++++-- lib/options/options/email.sh | 26 ++++++++++++++++++++++++++ share/packages/arch/options/email.sh | 5 +++++ share/packages/fedora/options/email.sh | 4 ++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 lib/options/options/email.sh create mode 100644 share/packages/arch/options/email.sh create mode 100644 share/packages/fedora/options/email.sh diff --git a/lib/options/options.sh b/lib/options/options.sh index e7d025f51..0306e6474 100644 --- a/lib/options/options.sh +++ b/lib/options/options.sh @@ -14,6 +14,9 @@ _checkPackages() { _checkDefault() { if [ -f ~/.config/ml4w/settings/$1 ]; then default="$(cat ~/.config/ml4w/settings/$1)" + if [[ $default == *"ml4w-hyprland-setup -m options"* ]]; then + default="(none)" + fi echo ":: Current setup: $default" else echo ":: ERROR: No configuration file found" @@ -24,6 +27,9 @@ _checkDefault() { _checkCurrent() { if [ -f ~/.config/ml4w/settings/$1 ]; then default="$(cat ~/.config/ml4w/settings/$1)" + if [[ $default == *"ml4w-hyprland-setup -m options"* ]]; then + default="(none)" + fi echo $default else echo "No configuration file found" @@ -68,6 +74,9 @@ _handleCategorySelection() { browser) source $options_directory/options/browser.sh ;; + email) + source $options_directory/options/email.sh + ;; more) source $options_directory/options/other.sh ;; @@ -107,11 +116,12 @@ _selectCategory() { echo echo "- SDDM:" $(_checkSddm) "/ SDDM Theme:" $(_checkSddmTheme) echo "- Shell: "$SHELL "/ Terminal:" $(_checkCurrent terminal.sh) - echo "- File manager:" $(_checkCurrent filemanager.sh) + echo "- File manager:" $(_checkCurrent filemanager.sh) + echo "- E-mail client:" $(_checkCurrent email.sh) echo "- Browser:" $(_checkCurrent browser.sh) echo "- System monitor:" $(_checkCurrent system-monitor.sh) echo - category=$(gum choose "shell" "terminal" "file manager" "browser" "pywalfox" "system monitor" "more" "REBOOT" "CANCEL") + category=$(gum choose "shell" "terminal" "file manager" "email" "browser" "pywalfox" "system monitor" "more" "REBOOT" "CANCEL") _handleCategorySelection "$category" } diff --git a/lib/options/options/email.sh b/lib/options/options/email.sh new file mode 100644 index 000000000..5e1813a59 --- /dev/null +++ b/lib/options/options/email.sh @@ -0,0 +1,26 @@ +#!/bin/bash +clear +echo -e "${GREEN}" +figlet -f smslant "E-mail Client" +echo -e "${NONE}" +source $packages_directory/$install_platform/options/email.sh +toInstall="" +selectedInstall="" + +_checkPackages +_checkDefault "email.sh" + +optionalSelect=$(gum choose $toInstall "CANCEL") +if [ -z "$optionalSelect" ] || [ "$optionalSelect" = "CANCEL" ]; then + if [ -z "$options_argument" ]; then + _selectCategory + else + exit + fi +else + if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then + _installPackage $optionalSelect + fi + echo "$optionalSelect" >"$HOME/.config/ml4w/settings/email.sh" + _selectCategory +fi diff --git a/share/packages/arch/options/email.sh b/share/packages/arch/options/email.sh new file mode 100644 index 000000000..fc1b8be75 --- /dev/null +++ b/share/packages/arch/options/email.sh @@ -0,0 +1,5 @@ +optdepends=( + "thunderbird" + "betterbird" + "evolution" +) \ No newline at end of file diff --git a/share/packages/fedora/options/email.sh b/share/packages/fedora/options/email.sh new file mode 100644 index 000000000..b53e8acd6 --- /dev/null +++ b/share/packages/fedora/options/email.sh @@ -0,0 +1,4 @@ +optdepends=( + "thunderbird" + "evolution" +) \ No newline at end of file From 363fa6018471c33090fd538485eb635cdb1601e6 Mon Sep 17 00:00:00 2001 From: redsh4de Date: Fri, 7 Feb 2025 21:27:09 +0200 Subject: [PATCH 5/8] updates - changed the fallback browser icon to the up-to-date one - fixed a bug for selecting the file manager - set options/email.sh to be the email client option installer by default --- lib/options/options/browser.sh | 10 ++++------ lib/options/options/email.sh | 2 +- share/dotfiles/.config/ml4w/settings/email.sh | 2 +- share/dotfiles/.config/ml4w/settings/filemanager.sh | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/options/options/browser.sh b/lib/options/options/browser.sh index 2ce702027..d60b0f7f4 100644 --- a/lib/options/options/browser.sh +++ b/lib/options/options/browser.sh @@ -15,7 +15,7 @@ _updateWaybarBrowserQuicklink() { local new_name="$2" local waybar_ql="$HOME/.config/ml4w/settings/waybar-quicklinks.json" - local browser_sh="~/.config/ml4w/settings/browser.sh" + local browser_sh=".config/ml4w/settings/browser.sh" if [ -f "$waybar_ql" ]; then local quicklink @@ -60,7 +60,6 @@ else if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then _installPackage $optionalSelect fi - case $optionalSelect in firefox) echo 'firefox' > "$HOME/.config/ml4w/settings/browser.sh" @@ -72,17 +71,16 @@ else ;; brave|brave-bin|brave-browser) echo 'brave' > "$HOME/.config/ml4w/settings/browser.sh" - _updateWaybarBrowserQuicklink "" "Brave" + _updateWaybarBrowserQuicklink "" "Brave" ;; zen-browser-bin|zen-browser) echo 'zen-browser' > "$HOME/.config/ml4w/settings/browser.sh" - _updateWaybarBrowserQuicklink "" "Zen Browser" + _updateWaybarBrowserQuicklink "" "Zen Browser" ;; *) echo "$optionalSelect" > "$HOME/.config/ml4w/settings/browser.sh" - _updateWaybarBrowserQuicklink "" "Browser" + _updateWaybarBrowserQuicklink "" "Browser" ;; esac - _selectCategory fi diff --git a/lib/options/options/email.sh b/lib/options/options/email.sh index 5e1813a59..a26c87fff 100644 --- a/lib/options/options/email.sh +++ b/lib/options/options/email.sh @@ -1,7 +1,7 @@ #!/bin/bash clear echo -e "${GREEN}" -figlet -f smslant "E-mail Client" +figlet -f smslant "Email Client" echo -e "${NONE}" source $packages_directory/$install_platform/options/email.sh toInstall="" diff --git a/share/dotfiles/.config/ml4w/settings/email.sh b/share/dotfiles/.config/ml4w/settings/email.sh index cbf0fe224..8ad2afc54 100644 --- a/share/dotfiles/.config/ml4w/settings/email.sh +++ b/share/dotfiles/.config/ml4w/settings/email.sh @@ -1 +1 @@ -evolution \ No newline at end of file +$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e ml4w-hyprland-setup -m options email \ No newline at end of file diff --git a/share/dotfiles/.config/ml4w/settings/filemanager.sh b/share/dotfiles/.config/ml4w/settings/filemanager.sh index ac3fd93ad..f36edee72 100755 --- a/share/dotfiles/.config/ml4w/settings/filemanager.sh +++ b/share/dotfiles/.config/ml4w/settings/filemanager.sh @@ -1 +1 @@ -$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e ml4w-hyprland-setup -m options filemanager \ No newline at end of file +$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e ml4w-hyprland-setup -m options "file manager" \ No newline at end of file From ee88a05d0636e139043604a1ae435a2f57681621 Mon Sep 17 00:00:00 2001 From: redsh4de Date: Wed, 12 Feb 2025 14:50:43 +0200 Subject: [PATCH 6/8] newlines --- share/dotfiles/.config/ml4w/settings/email.sh | 2 +- share/dotfiles/.config/ml4w/settings/filemanager.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/dotfiles/.config/ml4w/settings/email.sh b/share/dotfiles/.config/ml4w/settings/email.sh index 8ad2afc54..cf13b1f34 100644 --- a/share/dotfiles/.config/ml4w/settings/email.sh +++ b/share/dotfiles/.config/ml4w/settings/email.sh @@ -1 +1 @@ -$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e ml4w-hyprland-setup -m options email \ No newline at end of file +$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e ml4w-hyprland-setup -m options email diff --git a/share/dotfiles/.config/ml4w/settings/filemanager.sh b/share/dotfiles/.config/ml4w/settings/filemanager.sh index f36edee72..546460e40 100755 --- a/share/dotfiles/.config/ml4w/settings/filemanager.sh +++ b/share/dotfiles/.config/ml4w/settings/filemanager.sh @@ -1 +1 @@ -$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e ml4w-hyprland-setup -m options "file manager" \ No newline at end of file +$(cat ~/.config/ml4w/settings/terminal.sh) --class dotfiles-floating -e ml4w-hyprland-setup -m options "file manager" From c697f5080e23bf84cd90e7e5e151ac9f546a9f7f Mon Sep 17 00:00:00 2001 From: redsh4de Date: Wed, 12 Feb 2025 15:13:09 +0200 Subject: [PATCH 7/8] add nautilus new window fix --- lib/options/options/filemanager.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/options/options/filemanager.sh b/lib/options/options/filemanager.sh index a9d2502ee..1c7eb60e1 100644 --- a/lib/options/options/filemanager.sh +++ b/lib/options/options/filemanager.sh @@ -20,9 +20,11 @@ if [ -z "$optionalSelect" ] || [ "$optionalSelect" = "CANCEL" ]; then else if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then _installPackage $optionalSelect - fi + if [ $optionalSelect == "yazi" ]; then echo '$(cat ~/.config/ml4w/settings/terminal.sh) -e yazi' >"$HOME/.config/ml4w/settings/filemanager.sh" + elif [ $optionalSelect == "nautilus" ]; then + echo 'nautilus --new-window' >"$HOME/.config/ml4w/settings/filemanager.sh" else echo "$optionalSelect" >"$HOME/.config/ml4w/settings/filemanager.sh" fi From a9b9ff2e49bd27c3f9445c055902ddad3f6de54f Mon Sep 17 00:00:00 2001 From: redsh4de Date: Wed, 12 Feb 2025 15:14:03 +0200 Subject: [PATCH 8/8] fix --- lib/options/options/filemanager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/options/options/filemanager.sh b/lib/options/options/filemanager.sh index 1c7eb60e1..01bc5f7ac 100644 --- a/lib/options/options/filemanager.sh +++ b/lib/options/options/filemanager.sh @@ -20,7 +20,7 @@ if [ -z "$optionalSelect" ] || [ "$optionalSelect" = "CANCEL" ]; then else if [[ ! $(_isInstalled "$optionalSelect") == 0 ]]; then _installPackage $optionalSelect - + fi if [ $optionalSelect == "yazi" ]; then echo '$(cat ~/.config/ml4w/settings/terminal.sh) -e yazi' >"$HOME/.config/ml4w/settings/filemanager.sh" elif [ $optionalSelect == "nautilus" ]; then