#!/bin/bash

[ ! -f ~/cleansystem ] && exit 1

sudo pacman --noconfirm -Rcs $(comm -23 <(pacman -Qq | sort) <(sort ~/cleansystem))

exit $?