#!/bin/bash # picom launcher that adapts to the environment if [ -e /opt/instantos/potato ] || iconf -i potato; then echo "no compositing for you, your pc is a potato" exit fi genconfig() { if [ -e ~/.compton.conf ]; then rm ~/.compton.conf echo "removed old compton file" fi mkdir -p ~/.config/picom echo '# instantos # remove the above comment to disable auto settings' >.config/picom/picom.conf if ! grep -q 'hypervisor' /proc/cpuinfo; then echo 'fading = true fade-in-step = 0.15 fade-out-step = 0.15' >>.config/picom/picom.conf echo "not a vm" if iconf -i blur; then # possibility 3: tee -a .config/picom/picom.conf >/dev/null <> .config/picom/picom.conf fi } cd || exit if ! [ -e .config/picom/picom.conf ] || grep -q 'instantos' .config/picom/picom.conf && ! grep 'picom' ~/.instantrc | grep '0[^a-zA-Z]*$'; then genconfig fi if (! grep -q 'hypervisor' /proc/cpuinfo && grep -q 'instantos' .config/picom/picom.conf && iconf -i blur) || iconf -i experimentalpicom; then echo "running picom with blur support" picom --experimental-backends & else picom "$@" & fi