#!/bin/bash function off_monitor_if_hdmi_plugged_in() { monitor_status=$(xrandr | grep "HDMI-1-4 connected" | wc -l) if [ $monitor_status == 1 ]; then xrandr --auto xrandr --output eDP-1 --off fi } function caps_to_esc(){ xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'; } function start() { killall $1 sleep .5 $($1 $2) & } off_monitor_if_hdmi_plugged_in caps_to_esc start picom "-b -D 4 --vsync" start nitrogen "--restore" start run_spotifyd