diff --git a/.local/share/dwm/autostart.sh b/.config/dwm/autostart.sh similarity index 81% rename from .local/share/dwm/autostart.sh rename to .config/dwm/autostart.sh index bf56cc6d..d87de7fc 100644 --- a/.local/share/dwm/autostart.sh +++ b/.config/dwm/autostart.sh @@ -1,5 +1,8 @@ #!/bin/sh +# This script is executed by DWM on start. +# It should be used to start programs that need access to the session dbus or the display + # Set keymaps remaps -qd @@ -30,10 +33,7 @@ env \ xss-lock -n /usr/libexec/xsecurelock/dimmer -l -- sh -c "xsecurelock -- playerctl pause || kill -9 -1" & # Run host autostart -"$XDG_CONFIG_HOME/dwm/host.sh" & +[ -r "$XDG_CONFIG_HOME/dwm/host.sh" ] && "$XDG_CONFIG_HOME/dwm/host.sh" & # Check for updates checkup & - -# start some programs - diff --git a/.local/share/dwm/start b/.config/dwm/start.sh similarity index 66% rename from .local/share/dwm/start rename to .config/dwm/start.sh index 6fffa89f..67831da4 100755 --- a/.local/share/dwm/start +++ b/.config/dwm/start.sh @@ -27,14 +27,11 @@ errorlog() { done } -# shellcheck disable=1073,1072 -() { - stdout="$XDG_RUNTIME_DIR/dwm-stdout" - stderr="$XDG_RUNTIME_DIR/dwm-stderr" - [ -p "$stdout" ] || mkfifo "$stdout" - [ -p "$stderr" ] || mkfifo "$stderr" - cat <"$stdout" | infolog "$1" & - cat <"$stderr" | errorlog "$1" & - # shellcheck disable=2068 - pidof -sx "$1" || $@ >"$stdout" 2>"$stderr" -} $@ +stdout="$XDG_RUNTIME_DIR/dwm-stdout" +stderr="$XDG_RUNTIME_DIR/dwm-stderr" +[ -p "$stdout" ] || mkfifo "$stdout" +[ -p "$stderr" ] || mkfifo "$stderr" +cat <"$stdout" | infolog "$1" & +cat <"$stderr" | errorlog "$1" & +# shellcheck disable=2068 +pidof -sx "$1" || $@ >"$stdout" 2>"$stderr" diff --git a/.local/share/dwm/default.sh b/.local/share/dwm/default.sh deleted file mode 100644 index fb5e3f4a..00000000 --- a/.local/share/dwm/default.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -LOGFILE="${LOGFILE:-${HOME}/.local/log/${1}.log}" -BOLD="$(tput bold)" -RED="$(tput setaf 1)" -GREEN="$(tput setaf 2)" -NC="$(tput sgr0)" - -infolog() { - while IFS= read -r line; do - echo "[$(date +%X)][${BOLD}${GREEN}INF${NC}][$1] $line" >>"${LOGFILE}" - done -} - -errorlog() { - while IFS= read -r line; do - echo "[$(date +%X)][${BOLD}${RED}ERR${NC}][$1] $line" >>"${LOGFILE}" - done -} - -start() { - stdout="$XDG_RUNTIME_DIR/dwm-stdout" - stderr="$XDG_RUNTIME_DIR/dwm-stderr" - [ -p "$stdout" ] || mkfifo "$stdout" - [ -p "$stderr" ] || mkfifo "$stderr" - cat <"$stdout" | infolog "$1" & - cat <"$stderr" | errorlog "$1" & - # shellcheck disable=2068 - pidof -sx "$1" || $@ >"$stdout" 2>"$stderr" -} - -# Set up xsecurelock -xset s 300 -env \ - XSECURELOCK_AUTH_BACKGROUND_COLOR="#24283b" \ - XSECURELOCK_AUTH_FOREGROUND_COLOR="#c0caf5" \ - XSECURELOCK_AUTH_WARNING_COLOR="#f7768e" \ - XSECURELOCK_BACKGROUND_COLOR="#15161E" \ - XSECURELOCK_DATETIME_FORMAT="%d.%m.%Y %H:%M" \ - XSECURELOCK_PASSWORD_PROMPT="time_hex" \ - XSECURELOCK_AUTH_TIMEOUT=5 \ - XSECURELOCK_BLANK_TIMEOUT=30 \ - XSECURELOCK_BLANK_DPMS_STATE="off" \ - XSECURELOCK_BURNIN_MITIGATION=0 \ - XSECURELOCK_DIM_FPS=60 \ - XSECURELOCK_SHOW_DATETIME=1 \ - XSECURELOCK_SAVER="/usr/libexec/xscreensaver/cubicgrid" \ - XSECURELOCK_SHOW_USERNAME=1 \ - XSECURELOCK_SHOW_HOSTNAME=1 \ - xss-lock -n /usr/libexec/xsecurelock/dimmer -l -- sh -c "xsecurelock -- playerctl pause || kill -9 -1" &