From 8418b89cd34108785c704b4b797f34ce2082fd1a Mon Sep 17 00:00:00 2001 From: cyberalex4life Date: Sun, 29 Jul 2018 15:03:10 +0300 Subject: [PATCH] Cleaning --- nvidia-prime.r.3s.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nvidia-prime.r.3s.sh b/nvidia-prime.r.3s.sh index abd9055..2c63ce7 100755 --- a/nvidia-prime.r.3s.sh +++ b/nvidia-prime.r.3s.sh @@ -1,35 +1,37 @@ #!/usr/bin/env bash run_as_root="pkroot -d" # gksu; pkroot; gnomesu -c; - +notify_switch="notify-send -h int:transient:2 \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"Switching graphics. Please reboot to finalize process! \\\" & " +notify_switch_and_reboot="notify-send -h int:transient:2 -i \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"Switching graphics. System will reboot soon... \\\" & " +notify_reboot="notify-send -h int:transient:2 -i \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"System will reboot! \\\" & " activate_intel="\"\ - notify-send -h int:transient:2 \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"Switching graphics. Please reboot to finalize process! \\\"; \ + $notify_switch \ $run_as_root \\\"prime-select intel\\\" \ \"" activate_nvidia="\"\ - notify-send -h int:transient:2 \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"Switching graphics. Please reboot to finalize process! \\\"; \ + $notify_switch \ $run_as_root \\\"prime-select nvidia\\\" \ \"" activate_intel_and_reboot="\"\ - notify-send -h int:transient:2 -i \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"Switching graphics. System will reboot soon... \\\"; \ + $notify_switch_and_reboot \ $run_as_root \\\"prime-select intel\\\"; \ - notify-send -h int:transient:2 -i \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"System will reboot! \\\"; \ + $notify_reboot \ sleep 2; \ systemctl reboot \ \"" activate_nvidia_and_reboot="\"\ - notify-send $notify_on_switch_and_reboot & \ + $notify_switch_and_reboot \ $run_as_root \\\"prime-select nvidia\\\"; \ - notify-send -h int:transient:2 -i \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"System will reboot! \\\"; \ + $notify_reboot \ sleep 2; \ systemctl reboot \ \"" reboot_cmd="\"\ - notify-send -h int:transient:2 -i \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"System will reboot! \\\"; \ + $notify_reboot \ sleep 2; \ systemctl reboot \ \""