Skip to content

Instantly share code, notes, and snippets.

@mindnuts
Created November 3, 2020 05:00
Show Gist options
  • Save mindnuts/ba60d69ceabcefbbaa1047c5302f8081 to your computer and use it in GitHub Desktop.
Save mindnuts/ba60d69ceabcefbbaa1047c5302f8081 to your computer and use it in GitHub Desktop.
Restart audio devices

create a text file

sudo touch /usr/local/bin/audio-restart

make it executable

sudo chmod +x /usr/local/bin/audio-restart

use the content of the file below and run it

#!/bin/bash
pulseaudio -k && pkexec alsa force-reload
zenity(){
/usr/bin/zenity "$@" 2>/dev/null
}
zenity --info --width 300 --text "Audio device restarted. Click OK to continue."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment