More properly wrap X-specific preexecute functions

This commit is contained in:
Salt 2020-10-04 07:40:55 -05:00
parent 241085b08f
commit f74783a659

View File

@ -377,33 +377,36 @@ step_preexecute() {
# Disabled here because an XDGCD of KDE implies kded and other KDE parts, breaking copypasta and other things # Disabled here because an XDGCD of KDE implies kded and other KDE parts, breaking copypasta and other things
#export XDG_CURRENT_DESKTOP="KDE" #export XDG_CURRENT_DESKTOP="KDE"
fi fi
# xhost # X-specific stuff
if has xhost; then if [ -n "$DISPLAY" ]; then
if xhost +si:localuser:"$(id -un)" >/dev/null 2>&1; then # xhost
log "Session open to other sessions by this user" if has xhost; then
else if xhost +si:localuser:"$(id -un)" >/dev/null 2>&1; then
warn "Failed to open session via xhost" log "Session open to other sessions by this user"
else
warn "Failed to open session via xhost"
fi
fi fi
fi # xresources
# xresources if has xrdb && [ -r "$HOME/.Xresources" ]; then
if [ -n "$DISPLAY" ] && has xrdb && [ -r "$HOME/.Xresources" ]; then if xrdb "$HOME/.Xresources" >/dev/null 2>&1; then
if xrdb "$HOME/.Xresources" >/dev/null 2>&1; then log "Loaded in .Xresources"
log "Loaded in .Xresources" else
else warn "Failed to load .Xresources"
warn "Failed to load .Xresources" fi
fi
# xsetroot
if has xsetroot; then
log "Setting root window properties"
xsetroot -cursor_name left_ptr
fi
# xset
if has xset; then
log "Disabling bell"
xset -b
log "Disabling DPMS"
xset s off -dpms
fi fi
fi
# xsetroot
if has xsetroot; then
log "Setting root window properties"
xsetroot -cursor_name left_ptr
fi
# xset
if has xset; then
log "Disabling bell"
xset -b
log "Disabling DPMS"
xset s off -dpms
fi fi
} }
step_postexecute() { step_postexecute() {