From a493a2e6312ea3454679d9002f4fa13bc1bd23c1 Mon Sep 17 00:00:00 2001 From: Tahinli <96421894+Tahinli@users.noreply.github.com> Date: Thu, 8 Dec 2022 00:11:45 +0300 Subject: [PATCH] better versions --- configFixer.sh | 26 ++++++++++++++++++++++++-- prefres.sh | 14 ++++++++------ 2 files changed, 32 insertions(+), 8 deletions(-) mode change 100644 => 100755 configFixer.sh diff --git a/configFixer.sh b/configFixer.sh old mode 100644 new mode 100755 index 8185c4e..9ba776d --- a/configFixer.sh +++ b/configFixer.sh @@ -1,12 +1,30 @@ echo -e ' --->Tahinli Linux Easy Config Fixer<---\n' -echo -e '1) Nvidia Primary Fix\n2) Alsa Headset Detection Fix\n' +function restartSelection + { + echo -e ' |#|Do You Want to Restart System\n0) Restart\n1) Do not Restart\n' + read restartCheck + case $restartCheck in + 0) + echo -e '\n |»|Restarting\n' + reboot + ;; + 1) + echo -e '\n |»|Do not Restart Selected\n' + ;; + esac + } +echo -e '1) Discrete Nvidia GPU as a Primary\n2) Integrated GPU as a Primary\n3) Alsa Headset Detection Fix\n' read selection case $selection in 1) - echo -e ' #Nvidia Primary Fix Selected\n' + echo -e ' #Discrete Nvidia GPU as a Primary Selected\n' echo -e '#This file is provided by xorg-x11-drv-nvidia\n#Edited by Tahinli\n\nSection "OutputClass"\n\tIdentifier "nvidia"\n\tMatchDriver "nvidia-drm"\n\tDriver "nvidia"\n\tOption "AllowEmptyInitialConfiguration"\n\tOption "SLI" "Auto"\n\tOption "BaseMosaic" "on"\n\tOption "PrimaryGPU" "yes"\nEndSection\n\nSection "ServerLayout"\n\tIdentifier "layout"\n\tOption "AllowNVIDIAGPUScreens"\n\tOption "PrimaryGPU" "yes"\nEndSection\n' | sudo tee /etc/X11/xorg.conf.d/nvidia.conf ;; 2) + echo -e ' #Integrated GPU as a Primary Selected\n' + echo -e '#This file is provided by xorg-x11-drv-nvidia\n#Edited by Tahinli\n\nSection "OutputClass"\n\tIdentifier "nvidia"\n\tMatchDriver "nvidia-drm"\n\tDriver "nvidia"\n\tOption "AllowEmptyInitialConfiguration"\n\tOption "SLI" "Auto"\n\tOption "BaseMosaic" "on"\n\tOption "PrimaryGPU" "no"\nEndSection\n\nSection "ServerLayout"\n\tIdentifier "layout"\n\tOption "AllowNVIDIAGPUScreens"\n\tOption "PrimaryGPU" "no"\nEndSection\n' | sudo tee /etc/X11/xorg.conf.d/nvidia.conf + ;; +3) echo -e ' #Alsa Headset Detectetion Fix Selected\n' echo 'options snd-hda-intel index=0 model=dell-headset-multi' | sudo tee /etc/modprobe.d/alsa-base.conf ;; @@ -14,3 +32,7 @@ case $selection in echo -e ' ---Invalid Selection\n Quiting' ;; esac +if [[ $selection > 0 ]] && [[ $selection < 3 ]]; +then + restartSelection +fi \ No newline at end of file diff --git a/prefres.sh b/prefres.sh index e1be294..485d9b4 100755 --- a/prefres.sh +++ b/prefres.sh @@ -1,11 +1,12 @@ echo -e "\n<--##Tahinli Resolution Script##-->\n" -echo " 1- Join- Second_Vertical" -echo " 2- Join- Linear_Extended" -echo " 3- Mirror" -echo " 4- First Monitor Only" -echo " 5- Second Monitor Only" +echo " 1- Join- Second_Vertical" +echo " 2- Join- Linear_Extended" +echo " 3- Mirror" +echo " 4- First Monitor Only" +echo " 5- Second Monitor Only" +echo -e " 6- Second Monitor Only-Vertical\n" read selection -if [[ $selection > 0 ]] && [[ $selection < 6 ]]; +if [[ $selection > 0 ]] && [[ $selection < 7 ]]; then echo " --->Request's Accepted-|" xrandr --output HDMI-0 --off @@ -20,6 +21,7 @@ case $selection in xrandr --output HDMI-0 --mode 1920x1080 -r 75 --rotate normal;; 4)xrandr --output eDP-1-1 --mode 1920x1080 -r 144 --rotate normal;; 5)xrandr --output HDMI-0 --mode 1920x1080 -r 75 --rotate normal;; + 6)xrandr --output HDMI-0 --mode 1920x1080 -r 75 --rotate right;; *)echo "------Invalid Selection";; esac echo -e "\n # DONE #"