Skip to content

Commit

Permalink
Ubuntu 18.04 update
Browse files Browse the repository at this point in the history
  • Loading branch information
cbalx4life committed Jul 24, 2018
1 parent 3ab59e8 commit 844540e
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions nvidia-prime.r.3s.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
#!/usr/bin/env bash
#f4844fe12141854091f4d9d36acb4ac7362b98b7!/usr/bin/env bash
run_as_root="pkroot -d" # gksu; pkroot; gnomesu -c;

activate_intel="\"$run_as_root \\\"prime-select intel\\\"\""
activate_nvidia="\"$run_as_root \\\"prime-select nvidia\\\"\""

activate_intel_and_logout="\"$run_as_root \\\"prime-select intel\\\" && sleep 1 && gnome-session-quit --logout --no-prompt\""
activate_nvidia_and_logout="\"$run_as_root \\\"prime-select nvidia\\\" && sleep 1 && gnome-session-quit --logout --no-prompt\""
activate_intel="\"\
notify-send -h int:transient:2 \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"Switching graphics. Please reboot to finalize process! \\\"; \
$run_as_root \\\"prime-select intel\\\" \
\""

logout_cmd="\"gnome-session-quit --logout --no-prompt\""
activate_nvidia="\"\
notify-send -h int:transient:2 \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"Switching graphics. Please reboot to finalize process! \\\"; \
$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... \\\"; \
$run_as_root \\\"prime-select intel\\\"; \
notify-send -h int:transient:2 -i \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"System will reboot! \\\"; \
sleep 2; \
systemctl reboot \
\""

activate_nvidia_and_reboot="\"\
notify-send $notify_on_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! \\\"; \
sleep 2; \
systemctl reboot \
\""

reboot_cmd="\"\
notify-send -h int:transient:2 -i \\\"dialog-information-symbolic\\\" \\\"NVidia Prime Indicator\\\" \\\"System will reboot! \\\"; \
sleep 2; \
systemctl reboot \
\""

nvidia_settings="\"nvidia-settings -p 'PRIME Profiles'\""
nvidia_active_icon="nvidia-active-symbolic"
nvidia_inactive_icon="nvidia-inactive-symbolic"
logout_icon="system-log-out"
reboot_icon="system-restart"


QUERY=$(prime-select query)
Expand All @@ -32,7 +57,7 @@ echo "---"
echo "Switch to INTEL | iconName='prime-indicator-intel' bash=$activate_intel terminal=false"
echo "Switch to NVIDIA | iconName='prime-indicator-nvidia' bash=$activate_nvidia terminal=false"
echo "---"
echo "Switch to INTEL :: Log Out | iconName='prime-indicator-intel' bash=$activate_intel_and_logout terminal=false"
echo "Switch to NVIDIA :: Log Out | iconName='prime-indicator-nvidia' bash=$activate_nvidia_and_logout terminal=false"
echo "Switch to INTEL :: REBOOT | iconName='prime-indicator-intel' bash=$activate_intel_and_reboot terminal=false"
echo "Switch to NVIDIA :: REBOOT | iconName='prime-indicator-nvidia' bash=$activate_nvidia_and_reboot terminal=false"
echo "---"
echo "Log Out | iconName=$logout_icon bash=$logout_cmd terminal=false"
echo "System Reboot | iconName=$reboot_icon bash=$reboot_cmd terminal=false"

0 comments on commit 844540e

Please sign in to comment.