Wednesday, April 28, 2021

Switching audio and adding a notification

 Once you get the audio switching working, it's nice to have a little bit of feedback, so add a little message with notify-send.


so CTRL+ALT+9 does

sh -c "pactl set-card-profile 0 output:hdmi-stereo;notify-send 'switch to hdmi'"

 

and CTRL+ALT+0 does:

 sh -c "pactl set-card-profile 0 output:analog-stereo; notify-send 'switch to headphone'"


Thanks to this page:

https://askubuntu.com/questions/60379/how-to-combine-two-commands-as-a-launcher

Thursday, April 8, 2021

Switching the audio from HDMI to headphones

One of the things I do too frequently is to switch from my headphone output to the hdmi output. It's too hard to use the control panel, I want a keystroke to do it: 

After wrestling with pactl awhile I got it working.

 

If you run "pactl list cards" It will show you a list of profiles:

 "pactl set-card-profile 0 output:hdmi-stereo" 

"pactl set-card-profile 0 output:analog-stereo" 

would switch between the different outputs, so just add some Keyboard Shortcuts in the Settings.

Tuesday, April 6, 2021

Sometimes I have to kill gnome shell

Using Ubuntu 20.04, sometimes the screen will go black and I can't do anything. I can still see my mouse pointer and move it around, I can drop to a text console with CTRL+ALT+F4 and back with CTRL+ALT+F2 but it's not working right. I've found that if I get to a text console and login and then find the number of the gnome-shell process with "ps -ax | grep gnome-shell" then "kill -9 " it will close the gnome-shell and after a few seconds the system will relaunch it, bringing the system back to normal. It doesn't always work, but sometimes it's a lifesaver when it goes non responsive and you can save what you were working on.