dtfscript: Implement service logging coloration

This commit is contained in:
2018-09-27 20:23:15 -05:00
parent e6b9abd2cf
commit b15d1e61cf
5 changed files with 20 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ service_process="sxhkd"
function prestart-extra() {
if ! pgrep bspwm > /dev/null 2>&1; then
svc_log "Not under bspwm"
svc_log "Not under bspwm" 2
return 1
fi
return 0

View File

@@ -11,7 +11,7 @@ service_process="compton"
function prestart-extra() {
if [[ "$HOST" == "vm-*" ]]; then
svc_log "Will not start: in a VM"
svc_log "Will not start: in a VM" 2
return 1
fi
return 0

View File

@@ -22,7 +22,7 @@ function start-extra() {
if xprop -name "Conky" > /dev/null 2>&1; then break; fi
sleep 0.01
if (( $i > 99 )); then
svc_log "Conky may spawn behind the current desktop"
svc_log "Conky may spawn behind the current desktop" 2
break
fi
done

View File

@@ -20,8 +20,8 @@ function start() {
# Spawn bars on the primary monitor
export PB_MONITOR=$(xrandr -q | awk '/primary/{print $1}')
svc_log "Starting primary on monitor $PB_MONITOR"
polybar -r primary& > /dev/null 2>&1
polybar -r primary-2& > /dev/null 2>&1
polybar -r primary& >/dev/null 2>&1
polybar -r primary-2& >/dev/null 2>&1
# Spawn more for each secondary
export secondary_monitors=$(xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}')
@@ -31,8 +31,8 @@ function start() {
for monitor in $secondary_monitors; do
svc_log "Starting secondary on monitor $monitor"
PB_MONITOR=$monitor
polybar -r secondary& > /dev/null 2>&1
polybar -r secondary-2& > /dev/null 2>&1
polybar -r secondary& >/dev/null 2>&1
polybar -r secondary-2& >/dev/null 2>&1
done
return 0
}