Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I really liked this theme, but I don't really like long command lines. #1227

Open
mafhper opened this issue Feb 19, 2025 · 2 comments
Open
Assignees
Labels
question Further information is requested

Comments

@mafhper
Copy link

mafhper commented Feb 19, 2025

I really liked this theme, but I don't really like long command lines. I made some suggestions through this script.

Installation Proposal for WhiteSur GTK Theme

Overview

This proposal aims to improve the installation process for the WhiteSur GTK Theme repository by enhancing the clarity and consistency of command-line options used in the installation scripts. The changes focus on implement short flags with more descriptive long-form options and improving user input validation.

Proposed Changes

  1. Enhanced Command Options:

    • For install.sh:
      • Replace -d with --destination
      • Replace -n with --theme-name
      • Replace -o with --opacity
      • Replace -c with --color-variant
      • Replace -a with --window-buttons
      • Replace -t with --accent
      • Replace -s with --color-scheme
      • Use --monterey as a flag to enable MacOS Monterey style
    • For tweaks.sh:
      • Replace similar short flags with descriptive options: --opacity, --color-variant, --accent, --color-scheme
      • Use --configure-gdm and --gdm-icon for GDM configuration options
  2. Input Validation and Error Handling:

    • Add checks to ensure that user inputs are valid.
    • Provide clear error messages in case of invalid configurations.
  3. Modularization:

    • Separate the interactive configuration logic from the command execution logic.
    • This allows for both interactive and non-interactive modes of installation.

Implementation Details

The updated scripts will use a combination of interactive dialogs and command-line argument parsing (using methods like getopts or similar) to ensure clarity and flexibility. Default values will be defined, and users can override them via the new descriptive flags.

Proposed Code Changes

Updated Interactive Installation Script (install_interactive.sh)

#!/bin/bash
# Interactive installation for WhiteSur GTK Theme using enhanced options.
# Requires the 'dialog' package to be installed.

function input_box() {
    dialog --title "$1" --inputbox "$2" 8 50 "$3" 3>&1 1>&2 2>&3
}

function menu_box() {
    dialog --title "$1" --menu "$2" 15 50 "$3" "${@:4}" 3>&1 1>&2 2>&3
}

function cleanup() {
    clear
}
trap cleanup EXIT

# Collect configuration values
destination=$(input_box "Destination Directory" "Enter the installation directory:" "/home/ubuntu/.themes")
theme_name=$(input_box "Theme Name" "Enter the theme name:" "WhiteSur")
opacity=$(menu_box "Opacity" "Select opacity:" 2 \
  "normal" "Normal opacity" \
  "solid" "Solid opacity")
color_variant=$(menu_box "Color Variant" "Select color variant:" 2 \
  "light" "Light theme" \
  "dark" "Dark theme")
window_buttons=$(menu_box "Window Buttons" "Select window button style:" 3 \
  "default" "Default" \
  "alternative" "Alternative" \
  "all" "All")
accent=$(menu_box "Accent Color" "Select accent color:" 10 \
  "default" "Default (BigSur-like)" \
  "blue" "Blue" \
  "purple" "Purple" \
  "pink" "Pink" \
  "red" "Red" \
  "orange" "Orange" \
  "yellow" "Yellow" \
  "green" "Green" \
  "grey" "Grey" \
  "all" "All")
color_scheme=$(menu_box "Color Scheme" "Select color scheme:" 2 \
  "standard" "Standard" \
  "nord" "Nord")
dialog --title "MacOS Monterey" --yesno "Enable MacOS Monterey style?" 7 50
if [ $? -eq 0 ]; then
    monterey_flag="--monterey"
else
    monterey_flag=""
fi

# Generate the command using descriptive flags
cmd="./install.sh --destination \"$destination\" --theme-name \"$theme_name\" --opacity $opacity --color-variant $color_variant --window-buttons $window_buttons --accent $accent --color-scheme $color_scheme $monterey_flag"

dialog --msgbox "Generated command for install.sh:\n$cmd" 10 70
dialog --yesno "Do you want to execute install.sh?" 7 50
if [ $? -eq 0 ]; then
    eval $cmd
else
    dialog --msgbox "Installation cancelled." 5 40
fi
@mafhper mafhper added the question Further information is requested label Feb 19, 2025
@washburn24
Copy link

If we want longer, descriptive command line flags, I'd suggest adding them rather than replacing the short flags. I have install scripts based on the current flags, and I kinda doubt I'm the only one.

@mafhper
Copy link
Author

mafhper commented Feb 19, 2025

I want to clarify that my intention is not to replace the existing execution flags but rather to add more user-friendly options alongside them. The goal is to make the interface more approachable for newcomers while maintaining full compatibility with existing scripts and workflows. Having both short and descriptive flags would allow more people to use the tool while ensuring current users can continue using their established scripts without any changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants