Skip to content

Commit

Permalink
Merge branch 'main' into fixprintfissues
Browse files Browse the repository at this point in the history
  • Loading branch information
nnyyxxxx authored Sep 19, 2024
2 parents 0d54880 + 07e754b commit 0a21701
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 40 deletions.
25 changes: 12 additions & 13 deletions startdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,31 @@ get_latest_release() {
grep -oP '"tag_name": "\K[^"]*' |
head -n 1)
if [ -z "$latest_release" ]; then
echo "Error fetching release data" >&2
printf "%b\n" "Error fetching release data" >&2
return 1
fi
echo "$latest_release"
printf "%b\n" "$latest_release"
}

# Function to redirect to the latest pre-release version
redirect_to_latest_pre_release() {
local latest_release
latest_release=$(get_latest_release)
if [ -n "$latest_release" ]; then
url="https://github.com/ChrisTitusTech/linutil/releases/download/$latest_release/linutil"
else
echo 'Unable to determine latest pre-release version.' >&2
echo "Using latest Full Release"
printf "%b\n" 'Unable to determine latest pre-release version.' >&2
printf "%b\n" "Using latest Full Release"
url="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
fi
addArch
echo "Using URL: $url" # Log the URL being used
printf "%b\n" "Using URL: $url"
}

check() {
local exit_code=$1
local message=$2
exit_code=$1
message=$2

if [ $exit_code -ne 0 ]; then
if [ "$exit_code" -ne 0 ]; then
printf "%b\n" "${RED}ERROR: $message${RC}"
exit 1
fi
Expand All @@ -63,16 +62,16 @@ redirect_to_latest_pre_release
TMPFILE=$(mktemp)
check $? "Creating the temporary file"

echo "Downloading linutil from $url" # Log the download attempt
curl -fsL $url -o $TMPFILE
printf "%b\n" "Downloading linutil from $url"
curl -fsL "$url" -o "$TMPFILE"
check $? "Downloading linutil"

chmod +x $TMPFILE
chmod +x "$TMPFILE"
check $? "Making linutil executable"

"$TMPFILE"
check $? "Executing linutil"

rm -f $TMPFILE
rm -f "$TMPFILE"
check $? "Deleting the temporary file"
} # End of wrapping
6 changes: 3 additions & 3 deletions tabs/applications-setup/setup-flatpak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ setup_flatpak() {
if command -v flatpak >/dev/null 2>&1; then
if ! flatpak remotes | grep -q "flathub"; then
printf "%b\n" "${YELLOW}Detected Flatpak package manager but Flathub remote is not added. Would you like to add it? (y/n)${RC}"
read add_remote
read -r add_remote
case "$add_remote" in
[Yy]*)
printf "%b\n" "Adding Flathub remote..."
Expand All @@ -71,14 +71,14 @@ setup_flatpak() {
# So in case the user wants to use a GUI siftware manager they can setup it here
if [ "$DE" = "GNOME" ]; then
printf "%b\n" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/n)${RC}"
read install_gnome
read -r install_gnome
if [ "$install_gnome" = "y" ] || [ "$install_gnome" = "Y" ]; then
"$ESCALATION_TOOL" "$PACKAGER" install -y gnome-software-plugin-flatpak
fi
# Useful for Debian KDE spin as well
elif [ "$DE" = "KDE" ]; then
printf "%b\n" "${YELLOW}Detected KDE desktop environment. Would you like to install KDE Plasma Discover backend for Flatpak? (y/n)${RC}"
read install_kde
read -r install_kde
if [ "$install_kde" = "y" ] || [ "$install_kde" = "Y" ]; then
"$ESCALATION_TOOL" "$PACKAGER" install -y plasma-discover-backend-flatpak
fi
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 9 additions & 8 deletions tabs/system-setup/tab_data.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name = "System Setup"
multi_selectable = false

[[data]]
name = "Arch Linux"
Expand Down Expand Up @@ -56,16 +57,16 @@ script = "fedora/virtualization.sh"

[[data]]
name = "Auto Mount Drive"
script = "9-auto-mount.sh"
script = "auto-mount.sh"

[[data]]
name = "Build Prerequisites"
description = "This script is designed to handle the installation of various software dependencies across different Linux distributions"
script = "1-compile-setup.sh"
script = "compile-setup.sh"

[[data]]
name = "Docker Setup"
script = "6-docker-setup.sh"
script = "docker-setup.sh"

[[data]]
name = "Full System Cleanup"
Expand All @@ -79,22 +80,22 @@ script = "system-update.sh"
[[data]]
name = "Gaming Dependencies"
description = "This script is designed to handle the installation of gaming dependencies across different Linux distributions"
script = "2-gaming-setup.sh"
script = "gaming-setup.sh"

[[data]]
name = "Global Theme"
description = "This script is designed to handle the installation and configuration of global theming"
script = "3-global-theme.sh"
script = "global-theme.sh"

[[data]]
name = "Grub Theme Setup"
script = "7-grub-theme.sh"
script = "grub-theme.sh"

[[data]]
name = "Remove Snaps"
description = "This script is designed to remove snap"
script = "4-remove-snaps.sh"
script = "remove-snaps.sh"

