Commands to run when Connecting HDMI

Posted by yurividal on Ask Ubuntu See other posts from Ask Ubuntu or by yurividal
Published on 2014-05-30T15:10:58Z Indexed on 2014/05/30 16:02 UTC
Read the original article Hit count: 259

Filed under:
|

Everytime I connect my pc to my tv using my HDMI cable (to watch my movies), I have to manually go to:

1- Monitors, to select "mirror" screen to HDMI 2- Sound, to select the HDMI as default sound output 3- Screen Off an Lock, to avoid screen locking while watching a video.

Is there a way I can automate this? Or at least write a script with commands that will do this. (I could manually run a script every time I connect my HDMI, and then run annother one to undo the changes later)

How can I do these actions from a Command Line?

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about hdmi

  • HDMI Sound Stops Working

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    When not used for a few hours the sound stops working on my HTPC. To get sound to work again I have to unplug the HDMI cable and plug it back in again When this sound "outage" occurs, the HDMI device dissapears from the sound config output devices I see the following in dmesg [78534.010328] HDMI… >>> More

  • DVI+HDMI out, at startup only HDMI is available

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I have my computer next to my hdtv. The main screen is connected via DVI while the tv is connected via HDMI. If I start the computer without the HDMI plugged in, everything is ok: I see the login screen and sound is output through analog out. But if the HDMI is plugged in before I start the computer… >>> More

  • EHome IR receiver and Ubuntu 13 - any one have this working?

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I have a "generic" USB IR receiver I purchased off of Ebay to make my life a little easier with XBMC on my Ubuntu box. I am currently running 13.10 and have never tried nor have any knowledge of IR in Ubuntu. I know of lirc, and I know a lot of it is now included in the kernel. My understanding… >>> More

  • HDMI-HDMI cable length

    as seen on Super User - Search for 'Super User'
    I'd like to connect my PC to an HDTV using an HDMI-HDMI cable. The distance between them is about 8 m; is the length going to be an issue? I'm worried the signal might deteriorate over such a distance. Also, does price have any major impact on the signal quality? I'd like to buy an 8-10 m cable for… >>> More

  • Another sound not working post

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    Tried all the other "sound not working" posts i think, lost count. purge/reinstall alsa and pulse, reboot, add user to audio group, various lines in the alsa config file such as "options snd-hda-intel model=" then tried different options like generic, auto, basic, default, etc. tried pulseaudio -k… >>> More