diff --git a/Makefile b/Makefile index 44ff86c..0deb63d 100644 --- a/Makefile +++ b/Makefile @@ -36,3 +36,7 @@ amfora_configs: check_xdg_settings .PHONY: dunst_configs dunst_configs: check_xdg_settings @./helpers/dunst/generate-dunst-config + +.PHONY: logrotate_configs +logrotate_configs: check_xdg_settings + @./helpers/logrotate/generate-logrotate-config diff --git a/config/X11/xinitrc b/config/X11/xinitrc index 78dd403..e2d35dc 100644 --- a/config/X11/xinitrc +++ b/config/X11/xinitrc @@ -2,12 +2,19 @@ [[ -f "${HOME}/.bashrc" ]] && source "${HOME}/.bashrc" -if [ -x "$( command -v polybar )" ]; then - "${XDG_CONFIG_HOME}/polybar/launch.sh" & -fi - +# Start dunst if [ -x "$( command -v dunst )" ]; then dunst & fi +# Load the wallpaper +xwallpaper --stretch ~/.local/config/wallpaper/wallpaper.png & + +# Rotate the home logs with logrotate +logrotate \ + --state=${XDG_STATE_HOME}/logrotate/status \ + --log=${LOG_HOME}/logrotate.log \ + ${XDG_CONFIG_HOME}/logrotate/logrotate.conf \ + & + exec dwm diff --git a/config/logrotate/logrotate.conf b/config/logrotate/logrotate.conf new file mode 100644 index 0000000..61967c2 --- /dev/null +++ b/config/logrotate/logrotate.conf @@ -0,0 +1,7 @@ +${LOG_HOME}/*.log ${LOG_HOME}/nvim/*.log { + rotate 3 + size 10M + nocompress + notifempty + copytruncate +} diff --git a/helpers/logrotate/generate-logrotate-config b/helpers/logrotate/generate-logrotate-config new file mode 100755 index 0000000..bf58629 --- /dev/null +++ b/helpers/logrotate/generate-logrotate-config @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -euo pipefail + +GIT_ROOT_DIR="$( cd "$( dirname $0 )/../.." && pwd )" +LF_DOTFILES_SOURCE_DIR="${GIT_ROOT_DIR}/config/logrotate" +LF_DOTFILES_DESTINATION_DIR="${XDG_CONFIG_HOME}/logrotate" + +if ! [ -d ${LF_DOTFILES_DESTINATION_DIR} ]; then + echo "INFO: Creating directory ${LF_DOTFILES_DESTINATION_DIR}" + mkdir ${LF_DOTFILES_DESTINATION_DIR} +fi + +rsync -avh ${LF_DOTFILES_SOURCE_DIR}/logrotate.conf ${LF_DOTFILES_DESTINATION_DIR}/logrotate.conf && chmod a-rwx,u+rw $_