Snippets

Shell

Notifications / list chooser
GUI 
 Not possible in Linux headless installation. 
 Notification 
 zenity --notification \
	 --window-icon="info" \
	 --text="Blub Blub" 
 List selection 
 zenity --list --radiolist --height=275 --width=400 \
	--title="HP OMEN Profile selection" \
 	--column="" 	--column="Profile" --column="Description"\
 FALSE "cool" "Cool Power Profile" \
	TRUE "balanced" "Balanced Power Profile" \
	FALSE "performance" "Performance Power Profile" 
 To get the result of this selection just do it like this: VARNAME= $( zenity --list --radiolist --height=275 --width=400 --title= " HP OMEN Profile selection " --column= " " --column= " Profile " --column= " Description " FALSE "cool" "Cool Power Profile" FALSE "cool" "Cool Power Profile" TRUE "balanced" "Balanced Power Profile" FALSE "performance" "Performance Power Profile" ) 
 Headless 
 Notification 
 whiptail --title "Title Blub" --msgbox "Text blub blub blub" 8 78 
 List selection 
 whiptail --title "Title Blub" --fb --menu "Select option" 11 50 3 \
	"option1" "Option text 1" \
	"option2" "Option text 2" \
	"option3" "Option text 3" 
 To get the result of any of these just start do it like this   VARNAME=$(whiptail --title " HP OMEN Profile selection " --fb --menu " Select option " 11 50 " cool " " Cool Power Profile ""balanced" "Balanced Power Profile" "performance" "Performance Power Profile" 3>&1 1>&2 2>&3 )

Export & Import APT Packages
Export 
 dpkg --get-selections > packages.list 
 Export extended 
 apt-mark showauto > package.states.auto.list
apt-mark showmanual > package.states.manual.list
apt-mark showhold > package.states.hold.list 
 Import 
 sudo dpkg --set-selections < packages.list
sudo apt-get update
sudo apt-get -u dselect-upgrade 
 Import extended 
 sudo apt-mark auto $(cat package.states.auto.list)
sudo apt-mark manual $(cat package.states.manual.list)
sudo apt-mark manual $(cat package.states.auto.list)