[[data]]
name = "SSH-Samba Setup"
script = "5-samba-ssh-setup.sh"
script = "samba-ssh-setup.sh"
8 changes: 4 additions & 4 deletions tabs/utils/auto-login.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ list_sessions() {
printf "%b\n" "9) i3 (i3.desktop)"
printf "%b\n" "10) Custom session"
printf "%b\n" "Enter your choice [1-10]: "
read session_choice
read -r session_choice

case "$session_choice" in
1) session="gnome.desktop" ;;
Expand Down Expand Up @@ -126,7 +126,7 @@ configure_or_remove_autologin() {
printf "%b\n" "1) Add autologin"
printf "%b\n" "2) Remove autologin"
printf "%b\n" "Enter your choice [1-2]: "
read action_choice
read -r action_choice

if [ "$action_choice" = "1" ]; then
printf "%b\n" "Choose the display manager to configure:"
Expand All @@ -135,7 +135,7 @@ configure_or_remove_autologin() {
printf "%b\n" "3) SDDM"
printf "%b\n" "4) LXDM"
printf "%b\n" "Enter your choice [1-4]: "
read choice
read -r choice

case "$choice" in
1) configure_lightdm ;;
Expand All @@ -151,7 +151,7 @@ configure_or_remove_autologin() {
printf "%b\n" "3) SDDM"
printf "%b\n" "4) LXDM"
printf "%b\n" "Enter your choice [1-4]: "
read choice
read -r choice

case "$choice" in
1) remove_lightdm_autologin ;;
Expand Down
2 changes: 1 addition & 1 deletion tabs/utils/bluetooth-control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ prompt_for_mac() {
done
printf "0. Exit to main menu\n"
printf "%s\n" "$prompt_msg"
read choice
read -r choice

# Validate the choice
if echo "$choice" | grep -qE '^[0-9]+$' && [ "$choice" -le "$((i - 1))" ] && [ "$choice" -gt 0 ]; then
Expand Down
10 changes: 5 additions & 5 deletions tabs/utils/monitor-control/set_brightness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ adjust_monitor_brightness() {
done

printf "Enter the number of the monitor (or 'q' to quit): "
read monitor_choice
read -r monitor_choice

if [ "$monitor_choice" = "q" ]; then
printf "%b\n" "${RED}Exiting...${RC}"
Expand All @@ -31,14 +31,14 @@ adjust_monitor_brightness() {
if ! echo "$monitor_choice" | grep -qE '^[0-9]+$'; then
printf "%b\n" "${RED}Invalid selection. Please try again.${RC}"
printf "Press [Enter] to continue..."
read dummy
read -r dummy
continue
fi

if [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$#" ]; then
printf "%b\n" "${RED}Invalid selection. Please try again.${RC}"
printf "Press [Enter] to continue..."
read dummy
read -r dummy
continue
fi

Expand All @@ -51,7 +51,7 @@ adjust_monitor_brightness() {

while true; do
printf "Enter the new brightness value as a percentage (10 to 100, or 'q' to quit): "
read new_brightness_percentage
read -r new_brightness_percentage

if [ "$new_brightness_percentage" = "q" ]; then
printf "%b\n" "${RED}Exiting...${RC}"
Expand All @@ -68,7 +68,7 @@ adjust_monitor_brightness() {
new_brightness=$(awk "BEGIN {printf \"%.2f\", $new_brightness_percentage / 100}")

printf "Set brightness for $monitor_name to $new_brightness_percentage%? (y/n): "
read confirm
read -r confirm
if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]; then
printf "%b\n" "${GREEN}Setting brightness for $monitor_name to $new_brightness_percentage%${RC}"
execute_command "xrandr --output $monitor_name --brightness $new_brightness"
Expand Down
2 changes: 1 addition & 1 deletion tabs/utils/ollama.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ display_models() {

# Function to select model based on user input
select_model() {
local choice="$1"
choice="$1"
case $choice in
1) printf "%b\n" "llama3.1";;
2) printf "%b\n" "llama3.1:70b";;
Expand Down
2 changes: 1 addition & 1 deletion tabs/utils/ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ show_menu() {
main() {
while true; do
show_menu
read choice
read -r choice
case $choice in
1) ask_for_host_details ;;
2) show_available_hosts && printf "%b\n" "Enter the alias of the host to connect to: " && read -r host_alias; ssh $host_alias ;;
Expand Down
2 changes: 1 addition & 1 deletion tabs/utils/user-account-manager/delete_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ username=$(promptUsername "" "non-root") || exit 1
if [ "$username" = "$USER" ]; then
printf "%b\n" "${RED}Cannot delete the current user${RC}"
printf "%b\n" "${RED}Press [Enter] to continue...${RC}"
read dummy
read -r dummy
return
fi

Expand Down
6 changes: 3 additions & 3 deletions tabs/utils/wifi-control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ main_menu() {
printf "6. Remove a WiFi connection\n"
printf "0. Exit\n"
printf "Choose an option: "
read choice
read -r choice

case $choice in
1) wifi_on ;;
Expand Down Expand Up @@ -132,13 +132,13 @@ prompt_for_network() {

printf "0. Exit to main menu\n"
printf "%s" "$prompt_msg"
read choice
read -r choice

if [ "$choice" -ge 1 ] && [ "$choice" -lt "$i" ]; then
ssid=$(sed -n "${choice}p" "$temp_file" | awk -F: '{print $1}')
if [ "$action" = "connect" ]; then
printf "Enter password for SSID %s: " "$ssid"
read password
read -r password
printf "\n"
nmcli dev wifi connect "$ssid" password "$password" && {
printf "%b\n" "${GREEN}$success_msg${RC}"
Expand Down

0 comments on commit 0a21701

Please sign in to comment.