Score:0

How to script: disable monitor, then "Revert Settings" same as settings GUI?

ru flag

I would like to know if it's possible to script/CLI the same actions that the following in Ubuntu settings (Screen Display) would perform (or some other way to "reset" a monitor without affecting open windows/layout):

  1. Disable monitor (2).
  2. Click "Apply"
  3. Click "Revert Settings"

This may seem pointless but let me explain: I have a system with 2 monitors. My sound is going through HDMI/DisplayPort on monitor (2).

Often when my PC wakes from suspend the HDMI / DisplayPort 3 - Built-in Audio output device is missing. So I get no sound.

The only way I have found to fix this (without a reboot) is to open the Ubuntu settings app and to perform the 3 steps above. This disables/re-enables the monitor and the audio output device always comes back. Plus all windows/layout remain correct across both monitors.

I would like to script this process so I can do it automatically on every wakeup.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.