Add Keybinding to Dnf Upgrade and Shutdown to Gnome Shell

In Fedora I prefer to apply updates just before shutting down so that next time I boot up the updates will be in place.

For me this seems like the best way to do it.

To make that easier I also then create a keybinding so that I can hit [Start]+[q] to trigger the upgrade/shutdown process in a terminal

Being a lazy developer I prefer to have things automated and so here is a bash command to set this up:

cat <<'EOF' | bash 
echo "setting up keybinding";
dconf write $custom0path/binding "'<Super>q'"
dconf write $custom0path/command "'gnome-terminal --command=\"sudo bash -c \'dnf -y upgrade; shutdown now\'\"'"
dconf write $custom0path/name "'upgrade and shutdown'"
gsettings set custom-keybindings "[$c0]"
echo "


try hitting [Start] + [q]


just copy/paste into an open terminal window to set this up

Tags: gnomeshelldnfupgrade