You are not logged in.
So, I am working on making my hybrid graphics work and they do, but now the script I am using requires "gnome-session-save --logout". when I enter this into the terminal I get a command not found bash error. Any thoughts?
Last edited by LoBo3268715 (2012-03-03 23:22:06)
"Linux. A big, bad, scary computer operating system known only by people with neck beards."
Offline
http://www.archlinux.org/packages/extra … ion/files/
gnome-session package has e.g. gnome-session-quit command, but not gnome-session-save. Where did you get that script?
Offline
I got the script here. http://asusm51ta-with-linux.blogspot.com/ and then I was following the directions from here. https://help.ubuntu.com/community/HybridGraphics
"Linux. A big, bad, scary computer operating system known only by people with neck beards."
Offline
Here is the script I am working with.
#!/bin/bash
# "switch_between_cards.sh" script by RM, with useful changes from LoLL
# version 20100528
pci_integrated=$(lspci | grep VGA | sed -n '1p' | cut -f 1 -d " ")
pci_discrete=$(lspci | grep VGA | sed -n '2p' | cut -f 1 -d " ")
integrated=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_integrated | grep -o -P ':.:...:')
discrete=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_discrete | grep -o -P ':.:...:')
name_integrated=$(lspci | grep VGA | sed -n '1p' | sed -e "s/.* VGA compatible controller[ :]*//g" | sed -e "s/ Corporation//g" | sed -e "s/ Technologies Inc//g" | sed -e 's/\[[0-9]*\]: //g' | sed -e 's/\[[0-9:a-z]*\]//g' | sed -e 's/(rev [a-z0-9]*)//g' | sed -e "s/ Integrated Graphics Controller//g")
name_discrete=$(lspci | grep VGA | sed -n '2p' | sed -e "s/.* VGA compatible controller[ :]*//g" | sed -e "s/ Corporation//g" | sed -e "s/ Technologies Inc//g" | sed -e 's/\[[0-9]*\]: //g' | sed -e 's/\[[0-9:a-z]*\]//g' | sed -e 's/(rev [a-z0-9]*)//g' | sed -e "s/ Integrated Graphics Controller//g")
if [ "$integrated" = ":+:Pwr:" ]
then
integrated_condition="(*) - Power ON"
elif [ "$integrated" = ": :Pwr:" ]
then
integrated_condition="( ) - Power ON"
elif [ "$integrated" = ": :Off:" ]
then
integrated_condition="( ) - Power OFF"
fi
if [ "$discrete" = ":+:Pwr:" ]
then
discrete_condition="(*) - Power ON"
elif [ "$discrete" = ": :Pwr:" ]
then
discrete_condition="( ) - Power ON"
elif [ "$discrete" = ": :Off:" ]
then
discrete_condition="( ) - Power OFF"
fi
gxmessage -center \
-buttons "_Cancel":1,"switch to _Integrated":101,"switch to _Discrete":102 \
-wrap \
-title "Choose Hybrid Graphic Card" \
"Choose Hybrid Graphic Card
=================
Integrated: $integrated_condition : $name_integrated
Discrete: $discrete_condition : $name_discrete"
whichCard=$?
case "$whichCard" in
1)
echo "Exit"
;;
101)
if [ "$integrated" == ":+:Pwr:" ] && [ "$discrete" == ": :Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" "switching to $name_integrated"
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
elif [ "$integrated" == ": :Pwr:" ] && [ "$discrete" == ":+:Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" "switching to $name_integrated"
echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
gnome-session-save --logout
elif [ "$integrated" == ": :Off:" ] && [ "$discrete" == ":+:Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" "switching to $name_integrated"
echo ON > /sys/kernel/debug/vgaswitcheroo/switch
echo DIGD > /sys/kernel/debug/vgaswitcheroo/switch
gnome-session-save --logout
elif [ "$integrated" == ":+:Pwr:" ] && [ "$discrete" == ": :Off:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" "already switched to $name_integrated"
fi
;;
102)
if [ "$integrated" == ":+:Pwr:" ] && [ "$discrete" == ": :Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_up.png" "switching to $name_discrete"
echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
gnome-session-save --logout
elif [ "$integrated" == ": :Pwr:" ] && [ "$discrete" == ":+:Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_up.png" "switching to $name_discrete"
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
elif [ "$integrated" == ":+:Pwr:" ] && [ "$discrete" == ": :Off:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_up.png" "switching to $name_discrete"
echo ON > /sys/kernel/debug/vgaswitcheroo/switch
echo DDIS > /sys/kernel/debug/vgaswitcheroo/switch
gnome-session-save --logout
elif [ "$integrated" == ": :Off:" ] && [ "$discrete" == ":+:Pwr:" ]
then
notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_up.png" "already switched to $name_discrete"
fi
;;
esac Last edited by LoBo3268715 (2012-03-03 22:26:13)
"Linux. A big, bad, scary computer operating system known only by people with neck beards."
Offline
Have you tried using our wiki: https://wiki.archlinux.org/index.php/Hybrid_graphics ?
Please edit your post. When pasting code, please use [ code ] tags https://bbs.archlinux.org/help.php#bbcode
like thisOffline
I did use our wiki ( along with everyother wiki I could find ) and finally after 13 months of researching this problem I can switch to my ATI card with the command line. The script I posted is a nice little GUI for the actual switch. I would like to be able to navigate through my gnome 3 menu and have the option ready to select. I know it's not necessary but it would be a nice touch. Is there any other command I could put in the script to log me out of my gnome session and complete the switch?
Last edited by LoBo3268715 (2012-03-03 22:50:40)
"Linux. A big, bad, scary computer operating system known only by people with neck beards."
Offline
I'm marking this as solved. The script works even though it does not log me out of my session automatically, it does however switch graphics cards. I might finally be able to ditch windows entirely now. God, I love this distro, so glad I made the leap from Linux mint / Ubuntu. Thank you for your input karol.
"Linux. A big, bad, scary computer operating system known only by people with neck beards."
Offline