From 1748c3bae448ae20a282faf63afaf73f83bcfbde Mon Sep 17 00:00:00 2001 From: JEEVITHA KANNAN K S Date: Thu, 15 Aug 2024 08:11:41 +0530 Subject: [PATCH] refactor bash to sh --- src/commands/utils/bluetooth-control.sh | 4 ++-- src/commands/utils/monitor-control/auto_detect_displays.sh | 3 ++- src/commands/utils/monitor-control/change_orientation.sh | 3 ++- src/commands/utils/monitor-control/disable_monitor.sh | 3 ++- src/commands/utils/monitor-control/duplicate_displays.sh | 3 ++- src/commands/utils/monitor-control/enable_monitor.sh | 3 ++- src/commands/utils/monitor-control/extend_displays.sh | 3 ++- src/commands/utils/monitor-control/manage_arrangement.sh | 3 ++- src/commands/utils/monitor-control/reset_scaling.sh | 3 ++- src/commands/utils/monitor-control/scale_monitor.sh | 3 ++- src/commands/utils/monitor-control/set_primary_monitor.sh | 3 ++- src/commands/utils/monitor-control/set_resolutions.sh | 3 ++- src/commands/utils/monitor-control/utility_functions.sh | 2 +- src/commands/utils/wifi-control.sh | 3 +-- 14 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/commands/utils/bluetooth-control.sh b/src/commands/utils/bluetooth-control.sh index ecfd53ad..656d59e2 100644 --- a/src/commands/utils/bluetooth-control.sh +++ b/src/commands/utils/bluetooth-control.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Function to display colored text colored_echo() { @@ -128,4 +128,4 @@ remove_device() { } # Initialize -main_menu \ No newline at end of file +main_menu diff --git a/src/commands/utils/monitor-control/auto_detect_displays.sh b/src/commands/utils/monitor-control/auto_detect_displays.sh index 0ff72376..e37a2502 100644 --- a/src/commands/utils/monitor-control/auto_detect_displays.sh +++ b/src/commands/utils/monitor-control/auto_detect_displays.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh # Function to auto-detect displays and set common resolution diff --git a/src/commands/utils/monitor-control/change_orientation.sh b/src/commands/utils/monitor-control/change_orientation.sh index 46ca1d34..ee592c9e 100644 --- a/src/commands/utils/monitor-control/change_orientation.sh +++ b/src/commands/utils/monitor-control/change_orientation.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh # Function to change monitor orientation diff --git a/src/commands/utils/monitor-control/disable_monitor.sh b/src/commands/utils/monitor-control/disable_monitor.sh index 4de80062..3102b17f 100644 --- a/src/commands/utils/monitor-control/disable_monitor.sh +++ b/src/commands/utils/monitor-control/disable_monitor.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh RESET='\033[0m' diff --git a/src/commands/utils/monitor-control/duplicate_displays.sh b/src/commands/utils/monitor-control/duplicate_displays.sh index eb6f542d..7dfefe07 100644 --- a/src/commands/utils/monitor-control/duplicate_displays.sh +++ b/src/commands/utils/monitor-control/duplicate_displays.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh # Function to duplicate displays diff --git a/src/commands/utils/monitor-control/enable_monitor.sh b/src/commands/utils/monitor-control/enable_monitor.sh index b18a7c65..210b7ccb 100644 --- a/src/commands/utils/monitor-control/enable_monitor.sh +++ b/src/commands/utils/monitor-control/enable_monitor.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh RESET='\033[0m' diff --git a/src/commands/utils/monitor-control/extend_displays.sh b/src/commands/utils/monitor-control/extend_displays.sh index 974b9e82..f1b2b281 100644 --- a/src/commands/utils/monitor-control/extend_displays.sh +++ b/src/commands/utils/monitor-control/extend_displays.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh # Function to extend displays diff --git a/src/commands/utils/monitor-control/manage_arrangement.sh b/src/commands/utils/monitor-control/manage_arrangement.sh index 7637641d..f0929fa0 100644 --- a/src/commands/utils/monitor-control/manage_arrangement.sh +++ b/src/commands/utils/monitor-control/manage_arrangement.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh # Function to manage monitor arrangement diff --git a/src/commands/utils/monitor-control/reset_scaling.sh b/src/commands/utils/monitor-control/reset_scaling.sh index 73f03ca8..988e0e81 100644 --- a/src/commands/utils/monitor-control/reset_scaling.sh +++ b/src/commands/utils/monitor-control/reset_scaling.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh # Function to reset scaling back to 1 (native resolution) for all monitors diff --git a/src/commands/utils/monitor-control/scale_monitor.sh b/src/commands/utils/monitor-control/scale_monitor.sh index 4c88738b..413daa89 100644 --- a/src/commands/utils/monitor-control/scale_monitor.sh +++ b/src/commands/utils/monitor-control/scale_monitor.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh # Function to scale smaller monitors to the highest resolution of a bigger monitor diff --git a/src/commands/utils/monitor-control/set_primary_monitor.sh b/src/commands/utils/monitor-control/set_primary_monitor.sh index 68d8a17f..f50e8333 100644 --- a/src/commands/utils/monitor-control/set_primary_monitor.sh +++ b/src/commands/utils/monitor-control/set_primary_monitor.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh # Function to set a monitor as primary diff --git a/src/commands/utils/monitor-control/set_resolutions.sh b/src/commands/utils/monitor-control/set_resolutions.sh index 40eab9f6..9cf4de0f 100644 --- a/src/commands/utils/monitor-control/set_resolutions.sh +++ b/src/commands/utils/monitor-control/set_resolutions.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh -e + source ./utils/monitor-control/utility_functions.sh RESET='\033[0m' diff --git a/src/commands/utils/monitor-control/utility_functions.sh b/src/commands/utils/monitor-control/utility_functions.sh index 9a467bfd..0e8f0c34 100644 --- a/src/commands/utils/monitor-control/utility_functions.sh +++ b/src/commands/utils/monitor-control/utility_functions.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -e # Function to execute xrandr commands and handle errors execute_command() { diff --git a/src/commands/utils/wifi-control.sh b/src/commands/utils/wifi-control.sh index 884ab360..d7bb5841 100644 --- a/src/commands/utils/wifi-control.sh +++ b/src/commands/utils/wifi-control.sh @@ -1,5 +1,4 @@ -@@ -0,0 +1,168 @@ -#!/bin/bash +#!/bin/sh -e # Function to display colored text colored_echo() {