You are not logged in.
I found a sound script so that when my tv outputs hdmi sound also does so automatically. Where do I put?
#!/bin/sh
if [[ $1 ]]
then
xrandr --output HDMI1 --off
pactl set-card-profile 0 output:analog-stereo
else
xrandr --output HDMI1 --mode 1920x1080 --right-of LVDS1
pactl set-card-profile 0 output:hdmi-stereoLast edited by quasifilmie (2012-01-30 00:56:33)
Offline
Do you want to do this system wide, or for an individual user?
I think it will work system wide if you invoke it from /etc/rc.local
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I prefer system-wide but perhaps it could be a problem. I pasted the script in rc.local and I get failed to open display connection refused when I startup. Could the script be getting invoked to soon? Where would I put this for a single-user?
Offline
Yeah, I was afraid of that.
How do you start your window manager, and which window manager / desktop environment are you using?
If you are using startx, you could invoke it from your ~/.xinitrc. You might create a second scipt, launch it in the background, and put a sleep at the beginning to ensure X is ready.
KDE, Openbox and Xfce4 allow you to run scripts at start up. Gnome might, I would not know.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I am using gnome 3. I have gdm as a daemon in rc.conf.
For gnome-session-properties, would I make a .sh file and add that in gnome-session properties.
Offline
Tried to execute the sh file and it did not work. I get command not found. Sorry, I am a complete noob with bash.
Offline
Make sure the script is executable
chmod a+x <path to script>Offline
Im just going to mark as solved as the script does not actually do the intended purpose. @skunktrader I did get the script to execute though.
Offline